move phpdoc comments

This commit is contained in:
Robin Appelman 2013-06-03 13:33:56 +02:00
parent 1a4021a0fe
commit eb2a1e0f8a
3 changed files with 52 additions and 2 deletions

View File

@ -43,6 +43,8 @@ class Manager extends PublicEmitter {
} }
/** /**
* register a user backend
*
* @param \OC_User_Backend $backend * @param \OC_User_Backend $backend
*/ */
public function registerBackend($backend) { public function registerBackend($backend) {
@ -50,6 +52,8 @@ class Manager extends PublicEmitter {
} }
/** /**
* remove a user backend
*
* @param \OC_User_Backend $backend * @param \OC_User_Backend $backend
*/ */
public function removeBackend($backend) { public function removeBackend($backend) {
@ -58,16 +62,21 @@ class Manager extends PublicEmitter {
} }
} }
/**
* remove all user backends
*/
public function clearBackends() { public function clearBackends() {
$this->backends = array(); $this->backends = array();
} }
/** /**
* get a user by user id
*
* @param string $uid * @param string $uid
* @return \OC\User\User * @return \OC\User\User
*/ */
public function get($uid) { 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]; return $this->cachedUsers[$uid];
} }
foreach ($this->backends as $backend) { foreach ($this->backends as $backend) {
@ -78,6 +87,13 @@ class Manager extends PublicEmitter {
return null; 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) { protected function getUserObject($uid, $backend) {
if (isset($this->cachedUsers[$uid])) { if (isset($this->cachedUsers[$uid])) {
return $this->cachedUsers[$uid]; return $this->cachedUsers[$uid];
@ -87,6 +103,8 @@ class Manager extends PublicEmitter {
} }
/** /**
* check if a user exists
*
* @param string $uid * @param string $uid
* @return bool * @return bool
*/ */

View File

@ -71,6 +71,8 @@ class Session implements Emitter {
} }
/** /**
* get the manager object
*
* @return \OC\User\Manager * @return \OC\User\Manager
*/ */
public function getManager() { public function getManager() {
@ -110,6 +112,13 @@ class Session implements Emitter {
} }
} }
/**
* try to login with the provided credentials
*
* @param string $uid
* @param string $password
* @return bool
*/
public function login($uid, $password) { public function login($uid, $password) {
$this->manager->emit('\OC\User', 'preLogin', array($uid, $password)); $this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
$user = $this->manager->get($uid); $user = $this->manager->get($uid);
@ -127,6 +136,9 @@ class Session implements Emitter {
} }
} }
/**
* logout the user from the session
*/
public function logout() { public function logout() {
$this->manager->emit('\OC\User', 'logout'); $this->manager->emit('\OC\User', 'logout');
$this->setUser(null); $this->setUser(null);
@ -148,7 +160,7 @@ class Session implements Emitter {
} }
/** /**
* @brief Remove cookie for "remember username" * Remove cookie for "remember username"
*/ */
public function unsetMagicInCookie() { public function unsetMagicInCookie() {
unset($_COOKIE["oc_username"]); //TODO: DI unset($_COOKIE["oc_username"]); //TODO: DI

View File

@ -56,6 +56,8 @@ class User {
} }
/** /**
* get the user id
*
* @return string * @return string
*/ */
public function getUID() { public function getUID() {
@ -63,6 +65,8 @@ class User {
} }
/** /**
* get the displayname for the user, if no specific displayname is set it will fallback to the user id
*
* @return string * @return string
*/ */
public function getDisplayName() { public function getDisplayName() {
@ -70,6 +74,8 @@ class User {
} }
/** /**
* set the displayname for the user
*
* @param string $displayName * @param string $displayName
* @return bool * @return bool
*/ */
@ -83,6 +89,8 @@ class User {
} }
/** /**
* Delete the user
*
* @return bool * @return bool
*/ */
public function delete() { public function delete() {
@ -97,6 +105,8 @@ class User {
} }
/** /**
* Check if the password is valid for the user
*
* @param $password * @param $password
* @return bool * @return bool
*/ */
@ -113,6 +123,8 @@ class User {
} }
/** /**
* Set the password of the user
*
* @param string $password * @param string $password
* @param string $recoveryPassword for the encryption app to reset encryption keys * @param string $recoveryPassword for the encryption app to reset encryption keys
* @return bool * @return bool
@ -145,6 +157,8 @@ class User {
} }
/** /**
* check if the backend supports changing passwords
*
* @return bool * @return bool
*/ */
public function canChangePassword() { public function canChangePassword() {
@ -152,6 +166,8 @@ class User {
} }
/** /**
* check if the backend supports changing display names
*
* @return bool * @return bool
*/ */
public function canChangeDisplayName() { public function canChangeDisplayName() {
@ -159,6 +175,8 @@ class User {
} }
/** /**
* check if the user is enabled
*
* @return bool * @return bool
*/ */
public function isEnabled() { public function isEnabled() {
@ -166,6 +184,8 @@ class User {
} }
/** /**
* set the enabled status for the user
*
* @param bool $enabled * @param bool $enabled
*/ */
public function setEnabled($enabled) { public function setEnabled($enabled) {