-
Tutorials
- How to Send Emails in Joomla with PHP
- How to Connect to an External Database in Joomla with PHP
- How to Check If the Current User is Super User in Joomla with PHP
- How to Check if the Current Page Is the Homepage in Joomla with PHP
- How to Create a User Account in Joomla with PHP
- How to Create an Article in Joomla with PHP
- PHP Scripts Collection
- Troubleshooting
How to Check If the Current User is Super User in Joomla with PHP
Below you can find a PHP snippet that will allow you to detect whether a user is a Super User.
use Joomla\CMS\Factory;
$isSuperUser = Factory::getUser()->authorise('core.admin');
if ($isSuperUser)
{
echo "Hey Super User";
}
Last updated on Nov 28th 2024 09:11