1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category frontend
|
5
|
* @package account
|
6
|
* @author Ryan Djurovich, WebsiteBaker Project
|
7
|
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.x
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: logout.php 1719 2012-08-29 14:59:35Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/logout.php $
|
14
|
* @lastmodified $Date: 2012-08-29 16:59:35 +0200 (Wed, 29 Aug 2012) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
require("../config.php");
|
19
|
|
20
|
if(isset($_COOKIE['REMEMBER_KEY'])) {
|
21
|
setcookie('REMEMBER_KEY', '', time()-3600, '/');
|
22
|
}
|
23
|
|
24
|
$redirect = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '' && basename($_SESSION['HTTP_REFERER']) != 'logout.php') ? $_SESSION['HTTP_REFERER'] : WB_URL.'/index.php');
|
25
|
|
26
|
$_SESSION['USER_ID'] = null;
|
27
|
$_SESSION['GROUP_ID'] = null;
|
28
|
$_SESSION['GROUPS_ID'] = null;
|
29
|
$_SESSION['USERNAME'] = null;
|
30
|
$_SESSION['PAGE_PERMISSIONS'] = null;
|
31
|
$_SESSION['SYSTEM_PERMISSIONS'] = null;
|
32
|
$_SESSION = array();
|
33
|
|
34
|
session_unset();
|
35
|
unset($_COOKIE[session_name()]);
|
36
|
session_destroy();
|
37
|
|
38
|
if(INTRO_PAGE) {
|
39
|
header('Location: '.WB_URL.'/index.php');
|
40
|
} else {
|
41
|
header('Location: '.$redirect);
|
42
|
}
|
43
|
|