From: Michael M Slusarz Date: Fri, 5 Feb 2010 21:03:15 +0000 (-0700) Subject: Throw exception if admin auth requested but no admins defined X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6a5bf0aa07a50a34c25de6cd8eae0ee388a8e531;p=horde.git Throw exception if admin auth requested but no admins defined --- diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 290f0ea6d..d629be2ea 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -198,8 +198,11 @@ class Horde_Registry Horde::compressOutput(); } - if ($args['user_admin'] && !empty($conf['auth']['admins'])) { - Horde_Auth::setAuth(reset($conf['auth']['admins']), array()); + if ($args['user_admin']) { + if (empty($GLOBALS['conf']['auth']['admins'])) { + throw new Horde_Exception('No admin users defined in configuration.'); + } + Horde_Auth::setAuth(reset($GLOBALS['conf']['auth']['admins']), array()); } $appob->init();