本文整理匯總了PHP中Sentry::reset_password_save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sentry::reset_password_save方法的具體用法?PHP Sentry::reset_password_save怎麽用?PHP Sentry::reset_password_save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sentry
的用法示例。
在下文中一共展示了Sentry::reset_password_save方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: action_reset_password
/**
* Change user password
*
* @param unknown_type $email
* @param unknown_type $hash
*/
public function action_reset_password($email = false, $hash = false)
{
if ($email && $hash) {
//Keep existing messages
\Messages::instance()->shutdown();
try {
if (\Sentry::reset_password_confirm($email, $hash)) {
if (\Input::post('new_password') && \Input::post('confirm_new_password')) {
if (\Sentry::reset_password_save($email, \Input::post('new_password'))) {
\Messages::success('Password successfully changed. Please login and start using your account.');
\Response::redirect(\Uri::front_create('user/login'));
} else {
\Messages::error('Password was not save.');
\Theme::instance()->set_partial('content', $this->view_dir . 'reset_password');
}
} else {
\Theme::instance()->set_partial('content', $this->view_dir . 'reset_password');
}
} else {
\Messages::error('Wrong reset code. Please check your email and try again.');
\Response::redirect(\Uri::front_create('user/login'));
}
} catch (\Sentry\SentryException $e) {
// show validation errors
//\Messages::error('<h4>There was an error while trying activate user</h4>');
$errors = $e->getMessage();
\Messages::error($errors);
}
}
}