From 9135deb2eb25bf0b0c43fa80108a835aef26819b Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 11 Aug 2009 15:36:00 -0600 Subject: [PATCH] Move Horde_Auth_Application methods into Horde_Registry_Application --- folks/lib/Api.php | 75 ----------------------------------------------- folks/lib/Application.php | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 75 deletions(-) diff --git a/folks/lib/Api.php b/folks/lib/Api.php index 92460c760..c08c91ef1 100644 --- a/folks/lib/Api.php +++ b/folks/lib/Api.php @@ -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. diff --git a/folks/lib/Application.php b/folks/lib/Application.php index 7de69c3f5..6c8f0afbf 100644 --- a/folks/lib/Application.php +++ b/folks/lib/Application.php @@ -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); + } + } -- 2.11.0