Changeset 611 for trunk/services


Ignore:
Timestamp:
Aug 24, 2017 4:27:34 PM (7 years ago)
Author:
anonymous
Message:

Add additional clearings to logout service. Add logging to clear methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/logout.php

    r468 r611  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2525 */
    2626
    27 if (isset($auth) && method_exists($auth, 'get') && true === $app->getParam('enable_db')) {
    28     // Delete the current user's record locks.
    29     require_once 'codebase/lib/Lock.inc.php';
    30     $lock =& Lock::getInstance($auth);
    31     $lock->removeAll($auth->get('user_id'));
     27if (isset($prefs) && method_exists($prefs, 'clear')) {
     28    $prefs->clear();
    3229}
    33 
    34 // Logout.
    35 $auth->clear();
     30if (isset($tmp_prefs) && method_exists($tmp_prefs, 'clear')) {
     31    $tmp_prefs->clear();
     32}
     33if (isset($cache) && method_exists($cache, 'clear')) {
     34    $cache->clear();
     35}
     36if (isset($cart) && method_exists($cart, 'clear')) {
     37    $cart->clear();
     38}
     39if (isset($auth) && method_exists($auth, 'get')) {
     40    if (true === $app->getParam('enable_db')) {
     41        // Delete the current user's record locks.
     42        require_once 'codebase/lib/Lock.inc.php';
     43        $lock =& Lock::getInstance($auth);
     44        $lock->removeAll($auth->get('user_id'));
     45    }
     46}
     47if (isset($auth) && method_exists($auth, 'clear')) {
     48    $auth->clear();
     49}
    3650
    3751$app->raiseMsg(sprintf(_("Your session has been logged-out."), null), MSG_SUCCESS, __FILE__, __LINE__);
Note: See TracChangeset for help on using the changeset viewer.