| Total Complexity | 16 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 7 | class Lockout extends Core { |
||
| 8 | |||
| 9 | public function unlock($username){ |
||
| 18 | } |
||
| 19 | public function isLocked($username){ |
||
| 20 | return $this->is_locked($username); |
||
| 21 | } |
||
| 22 | public function message(){ |
||
| 23 | return $this->showMessage(); |
||
| 24 | } |
||
| 25 | public function lock($username){ |
||
| 26 | if(is_array($username)){ |
||
| 27 | foreach($username as $key){ |
||
| 28 | $this->_lock($key); |
||
| 29 | } |
||
| 30 | } else{ |
||
| 31 | $this->_lock($username); |
||
| 32 | } |
||
| 33 | return true; |
||
| 34 | } |
||
| 35 | public function check($username) { |
||
| 36 | $ret = null; |
||
| 37 | if(is_array($username)){ |
||
| 38 | foreach($username as $key){ |
||
| 39 | $get = $this->_check($key); |
||
| 40 | if(!empty($get)){ |
||
| 41 | $ret[] = $get; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } else{ |
||
| 45 | $ret = $this->_check($username); |
||
| 46 | } |
||
| 47 | $ret = json_encode($ret); |
||
| 48 | return json_decode($ret); |
||
| 49 | } |
||
| 50 | public function clearLocked(){ |
||
| 51 | return $this->clear_all(); |
||
| 52 | } |
||
| 53 | |||
| 54 | private function _unlock($username){ |
||
| 55 | $this->unlock_account($username); |
||
| 56 | } |
||
| 57 | private function _lock($username){ |
||
| 59 | } |
||
| 60 | private function _check($username){ |
||
| 61 | return json_decode($this->check_account($username),true); |
||
| 62 | } |
||
| 63 | } |
||
| 64 |