Source for file remember2.php

Documentation is available at remember2.php

  1. <?php
  2. /**
  3. @version        $Id: remember.php 8503 2007-08-22 07:39:40Z jinx $
  4. @package        Joomla
  5. @copyright    Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
  6. @license        GNU/GPL, see LICENSE.php
  7. *  Joomla! is free software. This version may have been modified pursuant
  8. *  to the GNU General Public License, and as distributed it includes or
  9. *  is derivative of works licensed under the GNU General Public License or
  10. *  other free or open source software licenses.
  11. *  See COPYRIGHT.php for copyright notices and details.
  12. */
  13.  
  14. // no direct access
  15. defined'_JEXEC' or die'Restricted access' );
  16.  
  17. /**
  18.  * Joomla! System Remember Me Plugin
  19.  *
  20.  * @author        Louis Landry <louis.landry@joomla.org>
  21.  * @package        Joomla
  22.  * @subpackage    System
  23.  */
  24. class plgSystemRemember2 extends JPlugin
  25. {
  26.     /**
  27.      * Constructor
  28.      *
  29.      * For php4 compatability we must not use the __constructor as a constructor for plugins
  30.      * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
  31.      * This causes problems with cross-referencing necessary for the observer design pattern.
  32.      *
  33.      * @access    protected
  34.      * @param    object    $subject The object to observe
  35.      * @param     array   $config  An array that holds the plugin configuration
  36.      * @since    1.0
  37.      */
  38.     function plgSystemRemember2($subject$config{
  39.         parent::__construct($subject$config);
  40.     }
  41.  
  42.     function onAfterInitialise()
  43.     {
  44.         global $mainframe;
  45.  
  46.         // No remember me for admin
  47.         if ($mainframe->isAdmin()) {
  48.             return;
  49.         }
  50.  
  51.         $user &JFactory::getUser();
  52.         if (!$user->get('gid'))
  53.         {
  54.             jimport('joomla.utilities.utility');
  55.             $hash JUtility::getHash('JLOGIN_REMEMBER');
  56.  
  57.             if ($str JRequest::getString($hash'''cookie'JREQUEST_ALLOWRAW JREQUEST_NOTRIM))
  58.             {
  59.                 jimport('joomla.utilities.simplecrypt');
  60.                 $crypt    new JSimpleCrypt();
  61.                 $str    $crypt->decrypt($str);
  62.                 $mainframe->login(unserialize($str));
  63.             }
  64.         }
  65.     }
  66. }

Documentation generated on Sun, 06 Apr 2008 07:14:59 +0200 by phpDocumentor 1.4.0a2