diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-04-10 16:38:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 16:38:23 +0200 |
commit | 1762a409f954fd9a66e7572704ea9ba7813601b4 (patch) | |
tree | 554d8f6bc93f397755d0a7c050041a9973e25396 /apps/provisioning_api/lib/Controller/UsersController.php | |
parent | eba3726e1e1b7ce0a98df4552cfdecfe05e0d63a (diff) | |
parent | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (diff) | |
download | nextcloud-server-1762a409f954fd9a66e7572704ea9ba7813601b4.tar.gz nextcloud-server-1762a409f954fd9a66e7572704ea9ba7813601b4.zip |
Merge pull request #20422 from nextcloud/techdebt/format-control-structs-classes-methods
Format control structures, classes, methods and function
Diffstat (limited to 'apps/provisioning_api/lib/Controller/UsersController.php')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index ff67a880c13..bd327ffe441 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -140,7 +140,7 @@ class UsersController extends AUserData { // Admin? Or SubAdmin? $uid = $user->getUID(); $subAdminManager = $this->groupManager->getSubAdmin(); - if ($this->groupManager->isAdmin($uid)){ + if ($this->groupManager->isAdmin($uid)) { $users = $this->userManager->search($search, $limit, $offset); } elseif ($subAdminManager->isSubAdmin($user)) { $subAdminOfGroups = $subAdminManager->getSubAdminsGroups($user); @@ -173,7 +173,7 @@ class UsersController extends AUserData { // Admin? Or SubAdmin? $uid = $currentUser->getUID(); $subAdminManager = $this->groupManager->getSubAdmin(); - if ($this->groupManager->isAdmin($uid)){ + if ($this->groupManager->isAdmin($uid)) { $users = $this->userManager->search($search, $limit, $offset); $users = array_keys($users); } elseif ($subAdminManager->isSubAdmin($currentUser)) { @@ -250,7 +250,7 @@ class UsersController extends AUserData { $isAdmin = $this->groupManager->isAdmin($user->getUID()); $subAdminManager = $this->groupManager->getSubAdmin(); - if(empty($userid) && $this->config->getAppValue('core', 'newUser.generateUserID', 'no') === 'yes') { + if (empty($userid) && $this->config->getAppValue('core', 'newUser.generateUserID', 'no') === 'yes') { $userid = $this->createNewUserId(); } @@ -352,7 +352,6 @@ class UsersController extends AUserData { } return new DataResponse(['id' => $userid]); - } catch (HintException $e) { $this->logger->logException($e, [ 'message' => 'Failed addUser attempt with hint exception.', @@ -414,7 +413,6 @@ class UsersController extends AUserData { $data['display-name'] = $data['displayname']; unset($data['displayname']); return new DataResponse($data); - } throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); @@ -530,7 +528,7 @@ class UsersController extends AUserData { throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); } // Process the edit - switch($key) { + switch ($key) { case 'display': case AccountManager::PROPERTY_DISPLAYNAME: $targetUser->setDisplayName($value); @@ -755,7 +753,6 @@ class UsersController extends AUserData { throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); } } - } /** @@ -835,7 +832,6 @@ class UsersController extends AUserData { // Not an admin, so the user must be a subadmin of this group, but that is not allowed. throw new OCSException('Cannot remove yourself from this group as you are a SubAdmin', 105); } - } elseif (!$this->groupManager->isAdmin($loggedInUser->getUID())) { /** @var IGroup[] $subAdminGroups */ $subAdminGroups = $subAdminManager->getSubAdminsGroups($loggedInUser); @@ -973,7 +969,7 @@ class UsersController extends AUserData { try { $emailTemplate = $this->newUserMailHelper->generateTemplate($targetUser, false); $this->newUserMailHelper->sendMail($targetUser, $emailTemplate); - } catch(\Exception $e) { + } catch (\Exception $e) { $this->logger->logException($e, [ 'message' => "Can't send new user mail to $email", 'level' => ILogger::ERROR, |