本文整理匯總了PHP中ca_users::isValidToken方法的典型用法代碼示例。如果您正苦於以下問題:PHP ca_users::isValidToken方法的具體用法?PHP ca_users::isValidToken怎麽用?PHP ca_users::isValidToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ca_users
的用法示例。
在下文中一共展示了ca_users::isValidToken方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DoReset
public function DoReset()
{
if (!AuthenticationManager::supports(__CA_AUTH_ADAPTER_FEATURE_RESET_PASSWORDS__)) {
$this->Login();
return;
}
$vs_token = $this->getRequest()->getParameter('token', pString);
$vs_username = $this->getRequest()->getParameter('username', pString);
$t_user = new ca_users();
$vs_pw = $this->getRequest()->getParameter('password', pString);
$vs_pw_check = $this->getRequest()->getParameter('password2', pString);
if ($t_user->load($vs_username)) {
if ($t_user->isValidToken($vs_token)) {
// no password match
if ($vs_pw !== $vs_pw_check) {
$this->notification->addNotification(_t("Passwords did not match. Please try again."), __NOTIFICATION_TYPE_ERROR__);
$this->view->setVar('notifications', $this->notification->getNotifications());
$this->view->setVar('renderForm', true);
$this->view->setVar('token', $vs_token);
$this->view->setVar('username', $vs_username);
$this->render('password_reset_form_html.php');
} else {
$t_user->set('password', $vs_pw);
$t_user->setMode(ACCESS_WRITE);
$t_user->update();
$this->notification->addNotification(_t("Password was successfully changed. You can now log in with your new password."), __NOTIFICATION_TYPE_INFO__);
$this->view->setVar('notifications', $this->notification->getNotifications());
$this->Login();
}
}
}
}