File manager - Edit - /home/ferretapmx/public_html/logout.tar
Back
logout.xml 0000644 00000001524 15231056557 0006612 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <extension type="plugin" group="system" method="upgrade"> <name>plg_system_logout</name> <author>Joomla! Project</author> <creationDate>2009-04</creationDate> <copyright>(C) 2009 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>PLG_SYSTEM_LOGOUT_XML_DESCRIPTION</description> <namespace path="src">Joomla\Plugin\System\Logout</namespace> <files> <folder plugin="logout">services</folder> <folder>src</folder> </files> <languages> <language tag="en-GB">language/en-GB/plg_system_logout.ini</language> <language tag="en-GB">language/en-GB/plg_system_logout.sys.ini</language> </languages> </extension> src/Extension/Logout.php 0000644 00000005734 15231056557 0011313 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage System.logout * * @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\System\Logout\Extension; use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Event\User\LogoutEvent; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Event\SubscriberInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Plugin class for logout redirect handling. * * @since 1.6 */ final class Logout extends CMSPlugin implements SubscriberInterface { /** * @param array $config An optional associative array of configuration settings. * @param CMSApplicationInterface $app The object to observe -- event dispatcher. * * @since 1.6 */ public function __construct(array $config, CMSApplicationInterface $app) { parent::__construct($config); $this->setApplication($app); // If we are on admin don't process. if (!$this->getApplication()->isClient('site')) { return; } $hash = ApplicationHelper::getHash('PlgSystemLogout'); if ($this->getApplication()->getInput()->cookie->getString($hash)) { // Destroy the cookie. $this->getApplication()->getInput()->cookie->set( $hash, '', [ 'expires' => 1, 'path' => $this->getApplication()->get('cookie_path', '/'), 'domain' => $this->getApplication()->get('cookie_domain', ''), ] ); } } /** * Returns an array of events this subscriber will listen to. * * @return array * * @since 5.3.0 */ public static function getSubscribedEvents(): array { return [ 'onUserLogout' => 'onUserLogout', ]; } /** * Method to handle any logout logic and report back to the subject. * * @param LogoutEvent $event The event instance. * * @return void * * @since 1.6 */ public function onUserLogout(LogoutEvent $event): void { if ($this->getApplication()->isClient('site')) { // Create the cookie. $this->getApplication()->getInput()->cookie->set( ApplicationHelper::getHash('PlgSystemLogout'), true, [ 'expires' => time() + 86400, 'path' => $this->getApplication()->get('cookie_path', '/'), 'domain' => $this->getApplication()->get('cookie_domain', ''), 'secure' => $this->getApplication()->isHttpsForced(), 'httponly' => true, ] ); } } } src/Extension/.htaccess 0000555 00000000355 15231056557 0011122 0 ustar 00 <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>