-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogout.php
42 lines (37 loc) · 913 Bytes
/
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
<?php
/*
* OPMS
* logout.php
* Created on 2006/10/22 by Chen YuRen ([email protected])
*
* 登出
*
* $LastChangedDate: 2007-01-21T12:44:58.332782Z $
* $LastChangedRevision: 7011 $
* $LastChangedBy: yrchen $
* $HeadURL: /local/opms/trunk/logout.php $
*/
// yrchen.061015: Set flag that this is a parent file.
define( '_OPMSEXEC', 1 );
require_once('init.php');
$old_user = $_SESSION['valid_user'];
if (!empty($old_user))
{
try
{
unset($_SESSION['valid_user']);
$result_dest = session_destroy();
header("Location: " . $config['site_url'] . "index.php");
}
catch (Exception $e)
{
// yrchen.061022: 已經登入,但無法登出
header("Location: " . $config['site_url'] . "error.php");
}
}
else
{
// yrchen.061022: 尚未登入,但是不知道為啥跑來這
header("Location: " . $config['site_url'] . "login.php");
}
?>