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