Move Horde_Auth_Application methods into Horde_Registry_Application
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 21:36:00 +0000 (15:36 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 21:36:00 +0000 (15:36 -0600)
folks/lib/Api.php
folks/lib/Application.php

index 92460c7..c08c91e 100644 (file)
@@ -367,81 +367,6 @@ class Folks_Api extends Horde_Registry_Api
     }
 
     /**
-     * Authenticate a givern user
-     *
-     * @param string $userID       Username
-     * @param array  $credentials  Array of criedentials (password requied)
-     * @param array  $params       Additional params
-     *
-     * @return boolean  Whether IMP authentication was successful.
-     */
-    public function authenticate($userID, $credentials, $params)
-    {
-        require_once dirname(__FILE__) . '/base.php';
-
-        return $GLOBALS['folks_driver']->comparePassword($userID, $credentials['password']);
-    }
-
-    /**
-     * Check if a user exists
-     *
-     * @param string $userID       Username
-     *
-     * @return boolean  True if user exists
-     */
-    public function userExists($userId)
-    {
-        require_once dirname(__FILE__) . '/base.php';
-
-        return $GLOBALS['folks_driver']->userExists($userId);
-    }
-
-    /**
-     * Lists all users in the system.
-     *
-     * @return array  The array of userIds, or a PEAR_Error object on failure.
-     */
-    public function userList()
-    {
-        require_once dirname(__FILE__) . '/base.php';
-
-        $users = array();
-        foreach ($GLOBALS['folks_driver']->getUsers() as $user) {
-            $users[] = $user['user_uid'];
-        }
-
-        return $users;
-    }
-
-    /**
-     * Adds a set of authentication credentials.
-     *
-     * @param string $userId  The userId to add.
-     *
-     * @return boolean  True on success or a PEAR_Error object on failure.
-     */
-    public function addUser($userId)
-    {
-        require_once dirname(__FILE__) . '/base.php';
-
-        return $GLOBALS['folks_driver']->addUser($userId);
-    }
-
-    /**
-     * Deletes a set of authentication credentials.
-     *
-     * @param string $userId  The userId to delete.
-     *
-     * @return boolean  True on success or a PEAR_Error object on failure.
-     */
-    public function removeUser($userId)
-    {
-        require_once dirname(__FILE__) . '/base.php';
-
-        return $GLOBALS['folks_driver']->deleteUser($userId);
-    }
-
-    /**
      * Deletes a user and its data
      *
      * @param string $userId  The userId to delete.
index 7de69c3..6c8f0af 100644 (file)
@@ -21,4 +21,79 @@ class Folks_Application extends Horde_Registry_Application
         return Folks::getMenu();
     }
 
+    /**
+     * Authenticate a givern user
+     *
+     * @param string $userID       Username
+     * @param array  $credentials  Array of criedentials (password requied)
+     * @param array  $params       Additional params
+     *
+     * @return boolean  Whether IMP authentication was successful.
+     */
+    public function authAuthenticate($userID, $credentials, $params)
+    {
+        require_once dirname(__FILE__) . '/base.php';
+
+        return $GLOBALS['folks_driver']->comparePassword($userID, $credentials['password']);
+    }
+
+    /**
+     * Check if a user exists
+     *
+     * @param string $userID       Username
+     *
+     * @return boolean  True if user exists
+     */
+    public function authUserExists($userId)
+    {
+        require_once dirname(__FILE__) . '/base.php';
+
+        return $GLOBALS['folks_driver']->userExists($userId);
+    }
+
+    /**
+     * Lists all users in the system.
+     *
+     * @return array  The array of userIds, or a PEAR_Error object on failure.
+     */
+    public function authUserList()
+    {
+        require_once dirname(__FILE__) . '/base.php';
+
+        $users = array();
+        foreach ($GLOBALS['folks_driver']->getUsers() as $user) {
+            $users[] = $user['user_uid'];
+        }
+
+        return $users;
+    }
+
+    /**
+     * Adds a set of authentication credentials.
+     *
+     * @param string $userId  The userId to add.
+     *
+     * @return boolean  True on success or a PEAR_Error object on failure.
+     */
+    public function authAddUser($userId)
+    {
+        require_once dirname(__FILE__) . '/base.php';
+
+        return $GLOBALS['folks_driver']->addUser($userId);
+    }
+
+    /**
+     * Deletes a set of authentication credentials.
+     *
+     * @param string $userId  The userId to delete.
+     *
+     * @return boolean  True on success or a PEAR_Error object on failure.
+     */
+    public function authRemoveUser($userId)
+    {
+        require_once dirname(__FILE__) . '/base.php';
+
+        return $GLOBALS['folks_driver']->deleteUser($userId);
+    }
+
 }