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