Initial groundwork to use phpdocumentor.
[squirrelmail.git] / plugins / administrator / auth.php
index 4026aaf666a87bd1f0d42631288262d988ebdc80..afbd8719e61ede224da6ad5c4d1dc7f7ec2d4890 100644 (file)
@@ -1,17 +1,28 @@
 <?php
 
-/*
+/**
  *  This function tell other modules what users have access
  *  to the plugin.
  *  
  *  Philippe Mingo
  *  
  *  $Id$
+ * @package plugins
+ * @subpackage administrator
  */
 
+/**
+*
+*/
 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')) {