From 57f506e7e80aa4746ff13f6d93a88e13c3bd898b Mon Sep 17 00:00:00 2001 From: John Rayes Date: Mon, 6 Jan 2025 12:01:29 -0700 Subject: [PATCH] implement isRestrictedGuestAccessAllowed() --- Sources/Actions/Activate.php | 10 ++++++++++ Sources/Actions/CoppaForm.php | 10 ++++++++++ Sources/Actions/Help.php | 10 ++++++++++ Sources/Actions/HelpAdmin.php | 10 ++++++++++ Sources/Actions/Login2.php | 10 ++++++++++ Sources/Actions/Register.php | 10 ++++++++++ Sources/Actions/Reminder.php | 10 ++++++++++ Sources/Actions/SmStats.php | 10 ++++++++++ Sources/Actions/VerificationCode.php | 10 ++++++++++ Sources/Forum.php | 12 ------------ 10 files changed, 90 insertions(+), 12 deletions(-) diff --git a/Sources/Actions/Activate.php b/Sources/Actions/Activate.php index 6e1b68f07c..7a54e832f9 100644 --- a/Sources/Actions/Activate.php +++ b/Sources/Actions/Activate.php @@ -65,6 +65,16 @@ class Activate implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Activates a user's account. * diff --git a/Sources/Actions/CoppaForm.php b/Sources/Actions/CoppaForm.php index 61e0869e7d..733536d574 100644 --- a/Sources/Actions/CoppaForm.php +++ b/Sources/Actions/CoppaForm.php @@ -37,6 +37,16 @@ class CoppaForm implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Display the contact information for the forum, as well a form to fill in. */ diff --git a/Sources/Actions/Help.php b/Sources/Actions/Help.php index 327e023897..fae2894aa1 100644 --- a/Sources/Actions/Help.php +++ b/Sources/Actions/Help.php @@ -61,6 +61,16 @@ class Help implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Dispatcher to whichever sub-action method is necessary. */ diff --git a/Sources/Actions/HelpAdmin.php b/Sources/Actions/HelpAdmin.php index a7c3d2d67a..26e542a169 100644 --- a/Sources/Actions/HelpAdmin.php +++ b/Sources/Actions/HelpAdmin.php @@ -37,6 +37,16 @@ class HelpAdmin implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Show some of the more detailed help to give the admin an idea... * It shows a popup for administrative or user help. diff --git a/Sources/Actions/Login2.php b/Sources/Actions/Login2.php index 630928f721..8dba6d7b35 100644 --- a/Sources/Actions/Login2.php +++ b/Sources/Actions/Login2.php @@ -68,6 +68,16 @@ class Login2 implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Actually logs you in. * diff --git a/Sources/Actions/Register.php b/Sources/Actions/Register.php index dd5ba1becd..f85d7806e4 100644 --- a/Sources/Actions/Register.php +++ b/Sources/Actions/Register.php @@ -71,6 +71,16 @@ class Register implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Dispatcher to whichever sub-action method is necessary. */ diff --git a/Sources/Actions/Reminder.php b/Sources/Actions/Reminder.php index 32f8cc4ba1..1be440bcae 100644 --- a/Sources/Actions/Reminder.php +++ b/Sources/Actions/Reminder.php @@ -79,6 +79,16 @@ class Reminder implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Dispatcher to whichever sub-action method is necessary. */ diff --git a/Sources/Actions/SmStats.php b/Sources/Actions/SmStats.php index 4368b4c45d..28fc6edbca 100644 --- a/Sources/Actions/SmStats.php +++ b/Sources/Actions/SmStats.php @@ -32,6 +32,16 @@ class SmStats implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Sends stats to simplemachines.org when requested, but only if enabled! * diff --git a/Sources/Actions/VerificationCode.php b/Sources/Actions/VerificationCode.php index 2db752371b..f0ffb967e2 100644 --- a/Sources/Actions/VerificationCode.php +++ b/Sources/Actions/VerificationCode.php @@ -55,6 +55,16 @@ class VerificationCode implements ActionInterface * Public methods ****************/ + /** + * Determines whether this action allows access if guest access is restricted. + * + * @return bool True if access is allowed, false otherwise. + */ + public function isRestrictedGuestAccessAllowed(): bool + { + return true; + } + /** * Do the job. */ diff --git a/Sources/Forum.php b/Sources/Forum.php index 36cdc5208c..975b083d43 100644 --- a/Sources/Forum.php +++ b/Sources/Forum.php @@ -172,18 +172,6 @@ class Forum * This allows users to log in when guest access is disabled. */ public static $guest_access_actions = [ - 'coppa', - 'login', - 'login2', - 'logintfa', - 'reminder', - 'activate', - 'help', - 'helpadmin', - 'smstats', - 'verificationcode', - 'signup', - 'signup2', ]; /**