diff --git a/core/Application.php b/core/Application.php index 8b12fcc9d25a..e791b1fcdc58 100644 --- a/core/Application.php +++ b/core/Application.php @@ -40,7 +40,6 @@ use OC\Core\Controller\RolesController; use OC\Core\Controller\TokenController; use OC\Core\Controller\TwoFactorChallengeController; -use OC\Core\Controller\UserController; use OC\Core\Controller\UserSyncController; use OC\User\AccountMapper; use OC\User\SyncService; @@ -100,14 +99,6 @@ public function __construct(array $urlParams= []) { $c->query('UserSession') ); }); - $container->registerService('UserController', static function (SimpleContainer $c) { - return new UserController( - $c->query('AppName'), - $c->query('Request'), - $c->query('UserManager'), - $c->query('Defaults') - ); - }); $container->registerService('AvatarController', static function (SimpleContainer $c) { /** @var IServerContainer $server */ $server = $c->query('ServerContainer'); diff --git a/core/Controller/UserController.php b/core/Controller/UserController.php deleted file mode 100644 index 02e3a690f2a7..000000000000 --- a/core/Controller/UserController.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @author Morris Jobke - * @author Thomas Müller - * - * @copyright Copyright (c) 2018, ownCloud GmbH - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace OC\Core\Controller; - -use \OCP\AppFramework\Controller; -use \OCP\AppFramework\Http\JSONResponse; -use \OCP\IRequest; - -class UserController extends Controller { - /** - * @var \OCP\IUserManager - */ - protected $userManager; - - /** - * @var \OC_Defaults - */ - protected $defaults; - - public function __construct( - $appName, - IRequest $request, - $userManager, - $defaults - ) { - parent::__construct($appName, $request); - $this->userManager = $userManager; - $this->defaults = $defaults; - } - - /** - * Lookup user display names - * - * @NoAdminRequired - * - * @param array $users - * - * @return JSONResponse - */ - public function getDisplayNames($users) { - $result = []; - - foreach ($users as $user) { - $userObject = $this->userManager->get($user); - if (\is_object($userObject)) { - $result[$user] = $userObject->getDisplayName(); - } else { - $result[$user] = $user; - } - } - - $json = [ - 'users' => $result, - 'status' => 'success' - ]; - - return new JSONResponse($json); - } -} diff --git a/core/routes.php b/core/routes.php index d46c5c314f84..b381a64ae4cc 100644 --- a/core/routes.php +++ b/core/routes.php @@ -37,7 +37,6 @@ ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'], ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'], ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'], - ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'], ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'], ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'], ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'],