joomla/joomla-platform — pull request #1717 by elinw (2012-11-25 18:04:14+00:00)
Title: Allow change of user properties when JUser exists

One ongoing issue with the advent of flexible user groups has been that if a JUser object has already been created for a logged in user and the user group assignments are changed elsewhere (either by code such as when a payment is made or manually by another user who has the rights to do so) the JUser is not updated since JUser already exists. The same is also true of user parameters such as time zone. Currently the only solution is to have the user logout which is both awkward and loses potentially useful data.

This pull requests adds a check in JFactory to compare the user groups, authorised view levels, and user parameters that are stored against those in JUser. If they are different the stored values are then used.

As a consequence of implementing this I also wrote a number of tests, added a method and modified a number of other tests.