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