Ejemplo n.º 1
0
 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'));
     }
 }
Ejemplo n.º 2
0
 /**
  * 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);
         }
     }
 }
Ejemplo n.º 3
0
 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();
     }
 }