Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Kohana] Problem ze zmianą hasła.
Pytajka
post
Post #1





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 6.09.2011

Ostrzeżenie: (0%)
-----


Otóż, mam problem ze zmianą hasła użytkownika. Otóż z pomocą przychodzi mi funkcja change_password, jednak wywołanie jej, kończy się o braku takowej metody w wybranym modelu. W sumie to nie ważne jaki model wywołuje, zawsze jest to samo. Według dokumentacji powinna się ona znajdować w Model_Auth_User.

  1. if( isset( $_POST['submit_password'])){
  2.  
  3. $this->validation = new Validation( $_POST);
  4.  
  5. $this->validation->rule('password_old', 'not_empty')
  6. ->rule('password', 'not_empty')
  7. ->rule('password_confirm', 'not_empty');
  8.  
  9. if( $this->validation->check() == TRUE){
  10.  
  11. if( $this->auth->check_password( $_POST['password_old']) == TRUE){
  12.  
  13. if( $_POST['password'] == $_POST['password_confirm']){
  14.  
  15. $this->model = Model_Auth_User::factory('user');
  16.  
  17. if( $this->model->change_password( $_POST, TRUE)){
  18.  
  19. $this->request->redirect('panel/edit');
  20.  
  21. $success = 'Dane zostały edytowane poprawnie.';
  22.  
  23. $this->template->bind_global('success2', $success);
  24.  
  25. }
  26.  
  27. }
  28.  
  29. }
  30. else{
  31.  
  32. echo $this->auth->hash_password( $_POST['password_old']).'/'.$this->auth->get_user()->password;
  33. }
  34.  
  35. }
  36. else{
  37.  
  38. $messages = $this->validation->errors('validation');
  39.  
  40. $this->template->bind_global('messages2', $messages);
  41. }
  42.  
  43. }


I błąd -

Cytat
ErrorException [ Fatal Error ]: Call to undefined method Model_User::change_password()
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 07:39