本文整理汇总了PHP中Sentry::reset_password_confirm方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentry::reset_password_confirm方法的具体用法?PHP Sentry::reset_password_confirm怎么用?PHP Sentry::reset_password_confirm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentry
的用法示例。
在下文中一共展示了Sentry::reset_password_confirm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_confirmation
public function get_confirmation($email = null, $hash = null)
{
try {
$confirmation = Sentry::reset_password_confirm($email, $hash);
if ($confirmation) {
return Redirect::to(URL::to_route('session.login'))->with('status_success', __('application.resset_ok'));
} else {
return View::make('session/reset_confirmation_invalid')->with('title', HtmlHelpers::name('reset_invalid_header'));
}
} catch (Sentry\SentryException $e) {
return View::make('session/reset_confirmation_invalid')->with('title', HtmlHelpers::name('reset_invalid_header'));
}
}
示例2: 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);
}
}
}
示例3: get_confirmation
public function get_confirmation($email = null, $hash = null)
{
try {
$confirmation = Sentry::reset_password_confirm($email, $hash);
if ($confirmation) {
return Redirect::to('user/login');
} else {
echo 'Unable to reset password';
}
} catch (Sentry\SentryException $e) {
echo $e->getMessage();
}
}