We have several special pages checking if the user is not logged in and then craft their own error page.
A recent change in an extension adds yet another implementation:
https://gerrit.wikimedia.org/r/#/c/11169/
https://gerrit.wikimedia.org/r/#/c/11169/1/special/SpecialOATH.php,unified
We would need a generic exception to be thrown whenever the user is anonymous. So we could just:
if ( $this->getUser()->isAnon() ) {
throw new NeedLogguedInError( );
}
With a nice default message such as: "Sorry the action or page you requested is restricted to logged in users".
Version: 1.20.x
Severity: normal