summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-04-18 10:41:01 +0200
committerJakob Sack <kde@jakobsack.de>2011-04-18 10:41:01 +0200
commit1fe5f5a2dfacb5b1fede2aa112ffb0edd7673048 (patch)
tree38ada1be3f80b6bed4c8d8bb70b84d3006a4fa6e /lib/user.php
parenta70330e9be737ff87a1ff669cc6e9da4da16f3f4 (diff)
downloadnextcloud-server-1fe5f5a2dfacb5b1fede2aa112ffb0edd7673048.tar.gz
nextcloud-server-1fe5f5a2dfacb5b1fede2aa112ffb0edd7673048.zip
Better documentation for OC_USER
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php70
1 files changed, 48 insertions, 22 deletions
diff --git a/lib/user.php b/lib/user.php
index 6cfcc6be488..10f08576d4c 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -87,33 +87,45 @@ class OC_USER {
}
/**
- * @brief Creates a new user
+ * @brief Create a new user
* @param $username The username of the user to create
* @param $password The password of the new user
+ * @returns true/false
+ *
+ * Creates a new user
*/
public static function createUser( $username, $password ){
return self::$_backend->createUser( $username, $password );
}
/**
- * @brief Delete a new user
- * @param $username The username of the user to delete
+ * @brief delete a user
+ * @param $uid The username of the user to delete
+ * @returns true/false
+ *
+ * Deletes a user
*/
- public static function deleteUser( $username ){
- return self::$_backend->deleteUser( $username );
+ public static function deleteUser( $uid ){
+ return self::$_backend->deleteUser( $uid );
}
/**
- * @brief try to login a user
- * @param $username The username of the user to log in
+ * @brief Try to login a user
+ * @param $uid The username of the user to log in
* @param $password The password of the user
+ * @returns true/false
+ *
+ * Log in a user - if the password is ok
*/
- public static function login( $username, $password ){
- return self::$_backend->login( $username, $password );
+ public static function login( $uid, $password ){
+ return self::$_backend->login( $uid, $password );
}
/**
* @brief Kick the user
+ * @returns true
+ *
+ * Logout, destroys session
*/
public static function logout(){
return self::$_backend->logout();
@@ -121,39 +133,53 @@ class OC_USER {
/**
* @brief Check if the user is logged in
+ * @returns true/false
+ *
+ * Checks if the user is logged in
*/
public static function isLoggedIn(){
return self::$_backend->isLoggedIn();
}
/**
- * @brief Generate a random password
+ * @brief Autogenerate a password
+ * @returns string
+ *
+ * generates a password
*/
public static function generatePassword(){
return substr( md5( uniqId().time()), 0, 10 );
}
/**
- * @brief Set the password of a user
- * @param $username User whose password will be changed
- * @param $password The new password for the user
+ * @brief Set password
+ * @param $uid The username
+ * @param $password The new password
+ * @returns true/false
+ *
+ * Change the password of a user
*/
- public static function setPassword( $username, $password ){
- return self::$_backend->setPassword( $username, $password );
+ public static function setPassword( $uid, $password ){
+ return self::$_backend->setPassword( $uid, $password );
}
/**
- * @brief Check if the password of the user is correct
- * @param string $username Name of the user
- * @param string $password Password of the user
+ * @brief Check if the password is correct
+ * @param $uid The username
+ * @param $password The password
+ * @returns true/false
+ *
+ * Check if the password is correct without logging in the user
*/
- public static function checkPassword( $username, $password ){
- return self::$_backend->checkPassword( $username, $password );
+ public static function checkPassword( $uid, $password ){
+ return self::$_backend->checkPassword( $uid, $password );
}
/**
- * @brief get a list of all users
- * @returns array with uids
+ * @brief Get a list of all users
+ * @returns array with all uids
+ *
+ * Get a list of all users.
*/
public static function getUsers(){
return self::$_backend->getUsers();