public function action_change_password() { $this->set_view('crud/improved/form'); $form = new Form_User_ChangePassword($this->get_item()); if (isset($_POST['cancel'])) { $this->back($this->get_index_route()); } if (isset($_POST['submit']) and $form->submit()) { $this->back($this->get_index_route()); } $this->template->form = $form; }
protected function do_reset_password_step_2() { $code = $this->param('code'); if (!$code) { return TRUE; } $user = ORM::factory('User', array('reset_password_code' => $code)); if (!$user->loaded()) { return TRUE; } $form = new Form_User_ChangePassword($user); if (isset($_POST['submit']) and $form->submit()) { $user->reset_password_code = NULL; $user->save(); Auth::instance()->force_login($user); return TRUE; } $this->template->form = $form; }