Check If Super Admin

596 Views

While developing my subscription software for Joomla, I found it very difficult to find a solution for determining the super admin. It turns out it was actually a simple solution and this tutorial will show you how to do that.

$user = JFactory::getUser();//first get the logged in user

if($user->get('usertype') =='Super Administrator')://Now check their user type

   // This user is super admin

else:

  // Not super so kick them out!

endif;

That’s it. Now you should be able to get your user admin level. Consider leaving a comment.

Please Post Your Comments & Reviews

Welcome to Western Studios

We provide professional website and mobile softwares including Joomla, Wordpress and more.