I am new to Zend
I searched it and got the following link, how to keep track of currently logged user in zend framework.
But my requirement is different.
My situation is, I am having seperate controller called AuthenticationController to store the logged user details in session using Zend_Auth and doing other stuff,Now i have to get the logged user info, when every time logged in user access every page of the site.
so i have to do some logic in common file that fires every time to get user info in zend.
How can i do that in zend ?
Following is sample piece of code ..
if ($form->isValid($request->getPost())) {
if ($this->_process($form->getValues())) {
$authentication = Zend_Auth::getInstance();
if ($authentication ->getIdentity()->myfirstlogin == 0) {
$this->_helper->redirector('index', 'test1');
} else {
$this->_helper->redirector('index', 'test2');
}
} else {
$myUserStatus = new Zend_Session_Namespace('myuserStatus');
if ($myUserStatus ->status == 2) {
$this->_helper->FlashMessenger('Incorrect Username / Password');
} else if ($myUserStatus ->delete == 1) {
$this->_helper->FlashMessenger('Your **** approval.');
} else {
$this->_helper->FlashMessenger('Please ****** administrator');
}
unset($myUserStatus);
$this->_helper->redirector('index', 'auth');
}
}
.......