diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/index.php b/index.php index cb9f4d460bd..b368462371d 100644 --- a/index.php +++ b/index.php @@ -3,34 +3,9 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Côme Chilliet <come.chilliet@nextcloud.com> - * @author Joas Schilling <coding@schilljs.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <robin@icewind.nl> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author Sergio Bertolín <sbertolin@solidgear.es> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <vincent@nextcloud.com> - * - * @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 <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ require_once __DIR__ . '/lib/versioncheck.php'; @@ -41,6 +16,7 @@ use OCP\HintException; use OCP\IRequest; use OCP\Security\Bruteforce\MaxDelayReached; use OCP\Server; +use OCP\Template\ITemplateManager; use Psr\Log\LoggerInterface; try { @@ -54,10 +30,10 @@ try { ]); //show the user a detailed error page - OC_Template::printExceptionErrorPage($ex, 503); + Server::get(ITemplateManager::class)->printExceptionErrorPage($ex, 503); } catch (HintException $ex) { try { - OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503); + Server::get(ITemplateManager::class)->printErrorPage($ex->getMessage(), $ex->getHint(), 503); } catch (Exception $ex2) { try { Server::get(LoggerInterface::class)->error($ex->getMessage(), [ @@ -73,7 +49,7 @@ try { } //show the user a detailed error page - OC_Template::printExceptionErrorPage($ex, 500); + Server::get(ITemplateManager::class)->printExceptionErrorPage($ex, 500); } } catch (LoginException $ex) { $request = Server::get(IRequest::class); @@ -88,7 +64,7 @@ try { echo json_encode(['message' => $ex->getMessage()]); exit(); } - OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 401); + Server::get(ITemplateManager::class)->printErrorPage($ex->getMessage(), $ex->getMessage(), 401); } catch (MaxDelayReached $ex) { $request = Server::get(IRequest::class); /** @@ -103,7 +79,7 @@ try { exit(); } http_response_code(429); - OC_Template::printGuestPage('core', '429'); + Server::get(ITemplateManager::class)->printGuestPage('core', '429'); } catch (Exception $ex) { Server::get(LoggerInterface::class)->error($ex->getMessage(), [ 'app' => 'index', @@ -111,7 +87,7 @@ try { ]); //show the user a detailed error page - OC_Template::printExceptionErrorPage($ex, 500); + Server::get(ITemplateManager::class)->printExceptionErrorPage($ex, 500); } catch (Error $ex) { try { Server::get(LoggerInterface::class)->error($ex->getMessage(), [ @@ -128,5 +104,5 @@ try { throw $ex; } - OC_Template::printExceptionErrorPage($ex, 500); + Server::get(ITemplateManager::class)->printExceptionErrorPage($ex, 500); } |