}
}
+ /**
+ * @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
define('OC_USER_BACKEND_CREATE_USER', 0x000001);
define('OC_USER_BACKEND_SET_PASSWORD', 0x000010);
define('OC_USER_BACKEND_CHECK_PASSWORD', 0x000100);
+define('OC_USER_BACKEND_GET_HOME', 0x001000);
/**
OC_USER_BACKEND_CREATE_USER => 'createUser',
OC_USER_BACKEND_SET_PASSWORD => 'setPassword',
OC_USER_BACKEND_CHECK_PASSWORD => 'checkPassword',
+ OC_USER_BACKEND_GET_HOME => 'getHome',
);
/**
public function userExists($uid){
return false;
}
+
+ /**
+ * @brief get the user's home directory
+ * @param string $uid the username
+ * @return boolean
+ */
+ public function getHome($uid){
+ return false;
+ }
}
return $result->numRows() > 0;
}
+
+ /**
+ * @brief get the user's home directory
+ * @param string $uid the username
+ * @return boolean
+ */
+ public function getHome($uid){
+ if($this->userExists($uid)){
+ return OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ) . '/' . $user;
+ }else{
+ return false;
+ }
+ }
}
* returns the user id or false
*/
abstract public function checkPassword($uid, $password);
+
+ /**
+ * @brief get the user's home directory
+ * @param $uid The username
+ * @returns string
+ *
+ * get the user's home directory
+ * returns the path or false
+ */
+ abstract public function getHome($uid);
}
public function userExists($uid){
return $this->matchUrl($uid);
}
+
+ /**
+ * @brief get the user's home directory
+ * @param string $uid the username
+ * @return boolean
+ */
+ public function getHome($uid){
+ if($this->userExists($uid)){
+ return OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ) . '/' . $user;
+ }else{
+ return false;
+ }
+ }
}
\ No newline at end of file
*/
public function userExists($uid);
+ /**
+ * @brief get the user's home directory
+ * @param string $uid the username
+ * @return boolean
+ */
+ public function getHome($uid);
+
}
\ No newline at end of file