diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-12-04 14:15:55 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-12-08 12:11:01 +0100 |
commit | fe7d9a7ca07bb21905c6483dee49bf37dd131674 (patch) | |
tree | f37a25e518c0ce38530a452d63386a525f5121f3 /lib/private/user.php | |
parent | e6908f8b890414451dfc32af4d76562016d75d0f (diff) | |
download | nextcloud-server-fe7d9a7ca07bb21905c6483dee49bf37dd131674.tar.gz nextcloud-server-fe7d9a7ca07bb21905c6483dee49bf37dd131674.zip |
Add REST route for user & group management
First step of a somewhat testable user management. - I know, the JSON returns are in an ugly format but the JS expects it that way. So let's keep it that way until we have time to fix the JS in the future.
Diffstat (limited to 'lib/private/user.php')
-rw-r--r-- | lib/private/user.php | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/lib/private/user.php b/lib/private/user.php index b2a235425c4..f93b76a3a64 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -47,6 +47,7 @@ class OC_User { /** * @return \OC\User\Manager + * @deprecated Use \OC::$server->getUserManager() */ public static function getManager() { return OC::$server->getUserManager(); @@ -179,6 +180,7 @@ class OC_User { * itself, not in its subclasses. * * Allowed characters in the username are: "a-z", "A-Z", "0-9" and "_.@-" + * @deprecated Use \OC::$server->getUserManager->createUser($uid, $password) */ public static function createUser($uid, $password) { return self::getManager()->createUser($uid, $password); @@ -190,30 +192,12 @@ class OC_User { * @return bool * * Deletes a user + * @deprecated Use \OC::$server->getUserManager->delete() */ public static function deleteUser($uid) { $user = self::getManager()->get($uid); if ($user) { - $result = $user->delete(); - - // if delete was successful we clean-up the rest - if ($result) { - - // We have to delete the user from all groups - foreach (OC_Group::getUserGroups($uid) as $i) { - OC_Group::removeFromGroup($uid, $i); - } - // Delete the user's keys in preferences - OC_Preferences::deleteUser($uid); - - // Delete user files in /data/ - OC_Helper::rmdirr(\OC_User::getHome($uid)); - - // Delete the users entry in the storage table - \OC\Files\Cache\Storage::remove('home::' . $uid); - } - - return true; + return $user->delete(); } else { return false; } @@ -525,6 +509,7 @@ class OC_User { * @return string * * returns the path to the users home directory + * @deprecated Use \OC::$server->getUserManager->getHome() */ public static function getHome($uid) { $user = self::getManager()->get($uid); |