[TASK] Re-work/simplify copyright header in PHP files - Part 3
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Error / Http / UnauthorizedException.php
1 <?php
2 namespace TYPO3\CMS\Core\Error\Http;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Exception for Error 401 - Unauthorized
18 *
19 * @author Steffen Gebert <steffen.gebert@typo3.org>
20 */
21 class UnauthorizedException extends AbstractClientErrorException {
22
23 /**
24 * @var array HTTP Status Header lines
25 */
26 protected $statusHeaders = array(\TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_401);
27
28 /**
29 * @var string Title of the message
30 */
31 protected $title = 'Unauthorized (401)';
32
33 /**
34 * @var string Error Message
35 */
36 protected $message = 'Accessing this page requires authorization.';
37
38 /**
39 * Constructor for this Status Exception
40 *
41 * @param string $message Error Message
42 * @param int $code Exception Code
43 */
44 public function __construct($message = NULL, $code = 0) {
45 if (!empty($message)) {
46 $this->message = $message;
47 }
48 parent::__construct($this->statusHeaders, $this->message, $this->title, $code);
49 }
50
51 }