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 f82f3edb5c81bc12fd484b3816098906edee5222..85d049c43cb77ad748eea6c3e58a4173cb55f07a 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 5d3a1fe1e8454a20a13fead4a6fae801a5e8235a..2baf4ed88f289fb1a99fcb35f4255860bbe2490f 100644 (file)
@@ -14,6 +14,8 @@
  * @subpackage administrator
  */
 
+define('PAGE_NAME', 'administrator_options');
+
 /**
  * parse the config file
  *