X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fexception%2FUserNotLoggedIn.php;h=f7a56b5091f61984db2bc9bce033ac1f52c3cc35;hb=e0af129cbdb7421b4d9d7858cc63125e12f35a4a;hp=9d89009100ac393038224b0289fc3a0b116be31b;hpb=166191535f486569277e95b7e6a3850b5db6757d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/UserNotLoggedIn.php b/includes/exception/UserNotLoggedIn.php index 9d89009100..f7a56b5091 100644 --- a/includes/exception/UserNotLoggedIn.php +++ b/includes/exception/UserNotLoggedIn.php @@ -62,4 +62,20 @@ class UserNotLoggedIn extends ErrorPageError { ) { parent::__construct( $titleMsg, $reasonMsg, $params ); } + + /** + * Redirect to Special:Userlogin + */ + public function report() { + $context = RequestContext::getMain(); + + $output = $context->getOutput(); + $output->redirect( SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( array( + // Return to this page when the user logs in + 'returnto' => $context->getTitle()->getText(), + 'returntoquery' => wfArrayToCgi( $context->getRequest()->getValues() ) + ) ) ); + + $output->output(); + } }