-
Notifications
You must be signed in to change notification settings - Fork 9
/
logout.php
55 lines (46 loc) · 1 KB
/
logout.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* logout.php
*
* Signs the user out, deletes cookies and sessions.
* @author Nijiko Yonskai <me@nijikokun.com>
* @version 1.3RC2
* @lyric Why can't our bodies reset themselves? Won't you please reset me.
* @copyright (c) 2010 ANIGAIKU
* @package ninko
*/
/**
* Require common.php
*/
require("include/common.php");
// gets cookie if there is one
$login_cookie = @$_COOKIE["login"];
// if cookie is found, reset cookie and destroy session
if(isset($login_cookie))
{
// logging out
load_hook('logout');
setcookie ("login", "", time()-60000*24*30);
@session_start();
session_destroy();
/**
* include header template
*/
include($config['template_path'] . "header.php");
print_out(lang('success_logout'), lang('redirecting'));
}
else
{
// logging out
load_hook('logout');
@session_start();
session_destroy();
/**
* include header template
*/
include($config['template_path'] . "header.php");
print_out(lang('success_logout'), lang('redirecting'));
}
?>
</body>
</html>