本文整理汇总了PHP中Token::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Token::remove方法的具体用法?PHP Token::remove怎么用?PHP Token::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token::remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_valid
function is_valid($token)
{
$query = "SELECT user_id, expiration FROM user_token WHERE token = ?";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($token));
$token_info = $statement->fetch(PDO::FETCH_ASSOC);
// No db entry for token
if (!$token_info) {
return null;
}
// Token is expired
if (Token::time_expired($token_info['expiration'])) {
Token::remove_expired();
return null;
}
// Token is valid
Token::remove($token);
return $token_info['user_id'];
}
示例2: array
$vars = array('to' => $usr[0]->email, 'to_name' => $usr[0]->userid, 'message' => $msg, 'subject' => 'Password Reset at ' . Site::$name, 'msgtype' => 'text');
//echo "<pre>".$msg."</pre>";
if (Mail::send($vars)) {
$alertgreen = PASSWORD_SENT_NOTIF;
}
} else {
if ($usr[0]->activation != '') {
$alertred[] = ACOUNT_NOT_ACTIVE;
} else {
$alertred[] = ACOUNT_NOT_ACTIVE_BLOCK;
}
}
} elseif ($c == "0") {
$alertred[] = NO_USER;
}
Token::remove($_POST['token']);
} else {
$alertred[] = TOKEN_NOT_EXIST;
}
}
Theme::theme('header');
if (isset($alertred)) {
echo "\n\t\t<div class=\"alert alert-danger\">\n\t\t\t";
foreach ($alertred as $alert) {
echo $alert;
}
echo "\n\t\t</div>";
}
if (isset($alertgreen)) {
echo "\n\t\t<div class=\"alert alert-success\">\n\t\t\t{$alertgreen}\n\t\t</div>";
}
示例3:
}
if (isset($_POST['token'])) {
Token::remove($_POST['token']);
}
break;
default:
# code...
break;
}
if (isset($_GET['act']) == 'del') {
if (!isset($_GET['token']) || !Token::isExist($_GET['token'])) {
// VALIDATE ALL
$alertred[] = TOKEN_NOT_EXIST;
}
if (isset($alertred)) {
$data['alertred'] = $alertred;
} else {
Categories::delete($_GET['id']);
$data['alertgreen'][] = MSG_CATEGORY_REMOVED;
}
if (isset($_GET['token'])) {
Token::remove($_GET['token']);
}
}
$data['cat'] = Db::result("SELECT * FROM `cat` WHERE `type` = 'post' ORDER BY `id` DESC");
$data['num'] = Db::$num_rows;
Theme::admin('header', $data);
System::inc('categories', $data);
Theme::admin('footer');
/* End of file categories.control.php */
/* Location: ./inc/lib/Control/Backend/categories.control.php */