root/releases/0.9/login/logout.php

Revision 973, 0.8 kB (checked in by sven, 2 years ago)

kill another unnecessary query

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 require_once(dirname(dirname(__FILE__))."/includes.php");
4
5 $user->code = '';
6 $user->ident = $USER->ident;
7 if ($USER->ident) { //for some reason this can run with user id 0...?
8     update_record('users',$user);
9 }
10
11 unset($USER);
12 unset($SESSION);
13 unset($_SESSION['USER']);
14 unset($_SESSION['SESSION']);
15 unset($_SESSION['userid']);
16 unset($_SESSION['username']);
17 unset($_SESSION['name']);
18 unset($_SESSION['email']);
19 unset($_SESSION['icon']);
20 unset($_SESSION['icon_quota']);
21
22 if (isset($_COOKIE[session_name()])) {
23     setcookie(session_name(), '', time()-84600, $CFG->cookiepath);
24 }
25
26 // Remove the any AUTH_COOKIE persistent logins
27 setcookie(AUTH_COOKIE, '', time()-84600, $CFG->cookiepath);
28
29 session_destroy();
30
31 // Set headers to forward to main URL
32 header("Location: " . $CFG->wwwroot . "\n");
33
34     
35 ?>
Note: See TracBrowser for help on using the browser.