From 5a4854079fbf9c6b359c1c9afdaeb5c6e19609e8 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Sun, 26 Aug 2012 16:24:25 +0200 Subject: implement getHome in OC_User --- lib/user.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/user.php') diff --git a/lib/user.php b/lib/user.php index 06a56b7f4a6..97ec0c10504 100644 --- a/lib/user.php +++ b/lib/user.php @@ -332,6 +332,27 @@ class OC_User { } } + /** + * @brief Check if the password is correct + * @param $uid The username + * @param $password The password + * @returns string + * + * Check if the password is correct without logging in the user + * returns the user id or false + */ + public static function getHome($uid){ + foreach(self::$_usedBackends as $backend){ + if($backend->implementsActions(OC_USER_BACKEND_GET_HOME)){ + $result=$backend->getHome($uid); + if($result){ + return $result; + } + } + } + return OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ) . '/' . $user; + } + /** * @brief Get a list of all users * @returns array with all uids -- cgit v1.2.3