Throw exception if admin auth requested but no admins defined
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Feb 2010 21:03:15 +0000 (14:03 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Feb 2010 21:08:01 +0000 (14:08 -0700)
framework/Core/lib/Horde/Registry.php

index 290f0ea..d629be2 100644 (file)
@@ -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();