Browse Source

make use of PAGE_NAME constant in plugin, prefix it with the plugin name.

Thijs Kinkhorst 18 years ago
parent
commit
9a031330ae
2 changed files with 4 additions and 2 deletions
  1. 2 2
      plugins/administrator/auth.php
  2. 2 0
      plugins/administrator/options.php

+ 2 - 2
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');

+ 2 - 0
plugins/administrator/options.php

@@ -14,6 +14,8 @@
  * @subpackage administrator
  */
 
+define('PAGE_NAME', 'administrator_options');
+
 /**
  * parse the config file
  *