1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ubiquity\controllers\auth; |
4
|
|
|
|
5
|
|
|
use Ubiquity\utils\flash\FlashMessage; |
6
|
|
|
|
7
|
|
|
trait AuthControllerVariablesTrait { |
8
|
|
|
/** |
9
|
|
|
* Override for modifying the noAccess message |
10
|
|
|
* @param FlashMessage $fMessage |
11
|
|
|
*/ |
12
|
1 |
|
protected function noAccessMessage(FlashMessage $fMessage){ |
13
|
|
|
|
14
|
1 |
|
} |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Override for modifying attempts message |
18
|
|
|
* You can use {_timer} and {_attemptsCount} variables in message content |
19
|
|
|
* @param FlashMessage $fMessage |
20
|
|
|
* @param int $attempsCount |
21
|
|
|
*/ |
22
|
|
|
protected function attemptsNumberMessage(FlashMessage $fMessage,$attempsCount){ |
23
|
|
|
|
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* To override for modifying the bad login message |
28
|
|
|
* @param FlashMessage $fMessage |
29
|
|
|
*/ |
30
|
1 |
|
protected function badLoginMessage(FlashMessage $fMessage){ |
31
|
|
|
|
32
|
1 |
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* To override for modifying the logout message |
36
|
|
|
* @param FlashMessage $fMessage |
37
|
|
|
*/ |
38
|
1 |
|
protected function terminateMessage(FlashMessage $fMessage){ |
39
|
|
|
|
40
|
1 |
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* To override for modifying the disconnect message |
44
|
|
|
* @param FlashMessage $fMessage |
45
|
|
|
*/ |
46
|
|
|
protected function disconnectedMessage(FlashMessage $fMessage){ |
47
|
|
|
|
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* To override |
52
|
|
|
* Returns the maximum number of allowed login attempts |
53
|
|
|
*/ |
54
|
1 |
|
protected function attemptsNumber(){ |
55
|
1 |
|
return; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* To override |
60
|
|
|
* Returns the time before trying to connect again |
61
|
|
|
* Effective only if attemptsNumber return a number |
62
|
|
|
* @return number |
63
|
|
|
*/ |
64
|
|
|
protected function attemptsTimeout(){ |
65
|
|
|
return 3*60; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Override to define if info is displayed as string |
70
|
|
|
* if set to true, use _infoUser var in views to display user info |
71
|
|
|
*/ |
72
|
1 |
|
public function _displayInfoAsString(){ |
73
|
1 |
|
return false; |
74
|
|
|
} |
75
|
|
|
|
76
|
1 |
|
public function _checkConnectionTimeout(){ |
77
|
1 |
|
return; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function _getLoginInputName(){ |
81
|
|
|
return "email"; |
82
|
|
|
} |
83
|
|
|
|
84
|
1 |
|
protected function loginLabel(){ |
85
|
1 |
|
return ucfirst($this->_getLoginInputName()); |
86
|
|
|
} |
87
|
|
|
|
88
|
1 |
|
public function _getPasswordInputName(){ |
89
|
1 |
|
return "password"; |
90
|
|
|
} |
91
|
|
|
|
92
|
1 |
|
protected function passwordLabel(){ |
93
|
1 |
|
return ucfirst($this->_getPasswordInputName()); |
94
|
|
|
} |
95
|
|
|
|
96
|
1 |
|
public function _getBodySelector(){ |
97
|
1 |
|
return "body"; |
98
|
|
|
} |
99
|
|
|
|
100
|
1 |
|
protected function rememberCaption(){ |
101
|
1 |
|
return "Remember me"; |
102
|
|
|
} |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
|