本文整理汇总了PHP中BizSystem::SessionContext方法的典型用法代码示例。如果您正苦于以下问题:PHP BizSystem::SessionContext方法的具体用法?PHP BizSystem::SessionContext怎么用?PHP BizSystem::SessionContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BizSystem
的用法示例。
在下文中一共展示了BizSystem::SessionContext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resetPassword
/**
* Reset the password
*
* @return void
*/
public function resetPassword()
{
global $g_BizSystem;
$recArr = $this->readInputs();
$this->setActiveRecord($recArr);
if (count($recArr) == 0) {
return;
}
try {
$this->ValidateForm();
if ($this->ValidateEmail($recArr['username'], $recArr['email'])) {
//Init user profile for event logging
$profile = $g_BizSystem->InituserProfile($recArr['username']);
} else {
return;
}
//generate pass_token
$token = $this->GenerateToken($profile);
if ($token) {
//event log
$eventlog = BizSystem::getService(EVENTLOG_SERIVCE);
$logComment = array($username, $_SERVER['REMOTE_ADDR']);
$eventlog->log("USER_MANAGEMENT", "MSG_GET_PASSWORD_TOKEN", $logComment);
//send user email
$emailObj = BizSystem::getService(USER_EMAIL_SERIVCE);
$emailObj->UserResetPassword($token['Id']);
BizSystem::SessionContext()->destroy();
//goto URL
$this->processPostAction();
}
} catch (ValidationException $e) {
$this->processFormObjError($e->m_Errors);
return;
}
}
示例2: Logout
public function Logout()
{
// destroy all data associated with current session:
BizSystem::SessionContext()->destroy();
// Redirect:
if (isset($_GET['redirect_url'])) {
$url = $_GET['redirect_url'];
} else {
$url = "login";
}
header("Location: {$url}");
exit;
}
示例3: Logout
public function Logout()
{
global $g_BizSystem;
$eventlog = $g_BizSystem->GetService(EVENTLOG_SERIVCE);
$profile = $g_BizSystem->getUserProfile();
$logComment = array($profile["username"], $_SERVER['REMOTE_ADDR']);
$eventlog->log("LOGIN", "MSG_LOGOUT_SUCCESSFUL", $logComment);
// destroy all data associated with current session:
BizSystem::SessionContext()->destroy();
//clean cookies
setcookie("SYSTEM_SESSION_USERNAME", null, time() - 100, "/");
setcookie("SYSTEM_SESSION_PASSWORD", null, time() - 100, "/");
// Redirect:
header("Location: login");
}