Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Problem z Zend Auth
Damiankossek
post
Post #1





Grupa: Zarejestrowani
Postów: 118
Pomógł: 8
Dołączył: 10.12.2009

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


Witam,
Mam problem z Zend_Auth, logowanie przebiega z sukcesem lecz nie zapisuję mi sesji.
Kod logowania:
  1. public function loginAction()
  2. {
  3. print_r($this->ZendAuth->getIdentity());
  4.  
  5. if($this -> getRequest() -> isPost())
  6. {
  7. $auth = new Zend_Auth_Adapter_DbTable($db);
  8.  
  9. $auth -> setTableName('users')
  10. -> setIdentityColumn('name')
  11. -> setCredentialColumn('password');
  12.  
  13. $auth -> setIdentity($this -> getRequest() -> getPost('name'))
  14. -> setCredential($this -> getRequest() ->getPost('password'));
  15.  
  16. $result = $auth -> authenticate($auth);
  17.  
  18. if($result -> getCode() == Zend_Auth_Result::SUCCESS)
  19. {
  20. $this -> view -> status = "Logowanie się powiodło";
  21.  
  22. }
  23. else
  24. {
  25. $this -> view -> status = 'Logowanie się nie powiodło';
  26. }
  27. }
  28.  
  29. $this -> view -> content = self::buildForm();
  30. }


W zmiennej status w widoku ladnie sie pojawia ze logowanie sie powiodlo wrazie podania prawidlowych danych lecz gdy odswieze strone drugi raz to powinno zadzialac print_r($this->ZendAuth->getIdentity()); lecz niestety nic nie wyswietla ... Nawet hasIdentity zwraca za kazdym razem FALSE. Co moze byc nie tak ?

Ten post edytował Damiankossek 5.03.2011, 12:16:26
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: 21.12.2025 - 02:28