Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-10-27 16:09:45 +0300
committerLukas Reschke <lukas@owncloud.com>2015-10-29 13:31:18 +0300
commitc6f6a8758b3f08e47c3a8f45a67d09698376b2e2 (patch)
treebfd52190961e28ae97fa65a96df05b1fe0390a2f /settings/changepassword
parentf428d31a5d1f91c6e7aa96fd8550c75c02cc0963 (diff)
Drop OC_SubAdmin and replace usages
Diffstat (limited to 'settings/changepassword')
-rw-r--r--settings/changepassword/controller.php9
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');