コード例 #1
0
ファイル: User.php プロジェクト: ariol/adminshop
 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;
 }
コード例 #2
0
ファイル: Base.php プロジェクト: ariol/adminshop
 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;
 }