From 6a5bf0aa07a50a34c25de6cd8eae0ee388a8e531 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 5 Feb 2010 14:03:15 -0700 Subject: [PATCH] Throw exception if admin auth requested but no admins defined --- framework/Core/lib/Horde/Registry.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); -- 2.11.0