3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
22 * Shows a generic "user is not logged in" error page.
24 * This is essentially an ErrorPageError exception which by default uses the
25 * 'exception-nologin' as a title and 'exception-nologin-text' for the message.
31 * if( $user->isAnon() ) {
32 * throw new UserNotLoggedIn();
36 * Note the parameter order differs from ErrorPageError, this allows you to
37 * simply specify a reason without overriding the default title.
41 * if( $user->isAnon() ) {
42 * throw new UserNotLoggedIn( 'action-require-loggedin' );
48 class UserNotLoggedIn
extends ErrorPageError
{
51 * @param string $reasonMsg A message key containing the reason for the error.
52 * Optional, default: 'exception-nologin-text'
53 * @param string $titleMsg A message key to set the page title.
54 * Optional, default: 'exception-nologin'
55 * @param array $params Parameters to wfMessage().
56 * Optional, default: array()
58 public function __construct(
59 $reasonMsg = 'exception-nologin-text',
60 $titleMsg = 'exception-nologin',
63 parent
::__construct( $titleMsg, $reasonMsg, $params );