Webeks.net - freelance programming
freelance programming - php, Joomla, Zend ...
Home :: Articles :: Programming :: Joomla! :: How to get user aid in Joomla 1.6

How to get user aid in Joomla 1.6

Written by Miha

In Joomla 1.5 we got users aid or user access identifier by calling get() method on user object.

$user =& JFactory::getUser();

$aid = $user->get('aid', 0);

In Joomla 1.6 advance ACL was introduced instead of get('aid') we can use getAuthorisedViewLevels() method that returns the array with user access view levels. Then we can use PHP native max() method to get the highest access identifier.

$user =& JFactory::getUser();

$aid = max ($user->getAuthorisedViewLevels());

 


blog comments powered by Disqus