Project

General

Profile

1 1473 Luisehahne
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6 1719 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 1473 Luisehahne
 * @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$
13
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15
 *
16
 */
17
18
require("../config.php");
19
20
if(isset($_COOKIE['REMEMBER_KEY'])) {
21
	setcookie('REMEMBER_KEY', '', time()-3600, '/');
22
}
23
24 1719 Luisehahne
$redirect = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '' && basename($_SESSION['HTTP_REFERER']) != 'logout.php') ?  $_SESSION['HTTP_REFERER'] : WB_URL.'/index.php');
25 1473 Luisehahne
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 1529 Luisehahne
34 1473 Luisehahne
session_unset();
35
unset($_COOKIE[session_name()]);
36
session_destroy();
37
38
if(INTRO_PAGE) {
39 1719 Luisehahne
	header('Location: '.WB_URL.'/index.php');
40 1473 Luisehahne
} else {
41
	header('Location: '.$redirect);
42
}