*/
function adm_check_user() {
- GLOBAL $username, $PHP_SELF;
+ global $PHP_SELF;
+ require_once(SM_PATH . 'functions/global.php');
+
+ if ( !sqgetGlobalVar('username',$username,SQ_SESSION) ) {
+ $username = '';
+ }
+ /* This needs to be first, for all non_options pages */
if (strpos('options.php', $PHP_SELF)) {
$auth = FALSE;
} else if (file_exists(SM_PATH . 'plugins/administrator/admins')) {