Completed
Push — master ( ae286a...b99700 )
by Jean-Christophe
01:39
created

AuthControllerVariablesTrait::attemptsNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
	protected function noAccessMessage(FlashMessage $fMessage){
13
		
14
	}
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
	protected function badLoginMessage(FlashMessage $fMessage){
31
		
32
	}
33
	
34
	/**
35
	 * To override for modifying the logout message
36
	 * @param FlashMessage $fMessage
37
	 */
38
	protected function terminateMessage(FlashMessage $fMessage){
39
		
40
	}
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
	protected function attemptsNumber(){
55
		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
	public function _displayInfoAsString(){
73
		return false;
74
	}
75
	
76
	public function _checkConnectionTimeout(){
77
		return;
78
	}
79
	
80
	public function _getLoginInputName(){
81
		return "email";
82
	}
83
	
84
	protected function loginLabel(){
85
		return ucfirst($this->_getLoginInputName());
86
	}
87
	
88
	public function _getPasswordInputName(){
89
		return "password";
90
	}
91
	
92
	protected function passwordLabel(){
93
		return ucfirst($this->_getPasswordInputName());
94
	}
95
	
96
	public function _getBodySelector(){
97
		return "body";
98
	}
99
	
100
	protected function rememberCaption(){
101
		return "Remember me";
102
	}
103
}
104
105