Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 9
CRAP
0.00% covered (danger)
0.00%
0 / 1
NoUserLocksService
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 9
90
0.00% covered (danger)
0.00%
0 / 1
 catchFailedLogin
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 catchSucceedLogin
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 lockUser
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 unlockUser
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isLocked
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isLockable
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getLockoutRemainingAttempts
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStatusDetails
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 getLockoutRemainingTime
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
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
21namespace oat\tao\model\user\implementation;
22
23use oat\oatbox\service\ConfigurableService;
24use oat\oatbox\user\User;
25use oat\tao\model\event\LoginFailedEvent;
26use oat\tao\model\event\LoginSucceedEvent;
27use oat\tao\model\user\UserLocks;
28
29/**
30 * Class NoUserLocksService
31 * @package oat\tao\model\user
32 */
33class NoUserLocksService extends ConfigurableService implements UserLocks
34{
35    /**
36     * @param LoginFailedEvent $event
37     */
38    public function catchFailedLogin(LoginFailedEvent $event)
39    {
40        // do nothing
41    }
42
43    /**
44     * @param LoginSucceedEvent $event
45     */
46    public function catchSucceedLogin(LoginSucceedEvent $event)
47    {
48        // do nothing
49    }
50
51    /**
52     * @param $user
53     * @return bool
54     */
55    public function lockUser(User $user)
56    {
57        return true;
58    }
59
60    /**
61     * @param $user
62     * @return bool
63     */
64    public function unlockUser(User $user)
65    {
66        return true;
67    }
68
69    /**
70     * @param $login
71     * @return bool
72     * @throws \Exception
73     */
74    public function isLocked($login)
75    {
76        return false;
77    }
78
79    /**
80     * @param $user
81     * @return bool|mixed
82     */
83    public function isLockable(User $user)
84    {
85        return false;
86    }
87
88    /**
89     * @param $login
90     * @return bool|int|mixed
91     */
92    public function getLockoutRemainingAttempts($login)
93    {
94        return false;
95    }
96
97    /**
98     * @param $login
99     * @return array
100     * @throws \Exception
101     */
102    public function getStatusDetails($login)
103    {
104        return [
105            'locked' => false,
106            'auto' => false,
107            'status' => __('enabled'),
108            'remaining' => null,
109            'lockable' => false
110        ];
111    }
112
113    /**
114     * @param $login
115     * @return mixed
116     */
117    public function getLockoutRemainingTime($login)
118    {
119        return false;
120    }
121}