本文整理匯總了PHP中Operator::clearTableForLogout方法的典型用法代碼示例。如果您正苦於以下問題:PHP Operator::clearTableForLogout方法的具體用法?PHP Operator::clearTableForLogout怎麽用?PHP Operator::clearTableForLogout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Operator
的用法示例。
在下文中一共展示了Operator::clearTableForLogout方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
public function execute()
{
global $gvPath;
$code = $_POST['code'];
$password = $_POST['password'];
session_destroy();
unset($_SESSION);
session_start();
if ($this->isValidSysAdminLogin($code, $password)) {
global $gvEditableConfs;
$_SESSION['userLevel'] = Page::SYSADMIN_USER;
if ($code == $gvEditableConfs[0]->getDefault() && $password == $gvEditableConfs[1]->getDefault()) {
// Access with default credentials. Redirect to settings.
$redirect = new RedirectOutput($gvPath . "/application/adminSettings");
} else {
$redirect = new RedirectOutput($gvPath . "/application/adminPage");
}
return $redirect;
}
if (Operator::isValidLogin($code, $password)) {
Operator::clearTableForLogout($code);
try {
Session::loginOperator($code);
} catch (UnknownDeskException $e) {
global $gvPath;
$errorPage = new ErrorPageOutput("Sportello non riconosciuto", "Il presente computer non è stato registrato come sportello.<br />" . "Indirizzo IP da registrare: " . $_SERVER['REMOTE_ADDR'], "<a href=\"{$gvPath}/application/loginPage\">Torna indietro</a>");
return $errorPage;
}
$redirect = new RedirectOutput($gvPath . "/application/opPage");
return $redirect;
}
// Login failed
$this->errorMessage = "Codice o password non validi!";
return true;
}
示例2: logoutOperator
public static function logoutOperator()
{
$_SESSION['userLevel'] = Page::NORMAL_USER;
Operator::clearTableForLogout($_SESSION['op_code']);
unset($_SESSION['op_code']);
unset($_SESSION['desk_number']);
unset($_SESSION['td_served']);
}
示例3: isOpen
public function isOpen()
{
global $gvSessionTimeout;
if (!$this->desk_last_activity_time || !$this->desk_op_code) {
// Closed
return false;
}
$last = $this->desk_last_activity_time;
if (time() - $last >= $gvSessionTimeout) {
// Session timed out, update tables
Operator::clearTableForLogout($this->desk_op_code, $this, null);
return false;
}
return true;
}