aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/lib/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/lib/Controller')
-rw-r--r--apps/comments/lib/Controller/NotificationsController.php33
1 files changed, 8 insertions, 25 deletions
diff --git a/apps/comments/lib/Controller/NotificationsController.php b/apps/comments/lib/Controller/NotificationsController.php
index 1e1f0e563e2..0937b6929b8 100644
--- a/apps/comments/lib/Controller/NotificationsController.php
+++ b/apps/comments/lib/Controller/NotificationsController.php
@@ -1,32 +1,16 @@
<?php
+
/**
- * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * 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
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Comments\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\Attribute\OpenAPI;
+use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\Comments\IComment;
@@ -50,15 +34,12 @@ class NotificationsController extends Controller {
protected IRootFolder $rootFolder,
protected IURLGenerator $urlGenerator,
protected IManager $notificationManager,
- protected IUserSession $userSession
+ protected IUserSession $userSession,
) {
parent::__construct($appName, $request);
}
/**
- * @PublicPage
- * @NoCSRFRequired
- *
* View a notification
*
* @param string $id ID of the notification
@@ -68,6 +49,8 @@ class NotificationsController extends Controller {
* 303: Redirected to notification
* 404: Notification not found
*/
+ #[PublicPage]
+ #[NoCSRFRequired]
public function view(string $id): RedirectResponse|NotFoundResponse {
$currentUser = $this->userSession->getUser();
if (!$currentUser instanceof IUser) {