public function loginAction() { //$this->_helper->viewRenderer('index'); $form = new Application_Form_Login(); if ($form->isValid($this->getRequest()->getPost())) { $adapter = new Zend_Auth_Adapter_DbTable( null, 'user', 'email', 'password', 'MD5(CONCAT(?, salt))' ); $adapter->setIdentity($form->getValue('email')); $adapter->setCredential($form->getValue('password')); $auth = Zend_Auth::getInstance(); $result = $auth->authenticate($adapter); if ($result->isValid()) { if (($form->getValue('rememberme'))==1) { Zend_Session::rememberMe(); } else { Zend_Session::forgetMe(); } return $this->_helper->redirector( 'myprofil', 'profil', 'default' ); } $form->password->addError('Błędna próba logowania!'); } $this->view->form = $form; }
chodzi o $adapter
Czy mogę z niego wyciągnąc id użytkownika ale nie w tej samej akcji? Czy jest ono zapisane na zasadzie sesji czy musze to sam zrobic podczas logowania??
W tej samej akcji to można zrobic tak print_r($adapter->getResultRowObject()); ale ja bym chciał miec możliwosc dostepu z innej akcji