From: kink Date: Sat, 14 Jul 2007 17:44:29 +0000 (+0000) Subject: make use of PAGE_NAME constant in plugin, prefix it with the plugin name. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a6f162ebaf3ee91a5805509a815a85a98ecf482c;p=squirrelmail.git make use of PAGE_NAME constant in plugin, prefix it with the plugin name. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12533 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/administrator/auth.php b/plugins/administrator/auth.php index f82f3edb..85d049c4 100644 --- a/plugins/administrator/auth.php +++ b/plugins/administrator/auth.php @@ -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'); diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index 5d3a1fe1..2baf4ed8 100644 --- a/plugins/administrator/options.php +++ b/plugins/administrator/options.php @@ -14,6 +14,8 @@ * @subpackage administrator */ +define('PAGE_NAME', 'administrator_options'); + /** * parse the config file *