Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/contact.php.tar

home/lmsyaran/public_html/j3/plugins/editors-xtd/contact/contact.php000064400000002637151157203560021703
0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Editors-xtd.contact
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Editor Contact button
 *
 * @since  3.7.0
 */
class PlgButtonContact extends JPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.7.0
	 */
	protected $autoloadLanguage = true;

	/**
	 * Display the button
	 *
	 * @param   string  $name  The name of the button to add
	 *
	 * @return  JObject  The button options as JObject
	 *
	 * @since   3.7.0
	 */
	public function onDisplay($name)
	{
		$user  = JFactory::getUser();

		if ($user->authorise('core.create', 'com_contact')
			|| $user->authorise('core.edit', 'com_contact')
			|| $user->authorise('core.edit.own',
'com_contact'))
		{
			// The URL for the contacts list
			$link =
'index.php?option=com_contact&amp;view=contacts&amp;layout=modal&amp;tmpl=component&amp;'
				. JSession::getFormToken() . '=1&amp;editor=' . $name;

			$button          = new JObject;
			$button->modal   = true;
			$button->class   = 'btn';
			$button->link    = $link;
			$button->text    =
JText::_('PLG_EDITORS-XTD_CONTACT_BUTTON_CONTACT');
			$button->name    = 'address';
			$button->options = "{handler: 'iframe', size: {x: 800,
y: 500}}";

			return $button;
		}
	}
}
home/lmsyaran/public_html/j3/plugins/content/contact/contact.php000064400000006405151160602320021073
0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Content.Contact
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Registry\Registry;

/**
 * Contact Plugin
 *
 * @since  3.2
 */
class PlgContentContact extends JPlugin
{
	/**
	 * Database object
	 *
	 * @var    JDatabaseDriver
	 * @since  3.3
	 */
	protected $db;

	/**
	 * Plugin that retrieves contact information for contact
	 *
	 * @param   string   $context  The context of the content being passed to
the plugin.
	 * @param   mixed    &$row     An object with a "text"
property
	 * @param   mixed    $params   Additional parameters. See {@see
PlgContentContent()}.
	 * @param   integer  $page     Optional page number. Unused. Defaults to
zero.
	 *
	 * @return  boolean	True on success.
	 */
	public function onContentPrepare($context, &$row, $params, $page = 0)
	{
		$allowed_contexts = array('com_content.category',
'com_content.article', 'com_content.featured');

		if (!in_array($context, $allowed_contexts))
		{
			return true;
		}

		// Return if we don't have valid params or don't link the
author
		if (!($params instanceof Registry) ||
!$params->get('link_author'))
		{
			return true;
		}

		// Return if an alias is used
		if ((int) $this->params->get('link_to_alias', 0) === 0
&& $row->created_by_alias != '')
		{
			return true;
		}

		// Return if we don't have a valid article id
		if (!isset($row->id) || !(int) $row->id)
		{
			return true;
		}

		$contact        = $this->getContactData($row->created_by);
		$row->contactid = $contact->contactid;
		$row->webpage   = $contact->webpage;
		$row->email     = $contact->email_to;
		$url            = $this->params->get('url',
'url');

		if ($row->contactid && $url === 'url')
		{
			JLoader::register('ContactHelperRoute', JPATH_SITE .
'/components/com_contact/helpers/route.php');
			$row->contact_link =
JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid .
':' . $contact->alias, $contact->catid));
		}
		elseif ($row->webpage && $url === 'webpage')
		{
			$row->contact_link = $row->webpage;
		}
		elseif ($row->email && $url === 'email')
		{
			$row->contact_link = 'mailto:' . $row->email;
		}
		else
		{
			$row->contact_link = '';
		}

		return true;
	}

	/**
	 * Retrieve Contact
	 *
	 * @param   int  $userId  Id of the user who created the article
	 *
	 * @return  mixed|null|integer
	 */
	protected function getContactData($userId)
	{
		static $contacts = array();

		if (isset($contacts[$userId]))
		{
			return $contacts[$userId];
		}

		$query = $this->db->getQuery(true);

		$query->select('MAX(contact.id) AS contactid, contact.alias,
contact.catid, contact.webpage, contact.email_to');
		$query->from($this->db->quoteName('#__contact_details',
'contact'));
		$query->where('contact.published = 1');
		$query->where('contact.user_id = ' . (int) $userId);

		if (JLanguageMultilang::isEnabled() === true)
		{
			$query->where('(contact.language in '
				. '(' .
$this->db->quote(JFactory::getLanguage()->getTag()) .
',' . $this->db->quote('*') . ') '
				. ' OR contact.language IS NULL)');
		}

		$this->db->setQuery($query);

		$contacts[$userId] = $this->db->loadObject();

		return $contacts[$userId];
	}
}
home/lmsyaran/public_html/j3/plugins/privacy/contact/contact.php000064400000003474151161416440021110
0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Privacy.contact
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JLoader::register('PrivacyPlugin', JPATH_ADMINISTRATOR .
'/components/com_privacy/helpers/plugin.php');

/**
 * Privacy plugin managing Joomla user contact data
 *
 * @since  3.9.0
 */
class PlgPrivacyContact extends PrivacyPlugin
{
	/**
	 * Processes an export request for Joomla core user contact data
	 *
	 * This event will collect data for the contact core tables:
	 *
	 * - Contact custom fields
	 *
	 * @param   PrivacyTableRequest  $request  The request record being
processed
	 * @param   JUser                $user     The user account associated
with this request if available
	 *
	 * @return  PrivacyExportDomain[]
	 *
	 * @since   3.9.0
	 */
	public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser
$user = null)
	{
		if (!$user && !$request->email)
		{
			return array();
		}

		$domains   = array();
		$domain    = $this->createDomain('user_contact',
'joomla_user_contact_data');
		$domains[] = $domain;

		$query = $this->db->getQuery(true)
			->select('*')
			->from($this->db->quoteName('#__contact_details'))
			->order($this->db->quoteName('ordering') . '
ASC');

		if ($user)
		{
			$query->where($this->db->quoteName('user_id') .
' = ' . (int) $user->id);
		}
		else
		{
			$query->where($this->db->quoteName('email_to') .
' = ' . $this->db->quote($request->email));
		}

		$items = $this->db->setQuery($query)->loadObjectList();

		foreach ($items as $item)
		{
			$domain->addItem($this->createItemFromArray((array) $item));
		}

		$domains[] =
$this->createCustomFieldsDomain('com_contact.contact',
$items);

		return $domains;
	}
}