Zend_Registry and authentication improvement
In tutorials 5 and 6 i made an assumption that if zend_auth object is null then user is a guest, i.e. not logged in. This is fine for small applications. It also raises PHP notice message. For those who do not want any messages or need more refined controlled over guest permissions there is a need to have a proper role created for guest. So we take advantage of Zend_Registry and create a global variable for role that takes Zend_Auth’s role variable if user is logged in or default variable value ‘guest’ if otherwise.
Read more...