- md5
- 999087679d5d20523acb0aa3af50d6e5
- sha1
- ba8d7a3e78b04c1b35a88972c57153a70939961c
- sha256
- e1736a10466bcc7c706ca4e1ce115269ca16b2ec89f6d35ed63a2683385fb4e4
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
<?php
/**
* @version $Id: remember.php 20215 2011-01-09 21:50:53Z chdemko $
* @package Joomla
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
jimport('joomla.plugin.plugin');
/**
* Joomla! System Remember Me Plugin
*
* @package Joomla
* @subpackage System
*/
class plgSystemRemember extends JPlugin
{
function onAfterInitialise()
{
$app = JFactory::getApplication();
// No remember me for admin
if ($app->isAdmin()) {
return;
}
$user = JFactory::getUser();
if ($user->get('guest'))
{
jimport('joomla.utilities.utility');
$hash = JUtility::getHash('JLOGIN_REMEMBER');
if ($str = JRequest::getString($hash, '', 'cookie', JREQUEST_ALLOWRAW | JREQUEST_NOTRIM))
{
jimport('joomla.utilities.simplecrypt');
//Create the encryption key, apply extra hardening using the user agent string
$key = JUtility::getHash(@$_SERVER['HTTP_USER_AGENT']);
$crypt = new JSimpleCrypt($key);
$str = $crypt->decrypt($str);
$options = array();
$options['silent'] = true;
if (!$app->login(@unserialize($str), $options)) {
$config = JFactory::getConfig();
$cookie_domain = $config->get('cookie_domain', '');
$cookie_path = $config->get('cookie_path', '/');
// Clear the remember me cookie
setcookie(JUtility::getHash('JLOGIN_REMEMBER'), false, time() - 86400, $cookie_path, $cookie_domain);
}
}
}
}
}
The same content is in 2 releases, Joomla 1.6.0 to 1.6.1. See them all, or every version of this file.