joomla/joomla-platform — pull request #740 by krileon (2012-01-12 18:23:07+00:00)
Title: Update libraries/joomla/user/user.php

Current implement caches based off object variable being empty or not. This however does not function if you build the user object before a user logs in as it then populates the variable with guest accesslevels and usergroups. Once login is triggered if the object is persisted then it persists with those guest accesslevels and usergroups and prevents menu items for example displayed only to registered users from displaying.

Proposed implemented keeps caching intact, but rather then caching if variable is populated or not it caches based off the object id. This prevents duplicate calls to JAccess::getAuthorisedViewLevels per page load, but maintains accuracy of user accesslevels and usergroups when transitioning from guest to logged in.