diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-10-27 14:09:45 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-10-29 11:31:18 +0100 |
commit | c6f6a8758b3f08e47c3a8f45a67d09698376b2e2 (patch) | |
tree | bfd52190961e28ae97fa65a96df05b1fe0390a2f /settings/ajax/setquota.php | |
parent | f428d31a5d1f91c6e7aa96fd8550c75c02cc0963 (diff) | |
download | nextcloud-server-c6f6a8758b3f08e47c3a8f45a67d09698376b2e2.tar.gz nextcloud-server-c6f6a8758b3f08e47c3a8f45a67d09698376b2e2.zip |
Drop OC_SubAdmin and replace usages
Diffstat (limited to 'settings/ajax/setquota.php')
-rw-r--r-- | settings/ajax/setquota.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index a9012a55345..8e6d44c2d8d 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -32,9 +32,16 @@ OCP\JSON::callCheck(); $username = isset($_POST["username"]) ? (string)$_POST["username"] : ''; +$isUserAccessible = false; +$currentUserObject = \OC::$server->getUserSession()->getUser(); +$targetUserObject = \OC::$server->getUserManager()->get($username); +if($targetUserObject !== null && $currentUserObject !== null) { + $isUserAccessible = \OC::$server->getGroupManager()->getSubAdmin()->isUserAccessible($currentUserObject, $targetUserObject); +} + if(($username === '' && !OC_User::isAdminUser(OC_User::getUser())) || (!OC_User::isAdminUser(OC_User::getUser()) - && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username))) { + && !$isUserAccessible)) { $l = \OC::$server->getL10N('core'); OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); exit(); |