source: trunk/services/logout.php

Last change on this file was 673, checked in by anonymous, 5 years ago

Minor css changes

File size: 1.9 KB
Line 
1<?php
2/**
3 * The Strangecode Codebase - a general application development framework for PHP
4 * For details visit the project site: <http://trac.strangecode.com/codebase/>
5 * Copyright 2001-2012 Strangecode, LLC
6 *
7 * This file is part of The Strangecode Codebase.
8 *
9 * The Strangecode Codebase is free software: you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * The Strangecode Codebase is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License along with
20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23/**
24 * logout.php
25 */
26
27if (isset($prefs) && method_exists($prefs, 'clear')) {
28    $prefs->clear();
29}
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}
50
51if (!getFormData('nomsg')) {
52    $app->raiseMsg(sprintf(_("Your session has been logged out."), null), MSG_SUCCESS, __FILE__, __LINE__);
53}
54if (getFormData('next')) {
55    $app->dieURL(getFormData('next'));
56} else {
57    $app->dieURL($app->getParam('redirect_home_url'));
58}
59
Note: See TracBrowser for help on using the repository browser.