3
//////////////////////////////////////////////////////////////
4
//===========================================================
6
//===========================================================
7
// AEF : Advanced Electron Forum
9
// Inspired by Pulkit and taken over by Electron
10
// ----------------------------------------------------------
11
// Started by: Electron, Ronak Gupta, Pulkit Gupta
12
// Date: 23rd Jan 2006
14
// Site: http://www.anelectron.com/ (Anelectron)
15
// ----------------------------------------------------------
16
// Please Read the Terms of use at http://www.anelectron.com
17
// ----------------------------------------------------------
18
//===========================================================
19
// (C)AEF Group All Rights Reserved.
20
//===========================================================
21
//////////////////////////////////////////////////////////////
24
if (!defined('AEF')) {
26
die('Hacking Attempt');
29
/////////////////////////
31
// 1 - Delete the Cookies
32
// 2 - Delete the Session
33
// 3 - Refresh it as a
35
/////////////////////////
40
global $user, $conn, $dbtables, $logged_in, $globals, $l, $AEF_SESS;
42
//Load the Language File
43
if (!load_lang('logout')) {
48
//Are you even logged in
49
if (empty($logged_in)) {
51
//Show a major error and return
52
reporterror($l['not_logged_in_title'], $l['not_logged_in']);
57
///////////////////////
59
///////////////////////
60
//Set a COOKIE for a YEAR of User ID
61
setcookie($globals['cookie_name'] . '[loguid]', "", (time() - (60 * 60 * 24 * 365)), '/');
63
//Set a COOKIE for a YEAR of CookPass
64
setcookie($globals['cookie_name'] . '[logpass]', "", (time() - (60 * 60 * 24 * 365)), '/');
67
//Lets DELETE the USERS Session
68
$qresult = makequery("DELETE FROM " . $dbtables['sessions'] . "
69
WHERE uid = '" . AS_UID . "'
70
AND sid = '" . AS_ID . "'");
72
if (mysql_affected_rows($conn) < 1) {
74
//Show a major error and return
75
reporterror($l['delete_session_error_title'], $l['delete_session_error']);
81
$data = process_as_data();
83
//Add the new SESSION ROW
84
$qresult = makequery("INSERT INTO " . $dbtables['sessions'] . "
85
SET sid = '" . AS_ID . "',
87
time = '" . time() . "',
89
ip = '" . ($_SERVER['REMOTE_ADDR']) . "'");
91
if (mysql_affected_rows($conn) < 1) {
93
//Show a major error and return
94
reporterror($l['guest_session_error_title'], $l['guest_session_error']);