From b8de551514d3f82eeb2f14f276141edd3c2198bc Mon Sep 17 00:00:00 2001 From: Tom Udding Date: Sun, 21 Jul 2024 21:44:32 +0200 Subject: [PATCH] fix: referrer for login not being GET parameter Quite bad for SEO, however, Google has not indexed the affected pages (ignored). Also fixes a flaw in the logic that could lead to a "recursion" due to consecutive failed login attempts. --- .../view/activity/activity/view.phtml | 12 ++-- module/Activity/view/partial/signupForm.phtml | 6 +- module/Application/view/error/403.phtml | 4 +- module/Application/view/partial/admin.phtml | 6 +- .../Application/view/partial/main-nav.phtml | 5 +- .../view/education/education/course.phtml | 6 +- .../view/frontpage/organ/organ.phtml | 3 +- module/User/config/module.config.php | 3 +- module/User/src/Controller/UserController.php | 61 ++++++------------- module/User/src/Form/CompanyUserLogin.php | 8 --- module/User/src/Form/UserLogin.php | 8 --- module/User/view/partial/login/company.phtml | 9 +-- module/User/view/partial/login/member.phtml | 10 +-- module/User/view/user/user/login.phtml | 17 +++++- 14 files changed, 60 insertions(+), 98 deletions(-) diff --git a/module/Activity/view/activity/activity/view.phtml b/module/Activity/view/activity/activity/view.phtml index aa90264154..857968877e 100644 --- a/module/Activity/view/activity/activity/view.phtml +++ b/module/Activity/view/activity/activity/view.phtml @@ -272,10 +272,8 @@ $this->headTitle($this->translate('Activities')); getOnlyGEWIS()): ?> translate('Log in to subscribe') ?> @@ -341,10 +339,8 @@ $this->headTitle($this->translate('Activities')); translate('Login to view the subscribed members.') ?> diff --git a/module/Activity/view/partial/signupForm.phtml b/module/Activity/view/partial/signupForm.phtml index 8f665a4ad1..d18ed22e68 100644 --- a/module/Activity/view/partial/signupForm.phtml +++ b/module/Activity/view/partial/signupForm.phtml @@ -129,10 +129,8 @@ function formElementRender( $this->translate('Do you have a GEWIS account? Log in to subscribe.'), $this->url( 'user/login', - [ - 'user_type' => 'member', - 'redirect_to' => base64_encode($this->serverUrl(true)), - ], + ['user_type' => 'member'], + ['query' => ['redirect_to' => base64_encode($this->serverUrl(true))]], ), ) ?> translate('Or subscribe without a GEWIS membership: ') ?> diff --git a/module/Application/view/error/403.phtml b/module/Application/view/error/403.phtml index e3dc88c6fc..7e322eb05c 100644 --- a/module/Application/view/error/403.phtml +++ b/module/Application/view/error/403.phtml @@ -21,8 +21,8 @@ use Laminas\View\Renderer\PhpRenderer; if ($this->identity() === null): ?>

translate('You might be able to view this page by logging in') ?>

translate('Login') ?> diff --git a/module/Application/view/partial/admin.phtml b/module/Application/view/partial/admin.phtml index 7e5881cbda..3694f5718e 100644 --- a/module/Application/view/partial/admin.phtml +++ b/module/Application/view/partial/admin.phtml @@ -26,10 +26,8 @@ use Laminas\View\Renderer\PhpRenderer;
  • translate('Login') ?> diff --git a/module/Application/view/partial/main-nav.phtml b/module/Application/view/partial/main-nav.phtml index e584837e7a..cc702be844 100644 --- a/module/Application/view/partial/main-nav.phtml +++ b/module/Application/view/partial/main-nav.phtml @@ -102,7 +102,10 @@ endif; ?>