本文整理汇总了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;
}