Move requireAuth() from horde/Auth to horde/Core
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 1 Jun 2010 08:51:25 +0000 (02:51 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 2 Jun 2010 03:32:19 +0000 (21:32 -0600)
framework/Auth/lib/Horde/Auth.php
framework/Core/lib/Horde/Registry.php

index f145be2..f1634ed 100644 (file)
@@ -366,23 +366,6 @@ class Horde_Auth
     }
 
     /**
-     * Checks if an application requires additional authentication above and
-     * beyond Horde authentication.
-     *
-     * @params string $app  The application to check.
-     *
-     * @return boolean  Whether or not the application required additional
-     *                  authentication.
-     * @throws Horde_Auth_Exception
-     */
-    static public function requireAuth($app)
-    {
-        return ($app == 'horde')
-            ? false
-            : $GLOBALS['injector']->getInstance('Horde_Auth')->getOb('application', array('app' => $app))->requireAuth();
-    }
-
-    /**
      * Check existing auth for triggers that might invalidate it.
      *
      * @return boolean  Is existing auth valid?
index ac48f7f..40cb792 100644 (file)
@@ -1217,7 +1217,7 @@ class Horde_Registry
          * application auth != Horde admin auth. And there can *never* be
          * non-SHOW access to an application that requires authentication. */
         if (!Horde_Auth::isAuthenticated(array('app' => $app)) &&
-            Horde_Auth::requireAuth($app) &&
+            $this->requireAuth($app) &&
             ($perms != Horde_Perms::SHOW)) {
             return false;
         }
@@ -1620,4 +1620,21 @@ class Horde_Registry
             : false;
     }
 
+    /**
+     * Checks if an application requires additional authentication above and
+     * beyond Horde authentication.
+     *
+     * @params string $app  The application to check.
+     *
+     * @return boolean  Whether or not the application required additional
+     *                  authentication.
+     * @throws Horde_Exception
+     */
+    public function requireAuth($app)
+    {
+        return ($app == 'horde')
+            ? false
+            : $GLOBALS['injector']->getInstance('Horde_Auth')->getOb('application', array('app' => $app))->requireAuth();
+    }
+
 }