forked from 424D57/fbctf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRedirectException.php
57 lines (47 loc) · 1.34 KB
/
RedirectException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?hh // strict
class RedirectException extends Exception {
public function __construct(private string $path, private int $statusCode) {
parent::__construct();
}
public function getPath(): string {
return $this->path;
}
public function getStatusCode(): int {
return $this->statusCode;
}
}
class AdminRedirectException extends RedirectException {
public function __construct() {
parent::__construct('/index.php?p=admin', 302);
}
}
class IndexRedirectException extends RedirectException {
public function __construct() {
parent::__construct('/index.php', 302);
}
}
class RegistrationRedirectException extends RedirectException {
public function __construct() {
parent::__construct('/index.php?page=registration', 302);
}
}
class LoginRedirectException extends RedirectException {
public function __construct() {
parent::__construct('/index.php?page=login', 302);
}
}
class InternalErrorRedirectException extends RedirectException {
public function __construct() {
parent::__construct('/index.php?page=error', 500);
}
}
class NotFoundRedirectException extends RedirectException {
public function __construct() {
parent::__construct('/error.php', 404);
}
}
class GameRedirectException extends RedirectException {
public function __construct() {
parent::__construct('/index.php', 302);
}
}