}
/**
+ * register a user backend
+ *
* @param \OC_User_Backend $backend
*/
public function registerBackend($backend) {
}
/**
+ * remove a user backend
+ *
* @param \OC_User_Backend $backend
*/
public function removeBackend($backend) {
}
}
+ /**
+ * remove all user backends
+ */
public function clearBackends() {
$this->backends = array();
}
/**
+ * get a user by user id
+ *
* @param string $uid
* @return \OC\User\User
*/
public function get($uid) {
- if (isset($this->cachedUsers[$uid])) {
+ if (isset($this->cachedUsers[$uid])) { //check the cache first to prevent having to loop over the backends
return $this->cachedUsers[$uid];
}
foreach ($this->backends as $backend) {
return null;
}
+ /**
+ * get or construct the user object
+ *
+ * @param string $uid
+ * @param \OC_User_Backend $backend
+ * @return \OC\User\User
+ */
protected function getUserObject($uid, $backend) {
if (isset($this->cachedUsers[$uid])) {
return $this->cachedUsers[$uid];
}
/**
+ * check if a user exists
+ *
* @param string $uid
* @return bool
*/
}
/**
+ * get the manager object
+ *
* @return \OC\User\Manager
*/
public function getManager() {
}
}
+ /**
+ * try to login with the provided credentials
+ *
+ * @param string $uid
+ * @param string $password
+ * @return bool
+ */
public function login($uid, $password) {
$this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
$user = $this->manager->get($uid);
}
}
+ /**
+ * logout the user from the session
+ */
public function logout() {
$this->manager->emit('\OC\User', 'logout');
$this->setUser(null);
}
/**
- * @brief Remove cookie for "remember username"
+ * Remove cookie for "remember username"
*/
public function unsetMagicInCookie() {
unset($_COOKIE["oc_username"]); //TODO: DI
}
/**
+ * get the user id
+ *
* @return string
*/
public function getUID() {
}
/**
+ * get the displayname for the user, if no specific displayname is set it will fallback to the user id
+ *
* @return string
*/
public function getDisplayName() {
}
/**
+ * set the displayname for the user
+ *
* @param string $displayName
* @return bool
*/
}
/**
+ * Delete the user
+ *
* @return bool
*/
public function delete() {
}
/**
+ * Check if the password is valid for the user
+ *
* @param $password
* @return bool
*/
}
/**
+ * Set the password of the user
+ *
* @param string $password
* @param string $recoveryPassword for the encryption app to reset encryption keys
* @return bool
}
/**
+ * check if the backend supports changing passwords
+ *
* @return bool
*/
public function canChangePassword() {
}
/**
+ * check if the backend supports changing display names
+ *
* @return bool
*/
public function canChangeDisplayName() {
}
/**
+ * check if the user is enabled
+ *
* @return bool
*/
public function isEnabled() {
}
/**
+ * set the enabled status for the user
+ *
* @param bool $enabled
*/
public function setEnabled($enabled) {