diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2016-02-09 17:16:43 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2016-02-09 17:16:43 +0100 |
commit | 3a796d1e1533febc63a2719816815b47f2065e82 (patch) | |
tree | 3fdf9dab718f2a186341d875763c6f8fafd5b7db /apps | |
parent | 4659bf9b4a880376e690d3ca52e855a861c143f1 (diff) | |
download | nextcloud-server-3a796d1e1533febc63a2719816815b47f2065e82.tar.gz nextcloud-server-3a796d1e1533febc63a2719816815b47f2065e82.zip |
Consolidate getQuota and setQuota methods in User instance
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_trashbin/lib/trashbin.php | 5 | ||||
-rw-r--r-- | apps/files_versions/lib/storage.php | 6 | ||||
-rw-r--r-- | apps/provisioning_api/lib/users.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/user/user.php | 2 |
4 files changed, 5 insertions, 10 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index ca3a8b178a2..c91cfe082fd 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -564,11 +564,8 @@ class Trashbin { $config = \OC::$server->getConfig(); $softQuota = true; - $quota = $config->getUserValue($user, 'files', 'quota', null); + $quota = \OC::$server->getUserManager()->get($user)->getQuota(); $view = new \OC\Files\View('/' . $user); - if ($quota === null || $quota === 'default') { - $quota = $config->getAppValue('files', 'default_quota', null); - } if ($quota === null || $quota === 'none') { $quota = \OC\Files\Filesystem::free_space('/'); $softQuota = false; diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php index 88a4126dabd..47acec1d763 100644 --- a/apps/files_versions/lib/storage.php +++ b/apps/files_versions/lib/storage.php @@ -653,11 +653,9 @@ class Storage { $versionsFileview = new \OC\Files\View('/'.$uid.'/files_versions'); // get available disk space for user + $user = \OC::$server->getUserManager()->get($uid); $softQuota = true; - $quota = $config->getUserValue($uid, 'files', 'quota', null); - if ( $quota === null || $quota === 'default') { - $quota = $config->getAppValue('files', 'default_quota', null); - } + $quota = $user->getQuota(); if ( $quota === null || $quota === 'none' ) { $quota = \OC\Files\Filesystem::free_space('/'); $softQuota = false; diff --git a/apps/provisioning_api/lib/users.php b/apps/provisioning_api/lib/users.php index efb10a50865..c609c7bd849 100644 --- a/apps/provisioning_api/lib/users.php +++ b/apps/provisioning_api/lib/users.php @@ -278,7 +278,7 @@ class Users { $quota = \OCP\Util::humanFileSize($quota); } } - $this->config->setUserValue($targetUserId, 'files', 'quota', $quota); + $targetUser->setQuota($quota); break; case 'password': $targetUser->setPassword($parameters['_put']['value']); diff --git a/apps/user_ldap/lib/user/user.php b/apps/user_ldap/lib/user/user.php index 3bc790a6c10..8b70c9e2374 100644 --- a/apps/user_ldap/lib/user/user.php +++ b/apps/user_ldap/lib/user/user.php @@ -456,7 +456,7 @@ class User { } } if(!is_null($quota)) { - $this->config->setUserValue($this->uid, 'files', 'quota', $quota); + $user = $this->userManager->get($this->uid)->setQuota($quota); } } |