summaryrefslogtreecommitdiffstats
path: root/settings/changepassword/controller.php
diff options
context:
space:
mode:
Diffstat (limited to 'settings/changepassword/controller.php')
-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');