make use of PAGE_NAME constant in plugin, prefix it with the plugin name.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jul 2007 17:44:29 +0000 (17:44 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jul 2007 17:44:29 +0000 (17:44 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12533 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/administrator/auth.php
plugins/administrator/options.php

index f82f3ed..85d049c 100644 (file)
@@ -20,7 +20,7 @@
  * @return boolean
  */
 function adm_check_user() {
-    global $PHP_SELF, $plugins;
+    global $plugins;
 
     /* fail if the plugin is not enabled */
     if ( !in_array('administrator', $plugins) ) {
@@ -32,7 +32,7 @@ function adm_check_user() {
     }
 
     /* This needs to be first, for all non_options pages */
-    if (strpos('options.php', $PHP_SELF)) {
+    if (defined('PAGE_NAME') && PAGE_NAME='administrator_options') {
         $auth = FALSE;
     } else if (file_exists(SM_PATH . 'plugins/administrator/admins')) {
         $auths = file(SM_PATH . 'plugins/administrator/admins');
index 5d3a1fe..2baf4ed 100644 (file)
@@ -14,6 +14,8 @@
  * @subpackage administrator
  */
 
+define('PAGE_NAME', 'administrator_options');
+
 /**
  * parse the config file
  *