From: Michael M Slusarz Date: Wed, 22 Jul 2009 05:33:04 +0000 (-0600) Subject: Get rid of AUTH_HANDLER defines X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=890a7acebc44509e808c5be1845dc79b828e29f0;p=horde.git Get rid of AUTH_HANDLER defines --- diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index dd5afd164..e54193239 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -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); } /** diff --git a/framework/Memcache/scripts/Horde/Memcache/stats.php b/framework/Memcache/scripts/Horde/Memcache/stats.php index ae4cd6f31..c8192c2a5 100755 --- a/framework/Memcache/scripts/Horde/Memcache/stats.php +++ b/framework/Memcache/scripts/Horde/Memcache/stats.php @@ -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. */ diff --git a/framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php b/framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php index 978279399..01376b1c6 100755 --- a/framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php +++ b/framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php @@ -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. */