* (bug 23427) New magic word {{PAGEID}} which gives the current page ID.
Will be null on previewing a page being created.
* Added ContribsPager::reallyDoQuery hook allowing extensions to data to MyContribs
+* (bug 37627) UserNotLoggedIn() exception to show a generic error page whenever
+ a user is not logged in.
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
}
}
+/**
+ * Shows a generic "user is not logged in" error page.
+ *
+ * This is essentially an ErrorPageError exception which by default use the
+ * 'exception-nologin' as a title and 'exception-nologin-text' for the message.
+ * @see bug 37627
+ *
+ * @par Example:
+ * @code
+ * if( $user->isAnon ) {
+ * throw new UserNotLoggedIn();
+ * }
+ * @endcode
+ *
+ * Please note the parameters are mixed up compared to ErrorPageError, this
+ * is done to be able to simply specify a reason whitout overriding the default
+ * title.
+ *
+ * @par Example:
+ * @code
+ * if( $user->isAnon ) {
+ * throw new UserNotLoggedIn( 'action-require-loggedin' );
+ * }
+ * @endcode
+ *
+ * @param $reasonMsg A message key containing the reason for the error.
+ * Optional, default: 'exception-nologin-text'
+ * @param $titleMsg A message key to set the page title.
+ * Optional, default: 'exception-nologin'
+ * @param $params Parameters to wfMsg().
+ * Optiona, default: null
+ */
+class UserNotLoggedIn extends ErrorPageError {
+
+ public function __construct(
+ $reasonMsg = 'exception-nologin-text',
+ $titleMsg = 'exception-nologin',
+ $params = null
+ ) {
+ parent::__construct( $titleMsg, $reasonMsg, $params );
+ }
+}
+
/**
* Show an error that looks like an HTTP server error.
* Replacement for wfHttpError().
Please choose a different name.',
'loginerror' => 'Login error',
'createaccounterror' => 'Could not create account: $1',
+'exception-nologin' => 'Not logged in.',
+'exception-nologin-text' => 'This page or action requires you to be logged in on this wiki.',
'nocookiesnew' => 'The user account was created, but you are not logged in.
{{SITENAME}} uses cookies to log in users.
You have cookies disabled.
'createaccountreason' => '{{Identical|Reason}}',
'createaccounterror' => 'Parameters:
* $1 is an error message',
+'exception-nologin' => 'Generic page title used on error page when a user is not logged in. Message used by the UserNotLoggedIn exception.',
+'exception-nologin-text' => 'Generic reason displayed on error page when a user is not logged in. Message used by the UserNotLoggedIn exception.',
'nocookiesnew' => "This message is displayed when a new account was successfully created, but the browser doesn't accept cookies.",
'nocookieslogin' => "This message is displayed when someone tried to login, but the browser doesn't accept cookies.",
'nocookiesfornew' => "This message is displayed when the user tried to create a new account, but it failed the cross-site request forgery (CSRF) check. It could be blocking an attack, but most likely, the browser isn't accepting cookies.",
'filereadonlyerror',
'invalidtitle-knownnamespace',
'invalidtitle-unknownnamespace',
+ 'exception-nologin',
+ 'exception-nologin-text',
),
'virus' => array(
'virus-badscanner',