Merge "Allow configuration of periodic task interval"
[lhc/web/wiklou.git] / includes / exception / UserNotLoggedIn.php
1 <?php
2 /**
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.
7 *
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.
12 *
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
17 *
18 * @file
19 */
20
21 /**
22 * Shows a generic "user is not logged in" error page.
23 *
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.
26 * @see bug 37627
27 * @since 1.20
28 *
29 * @par Example:
30 * @code
31 * if( $user->isAnon() ) {
32 * throw new UserNotLoggedIn();
33 * }
34 * @endcode
35 *
36 * Note the parameter order differs from ErrorPageError, this allows you to
37 * simply specify a reason without overriding the default title.
38 *
39 * @par Example:
40 * @code
41 * if( $user->isAnon() ) {
42 * throw new UserNotLoggedIn( 'action-require-loggedin' );
43 * }
44 * @endcode
45 *
46 * @ingroup Exception
47 */
48 class UserNotLoggedIn extends ErrorPageError {
49
50 /**
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()
57 */
58 public function __construct(
59 $reasonMsg = 'exception-nologin-text',
60 $titleMsg = 'exception-nologin',
61 $params = array()
62 ) {
63 parent::__construct( $titleMsg, $reasonMsg, $params );
64 }
65 }