Joomla check if admin logged-in
<?php define( ‘_JEXEC’, 1 ); define( ‘JPATH_BASE’, realpath(dirname(__FILE__).’/../../..’ )); define( ‘DS’, DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.’includes’.DS.’defines.php’ ); require_once ( JPATH_BASE .DS.’includes’.DS.’framework.php’ ); $mainframe =& JFactory::getApplication(’administrator’); $mainframe->initialise(); $app =& JFactory::getApplication(); $user =& JFactory::getUser(); if($app->isAdmin() && !$user->id) { header(’Location: /administrator’); exit(); } ?>