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/changepassword | |
parent | f428d31a5d1f91c6e7aa96fd8550c75c02cc0963 (diff) | |
download | nextcloud-server-c6f6a8758b3f08e47c3a8f45a67d09698376b2e2.tar.gz nextcloud-server-c6f6a8758b3f08e47c3a8f45a67d09698376b2e2.zip |
Drop OC_SubAdmin and replace usages
Diffstat (limited to 'settings/changepassword')
-rw-r--r-- | settings/changepassword/controller.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/settings/changepassword/controller.php b/settings/changepassword/controller.php index 3fa3ac67edb..695914683db 100644 --- a/settings/changepassword/controller.php +++ b/settings/changepassword/controller.php @@ -66,9 +66,16 @@ class Controller { $password = isset($_POST['password']) ? $_POST['password'] : null; $recoveryPassword = isset($_POST['recoveryPassword']) ? $_POST['recoveryPassword'] : null; + $isUserAccessible = false; + $currentUserObject = \OC::$server->getUserSession()->getUser(); + $targetUserObject = \OC::$server->getUserManager()->get($username); + if($currentUserObject !== null && $targetUserObject !== null) { + $isUserAccessible = \OC::$server->getGroupManager()->getSubAdmin()->isUserAccessible($currentUserObject, $targetUserObject); + } + if (\OC_User::isAdminUser(\OC_User::getUser())) { $userstatus = 'admin'; - } elseif (\OC_SubAdmin::isUserAccessible(\OC_User::getUser(), $username)) { + } elseif ($isUserAccessible) { $userstatus = 'subadmin'; } else { $l = new \OC_L10n('settings'); |