Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License |
6 | * as published by the Free Software Foundation; under version 2 |
7 | * of the License (non-upgradable). |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * |
18 | * Copyright (c) 2018 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
19 | */ |
20 | |
21 | namespace oat\tao\model\user; |
22 | |
23 | /** |
24 | * Describes interface for user lockouts storage implementations |
25 | * Interface Lockout |
26 | * @package oat\tao\model\user |
27 | */ |
28 | interface LockoutStorage |
29 | { |
30 | /** |
31 | * Returns actual status of the user. Null if no any locks |
32 | * @param $login |
33 | * @return mixed |
34 | */ |
35 | public function getStatus($login); |
36 | |
37 | /** |
38 | * Moves user account to locked state. Also writes who locked the user |
39 | * @param $login string Username of user which should be blocked |
40 | * @param $by string Identifier of user who blocked |
41 | * @return mixed |
42 | */ |
43 | public function setLockedStatus($login, $by); |
44 | |
45 | /** |
46 | * Removes all records about user locking |
47 | * @param $login |
48 | * @return mixed |
49 | */ |
50 | public function setUnlockedStatus($login); |
51 | |
52 | /** |
53 | * Returns count of failed login attempts |
54 | * @param $login |
55 | * @return mixed |
56 | */ |
57 | public function getFailures($login); |
58 | |
59 | /** |
60 | * Writes actual value of login failures to user |
61 | * @param $login |
62 | * @param $value |
63 | * @return mixed |
64 | */ |
65 | public function setFailures($login, $value); |
66 | |
67 | /** |
68 | * Returns time when last failed login happened |
69 | * @param $login |
70 | * @return mixed |
71 | */ |
72 | public function getLastFailureTime($login); |
73 | |
74 | /** |
75 | * Returns by who user was blocked |
76 | * @param $login |
77 | * @return mixed |
78 | */ |
79 | public function getLockedBy($login); |
80 | } |