Link notifications for new users to the frontend user profile
authorMarcel Werk <burntime@woltlab.com>
Wed, 8 Jan 2025 14:05:43 +0000 (15:05 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 8 Jan 2025 14:05:43 +0000 (15:05 +0100)
Typically, notifications are viewed in the frontend and the admin can also perform administrative actions from the frontend user profile.

wcfsetup/install/files/lib/system/user/notification/event/UserNeedActivationUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserRegistrationSuccessUserNotificationEvent.class.php

index fcd1423d9454f082179596ec53e741cd0f4b2992..3a19427e61624b85edb7e03429d3a0ca49ec8819 100644 (file)
@@ -3,6 +3,7 @@
 namespace wcf\system\user\notification\event;
 
 use wcf\data\user\UserProfile;
+use wcf\page\UserPage;
 use wcf\system\request\LinkHandler;
 use wcf\system\user\notification\object\UserRegistrationUserNotificationObject;
 
@@ -64,9 +65,8 @@ class UserNeedActivationUserNotificationEvent extends AbstractUserNotificationEv
     #[\Override]
     public function getLink(): string
     {
-        return LinkHandler::getInstance()->getLink('UserEdit', [
+        return LinkHandler::getInstance()->getControllerLink(UserPage::class, [
             'object' => $this->getUserNotificationObject(),
-            'isACP' => true,
         ]);
     }
 
index 588bcb08479f538b77e55715e35b9592b8733712..f102d32bf0710b58f1bb6403b33f22e22e91f09c 100644 (file)
@@ -3,6 +3,7 @@
 namespace wcf\system\user\notification\event;
 
 use wcf\data\user\UserProfile;
+use wcf\page\UserPage;
 use wcf\system\request\LinkHandler;
 use wcf\system\user\notification\object\UserRegistrationUserNotificationObject;
 
@@ -55,7 +56,7 @@ class UserRegistrationSuccessUserNotificationEvent extends AbstractUserNotificat
             'application' => 'wcf',
             'variables' => [
                 'notification' => $this->notification,
-                   'username' => $this->getUserNotificationObject()->username,
+                'username' => $this->getUserNotificationObject()->username,
                 'userNotificationObject' => $this->getUserNotificationObject(),
             ],
         ];
@@ -64,9 +65,8 @@ class UserRegistrationSuccessUserNotificationEvent extends AbstractUserNotificat
     #[\Override]
     public function getLink(): string
     {
-        return LinkHandler::getInstance()->getLink('UserEdit', [
+        return LinkHandler::getInstance()->getControllerLink(UserPage::class, [
             'object' => $this->getUserNotificationObject(),
-            'isACP' => true,
         ]);
     }