I'm now sitting here a little bit longer and i want to know the best solution to update the Identity from the Zend_Auth.
public function _initLoadSessionData() {
if (Zend_Auth::getInstance()->hasIdentity()) {
$userTbl = new Application_Model_User();
$userData = $userTbl->getUserData(Zend_Auth::getInstance()->getIdentity()->ID);
$zendAuth = Zend_Auth::getInstance()->getIdentity();
foreach ($userData as $key => $value) {
$zendAuth->$key = $value;
}
}
}
This is the first try i did and it works very well. I put this function into the Bootstrap but I'm sure that this solution is very bad (e.g. performance) because it updates every time. The problem is, that i want to update the Zend_Acl Roles and it needs to be updated instantly. Thanks for your help guys! :)