Skip to content

Commit

Permalink
implement isRestrictedGuestAccessAllowed()
Browse files Browse the repository at this point in the history
  • Loading branch information
live627 committed Jan 6, 2025
1 parent c803cdd commit 57f506e
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 12 deletions.
10 changes: 10 additions & 0 deletions Sources/Actions/Activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/CoppaForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/HelpAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/Login2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/Reminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/SmStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
*
Expand Down
10 changes: 10 additions & 0 deletions Sources/Actions/VerificationCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
12 changes: 0 additions & 12 deletions Sources/Forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

/**
Expand Down

0 comments on commit 57f506e

Please sign in to comment.