Page MenuHomePhabricator

create exception for non logged in user
Closed, ResolvedPublic

Description

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

Details

Reference
bz37627

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:26 AM
bzimport set Reference to bz37627.
bzimport added a subscriber: Unknown Object (MLST).

Change got merged:

RELEASE-NOTE-1.20:

  • UserNotLoggedIn() exception to show a generic error page whenever a user is not logged in