Get rid of AUTH_HANDLER defines
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Jul 2009 05:33:04 +0000 (23:33 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Jul 2009 05:33:04 +0000 (23:33 -0600)
framework/Core/lib/Horde/Registry.php
framework/Memcache/scripts/Horde/Memcache/stats.php
framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php

index dd5afd1..e541932 100644 (file)
@@ -385,14 +385,13 @@ class Horde_Registry
                              $perms = PERMS_SHOW)
     {
         $apps = array();
-        $ahandler = defined('AUTH_HANDLER');
         if (is_null($filter)) {
             $filter = array('notoolbar', 'active');
         }
 
         foreach ($this->applications as $app => $params) {
             if (in_array($params['status'], $filter) &&
-                ($ahandler || $this->hasPermission($app, $perms))) {
+                $this->hasPermission($app, $perms)) {
                 $apps[$app] = $app;
             }
         }
@@ -907,19 +906,9 @@ class Horde_Registry
      */
     public function hasPermission($app, $perms = PERMS_READ)
     {
-        $this->_lastPerms = null;
-
-        if (Horde_Auth::isAdmin()) {
-            return true;
-        }
-
-        if ($GLOBALS['perms']->exists($app) &&
-            !$GLOBALS['perms']->hasPermission($app, Horde_Auth::getAuth(), $perms)) {
-            $this->_lastPerms = 'perms';
-            return false;
-        }
-
-        return true;
+        return Horde_Auth::isAdmin() ||
+               !$GLOBALS['perms']->exists($app) ||
+               $GLOBALS['perms']->hasPermission($app, Horde_Auth::getAuth(), $perms);
     }
 
     /**
index ae4cd6f..c8192c2 100755 (executable)
@@ -16,9 +16,6 @@
  * @package Horde_Memcache
  */
 
-// No auth.
-@define('AUTH_HANDLER', true);
-
 // Find the base file path of Horde.
 @define('HORDE_BASE', dirname(__FILE__) . '/..');
 
@@ -35,6 +32,8 @@ if (!Horde_Cli::runningFromCLI()) {
 $cli = &Horde_Cli::singleton();
 $cli->init();
 
+// No auth.
+$horde_authentication = 'none';
 require_once HORDE_BASE . '/lib/base.php';
 
 /* Make sure there's no compression. */
index 9782793..01376b1 100755 (executable)
@@ -10,9 +10,6 @@
  * @package Horde_SessionHandler
  */
 
-// No auth.
-@define('AUTH_HANDLER', true);
-
 // Find the base file path of Horde.
 @define('HORDE_BASE', dirname(__FILE__) . '/..');
 
@@ -29,6 +26,8 @@ if (!Horde_Cli::runningFromCLI()) {
 $cli = Horde_Cli::singleton();
 $cli->init();
 
+// No auth.
+$horde_authentication = 'none';
 require_once HORDE_BASE . '/lib/base.php';
 
 /* Make sure there's no compression. */