Пример #1
0
 public function changePasswordComplete($url_hash_email, $email)
 {
     $newPassword = Input::get('newInput');
     $encrypt_id = RegistrationController::encryptPassword($email);
     $encrypt_id = str_replace('/', '', $encrypt_id);
     if ($encrypt_id == $url_hash_email) {
         $resultSet = $this->GlobalModel->getModelRowListByColumnName('tbl_users', 'id', $email, null);
         $_userEmail = null;
         $input_fname = null;
         $input_lname = null;
         foreach ($resultSet as $var) {
             $_userEmail = $var->user_email;
             $input_fname = $var->user_fname;
             $input_lname = $var->user_lname;
         }
         /** peform password encryption*/
         $hash_password = RegistrationController::encryptPassword($newPassword);
         $updateArr = array('user_password' => $hash_password, 'user_changepass' => 'changed');
         $whereArr = array('id' => $email);
         $data = $this->GlobalModel->updateModel('tbl_users', $whereArr, $updateArr);
         //bokbok
         $theme = Theme::uses('homepage')->layout('default');
         return $theme->of('home.PasswordChangeSuccess')->render();
     }
 }