Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/202062

Change subject: Add gather-anon-view-lists to valid login-error messages
......................................................................

Add gather-anon-view-lists to valid login-error messages

Allows to show error messages on the login page to explain the user, why
he/she need's to be logged in to view the page.

Bug: T94971
Change-Id: Ie76931678cab4bb98641c59ff09d3a2e563fed85
---
M Gather.php
M includes/Gather.hooks.php
2 files changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/62/202062/1

diff --git a/Gather.php b/Gather.php
index 43868c5..71c4fa3 100644
--- a/Gather.php
+++ b/Gather.php
@@ -81,6 +81,7 @@
 $wgHooks['ResourceLoaderTestModules'][] = 
'Gather\Hooks::onResourceLoaderTestModules';
 $wgHooks['EventLoggingRegisterSchemas'][] = 
'Gather\Hooks::onEventLoggingRegisterSchemas';
 $wgHooks['ResourceLoaderRegisterModules'][] = 
'Gather\Hooks::onResourceLoaderRegisterModules';
+$wgHooks['LoginFormValidErrorMessages'][] = 
'Gather\Hooks::onLoginFormValidErrorMessages';
 
 // Maintenance Hooks
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'Gather\UpdaterHooks::onLoadExtensionSchemaUpdates';
diff --git a/includes/Gather.hooks.php b/includes/Gather.hooks.php
index 87b8bc0..903c9e6 100644
--- a/includes/Gather.hooks.php
+++ b/includes/Gather.hooks.php
@@ -178,4 +178,16 @@
                }
                return true;
        }
+
+       /**
+        * LoginFormValidErrorMessages hook handler.
+        * Add valid error messages for Gather login pages.
+        *
+        * @see 
https://wwww.mediawiki.org/wiki/Manual:Hooks/LoginFormValidErrorMessages
+        *
+        * @param array $messages Array of valid messages, already added
+        */
+       public static function onLoginFormValidErrorMessages( &$messages ) {
+               $messages[] = 'gather-anon-view-lists';
+       }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/202062
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie76931678cab4bb98641c59ff09d3a2e563fed85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to