Passed
Push — master ( 7d615b...d4db62 )
by Jean-Christophe
09:33
created

_getPasswordInputName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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