1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ubiquity\controllers\auth; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* |
7
|
|
|
* Ubiquity\controllers\auth$AuthFiles |
8
|
|
|
* This class is part of Ubiquity |
9
|
|
|
* @author jc |
10
|
|
|
* @version 1.0.0 |
11
|
|
|
* |
12
|
|
|
*/ |
13
|
|
|
class AuthFiles { |
14
|
|
|
protected string $viewBase; |
15
|
|
|
|
16
|
2 |
|
public function __construct() { |
17
|
2 |
|
$this->viewBase = '@framework/auth'; |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* To override |
22
|
|
|
* The login view. |
23
|
|
|
* |
24
|
|
|
* @return string |
25
|
|
|
*/ |
26
|
1 |
|
public function getViewIndex(): string { |
27
|
1 |
|
return $this->viewBase . '/index.html'; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* To override |
32
|
|
|
* The info view, displays the connected user and a logout button. |
33
|
|
|
* |
34
|
|
|
* @return string |
35
|
|
|
*/ |
36
|
1 |
|
public function getViewInfo(): string { |
37
|
1 |
|
return $this->viewBase . '/info.html'; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* To override |
42
|
|
|
* Displays the form for a new account. |
43
|
|
|
* |
44
|
|
|
* @return string |
45
|
|
|
*/ |
46
|
1 |
|
public function getViewCreate(): string { |
47
|
1 |
|
return $this->viewBase . '/create.html'; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* To override |
52
|
|
|
* Displays the form for step two. |
53
|
|
|
* |
54
|
|
|
* @return string |
55
|
|
|
*/ |
56
|
|
|
public function getViewStepTwo(): string { |
57
|
|
|
return $this->viewBase . '/stepTwo.html'; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* To override |
62
|
|
|
* Displays the message if the 2FA code is bad. |
63
|
|
|
* |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
|
|
public function getViewBadTwoFACode(): string { |
67
|
|
|
return $this->viewBase . '/badTwoFACode.html'; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* To override |
72
|
|
|
* |
73
|
|
|
* @return string |
74
|
|
|
*/ |
75
|
1 |
|
public function getViewNoAccess(): string { |
76
|
1 |
|
return $this->viewBase . '/noAccess.html'; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Returns the base template for all Auth actions if getBaseTemplate return a base template filename. |
81
|
|
|
* |
82
|
|
|
* @return string |
83
|
|
|
*/ |
84
|
|
|
public function getViewBaseTemplate(): string { |
85
|
|
|
return $this->viewBase . '/baseTemplate.html'; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* To override |
90
|
|
|
* |
91
|
|
|
* @return string |
92
|
|
|
*/ |
93
|
|
|
public function getViewDisconnected(): string { |
94
|
|
|
return $this->viewBase . '/disconnected.html'; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* |
99
|
|
|
* @return string |
100
|
|
|
*/ |
101
|
1 |
|
public function getViewMessage(): string { |
102
|
1 |
|
return $this->viewBase . '/message.html'; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* To override |
107
|
|
|
* @return string |
108
|
|
|
*/ |
109
|
|
|
public function getViewInitRecovery(): string { |
110
|
|
|
return $this->viewBase . '/initRecovery.html'; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* To override |
115
|
|
|
* @return string |
116
|
|
|
*/ |
117
|
|
|
public function getViewRecovery(): string { |
118
|
|
|
return $this->viewBase . '/recovery.html'; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* To override |
123
|
|
|
* Returns the base template filename, default : null |
124
|
|
|
* @return string|null |
125
|
|
|
*/ |
126
|
2 |
|
public function getBaseTemplate() { |
127
|
2 |
|
return; |
128
|
|
|
} |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
|