Joomla // Detect user's group

$user = JFactory::getUser(); $groups=$user->get('groups'); if (in_array("8", $groups)) { $typeUser="SUPER ADMIN"; } else { $typeUser="NOT SUPER ADMIN"; }
Detect if the current user is a Super User.
Useful to customize the back-end interface.
Custom the group ID to detect other groups to customize both front or back end depending the group of the current user.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.