PHP系统含提取码,logout.php

session_start(); // Initialize session data

ob_start(); // Turn on output buffering

?>

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified

header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1

header("Cache-Control: post-check=0, pre-check=0", false);

header("Pragma: no-cache"); // HTTP/1.0

?>

// Define page object

$logout = new clogout();

$Page =& $logout;

// Page init processing

$logout->Page_Init();

// Page main processing

$logout->Page_Main();

?>

//

// Page Class

//

class clogout {

// Page ID

var $PageID = 'logout';

// Page Object Name

var $PageObjName = 'logout';

// Page Name

function PageName() {

return ew_CurrentPage();

}

// Page Url

function PageUrl() {

$PageUrl = ew_CurrentPage() . "?";

return $PageUrl;

}

// Message

function getMessage() {

return @$_SESSION[EW_SESSION_MESSAGE];

}

function setMessage($v) {

if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append

$_SESSION[EW_SESSION_MESSAGE] .= "
" . $v;

} else {

$_SESSION[EW_SESSION_MESSAGE] = $v;

}

}

// Show Message

function ShowMessage() {

if ($this->getMessage() <> "") { // Message in Session, display

echo "

" . $this->getMessage() . "

";

$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session

}

}

// Validate Page request

function IsPageRequest() {

return TRUE;

}

//

// Class initialize

// - init objects

// - open connection

//

function clogout() {

global $conn;

// Intialize page id (for backward compatibility)

if (!defined("EW_PAGE_ID"))

define("EW_PAGE_ID", 'logout', TRUE);

// Open connection to the database

$conn = ew_Connect();

}

//

// Page_Init

//

function Page_Init() {

global $gsExport, $gsExportFile, $wh_list;

global $Security;

$Security = new cAdvancedSecurity();

// Global page loading event (in userfn6.php)

Page_Loading();

// Page load event, used in current page

$this->Page_Load();

}

//

// Page_Terminate

// - called when exit page

// - if URL specified, redirect to the URL

//

function Page_Terminate($url = "") {

global $conn;

// Page unload event, used in current page

$this->Page_Unload();

// Global page unloaded event (in userfn*.php)

Page_Unloaded();

// Close Connection

$conn->Close();

// Go to URL if specified

if ($url <> "") {

ob_end_clean();

header("Location: $url");

}

exit();

}

//

// Page main processing

//

function Page_Main() {

global $Security;

$bValidate = TRUE;

$sUsername = $Security->CurrentUserName();

// Call User LoggingOut event

$bValidate = $this->User_LoggingOut($sUsername);

if (!$bValidate) {

$sLastUrl = $Security->LastUrl();

if ($sLastUrl == "")

$sLastUrl = "index.php";

$this->Page_Terminate($sLastUrl); // Go to last accessed url

} else {

if (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "") // Not autologin

setCookie(EW_PROJECT_NAME . '[UserName]', ""); // clear user name cookie

setCookie(EW_PROJECT_NAME . '[Password]', ""); // clear password cookie

setCookie(EW_PROJECT_NAME . '[LastUrl]', ""); // clear last url

// Call User LoggedOut event

$this->User_LoggedOut($sUsername);

// Unset all of the session variables

$_SESSION = array();

// Delete the session cookie and kill the session

if (isset($_COOKIE[session_name()]))

setcookie(session_name(), '', time()-42000, '/');

// Finally, destroy the session

@session_destroy();

$this->Page_Terminate("login.php"); // Go to login page

}

}

// Page Load event

function Page_Load() {

//echo "Page Load";

}

// Page Unload event

function Page_Unload() {

//echo "Page Unload";

}

// User Logging Out event

function User_LoggingOut($usr) {

// Enter your code here

// To cancel, set return value to FALSE;

return TRUE;

}

// User Logged Out event

function User_LoggedOut($usr) {

//echo "User Logged Out";

}

}

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值