Apparently, the natural place for this would be in OutputPage :: showPermissionsErrorPage () . In particular, the actual error message is displayed in the following two lines:
$this->prepareErrorPage( $this->msg( 'loginreqtitle' ) ); $this->addHTML( $this->msg( $msg )->rawParams( $loginLink )->parse() );
To redirect directly to Special: UserLogin, you can replace them with something like this (unverified!) Code:
$this->redirect( SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( $query ) );
Alas, there seems to be no convenient hook that allows you to do this from the extension, so it seems like you have to resort to fixing the code. This looks like a natural place for a hook, so it might not be a bad idea to write down a function request to add such a hook.
(Alternatively, you can actually bring the login form into place, but it can be a little more difficult to implement than just redirecting to Special: UserLogin. At first glance, I could not find a convenient method "outputLoginForm ()" for calling Special: UserLogin code , and while itβs actually not difficult to create an appropriate login form yourself, this means that any subsequent changes to the form may violate compatibility.)
Ilmari karonen
source share