X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fadministrator%2Fauth.php;h=02314214b1a15154ebdfe27df8388e3483d39fcb;hb=18bd19a0203675a6ffdad77b825dc9d95c4fe87d;hp=dd4560f23164ebdd982438b04224701e77a63dba;hpb=47ccfad452e8d345542d09e59112cac317cffed8;p=squirrelmail.git diff --git a/plugins/administrator/auth.php b/plugins/administrator/auth.php index dd4560f2..02314214 100644 --- a/plugins/administrator/auth.php +++ b/plugins/administrator/auth.php @@ -7,7 +7,7 @@ * to the plugin. * * @author Philippe Mingo - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright 1999-2018 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins @@ -20,8 +20,7 @@ * @return boolean */ function adm_check_user() { - global $PHP_SELF, $plugins; - require_once(SM_PATH . 'functions/global.php'); + global $plugins; /* fail if the plugin is not enabled */ if ( !in_array('administrator', $plugins) ) { @@ -33,7 +32,9 @@ function adm_check_user() { } /* This needs to be first, for all non_options pages */ - if (strpos('options.php', $PHP_SELF)) { + //if (!defined('PAGE_NAME') || strpos(PAGE_NAME, 'options') === FALSE) { + if (!defined('PAGE_NAME') + || (PAGE_NAME != 'administrator_options' && PAGE_NAME != 'options')) { $auth = FALSE; } else if (file_exists(SM_PATH . 'plugins/administrator/admins')) { $auths = file(SM_PATH . 'plugins/administrator/admins'); @@ -64,4 +65,3 @@ function adm_check_user() { function adm_array_trim(&$value,$key) { $value=trim($value); } -?> \ No newline at end of file