FIx stable21 difference

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-04-29 08:19:20 +02:00
parent 5975a68033
commit ca8b2a6b5e
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 4 additions and 3 deletions

View File

@ -71,6 +71,7 @@ use OCP\L10N\IFactory;
use OCP\Security\ISecureRandom; use OCP\Security\ISecureRandom;
use OCP\Security\Events\GenerateSecurePasswordEvent; use OCP\Security\Events\GenerateSecurePasswordEvent;
use OCP\EventDispatcher\IEventDispatcher; use OCP\EventDispatcher\IEventDispatcher;
use OCP\User\Backend\ISetDisplayNameBackend;
class UsersController extends AUserData { class UsersController extends AUserData {
@ -533,7 +534,7 @@ class UsersController extends AUserData {
public function getEditableFields(?string $userId = null): DataResponse { public function getEditableFields(?string $userId = null): DataResponse {
$currentLoggedInUser = $this->userSession->getUser(); $currentLoggedInUser = $this->userSession->getUser();
if (!$currentLoggedInUser instanceof IUser) { if (!$currentLoggedInUser instanceof IUser) {
throw new OCSException('', OCSController::RESPOND_NOT_FOUND); throw new OCSException('', \OCP\API::RESPOND_NOT_FOUND);
} }
$permittedFields = []; $permittedFields = [];
@ -541,13 +542,13 @@ class UsersController extends AUserData {
if ($userId !== $currentLoggedInUser->getUID()) { if ($userId !== $currentLoggedInUser->getUID()) {
$targetUser = $this->userManager->get($userId); $targetUser = $this->userManager->get($userId);
if (!$targetUser instanceof IUser) { if (!$targetUser instanceof IUser) {
throw new OCSException('', OCSController::RESPOND_NOT_FOUND); throw new OCSException('', \OCP\API::RESPOND_NOT_FOUND);
} }
$subAdminManager = $this->groupManager->getSubAdmin(); $subAdminManager = $this->groupManager->getSubAdmin();
if (!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) if (!$this->groupManager->isAdmin($currentLoggedInUser->getUID())
&& !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) {
throw new OCSException('', OCSController::RESPOND_NOT_FOUND); throw new OCSException('', \OCP\API::RESPOND_NOT_FOUND);
} }
} else { } else {
$targetUser = $currentLoggedInUser; $targetUser = $currentLoggedInUser;