/** * 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); } } }