diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-11-18 11:55:37 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-21 11:30:00 +0100 |
commit | 8bf41113682f5d41529ff09f400880574e9b9322 (patch) | |
tree | b37cab919bd8e0de52ab57c11bbab98c6cd522e1 /settings/Controller/UsersController.php | |
parent | 662dff046d7b287c380656a3c0302cd63736e753 (diff) | |
download | nextcloud-server-8bf41113682f5d41529ff09f400880574e9b9322.tar.gz nextcloud-server-8bf41113682f5d41529ff09f400880574e9b9322.zip |
Fix changing display names for subadmins
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'settings/Controller/UsersController.php')
-rw-r--r-- | settings/Controller/UsersController.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index fa97845dfba..8f077270392 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -681,8 +681,14 @@ class UsersController extends Controller { $currentUser = $this->userSession->getUser(); $user = $this->userManager->get($username); - if (!$this->groupManager->isAdmin($currentUser->getUID()) && - !$this->groupManager->getSubAdmin()->isUserAccessible($currentUser, $user) + if ($user === null || + !$user->canChangeDisplayName() || + ( + !$this->groupManager->isAdmin($currentUser->getUID()) && + !$this->groupManager->getSubAdmin()->isUserAccessible($currentUser, $user) && + $currentUser->getUID() !== $username + + ) ) { return new DataResponse([ 'status' => 'error', |