@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | $conf = config('irfa.lockout'); |
| 57 | 57 | |
| 58 | 58 | $this->line('<fg=default>-------------------------------------------------------------------------------'); |
| 59 | - $this->line('<fg=yellow>Commands'); |
|
| 60 | - $table = new Table($this->output); |
|
| 59 | + $this->line('<fg=yellow>Commands'); |
|
| 60 | + $table = new Table($this->output); |
|
| 61 | 61 | $table->setRows([ |
| 62 | 62 | ['<fg=cyan>php artisan lockout:lock {username}','<fg=default>locking account'], |
| 63 | 63 | ['<fg=cyan>php artisan lockout:unlock {username}','<fg=default>unlocking account'], |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | ['<fg=cyan>php artisan lockout:is-locked {username}','<fg=default>checking account (return boolean)'], |
| 66 | 66 | ['<fg=cyan>php artisan lockout:clear','<fg=default>unlocking all account']] |
| 67 | 67 | ); |
| 68 | - $table->render(); |
|
| 69 | - $this->line('<fg=default>-------------------------------------------------------------------------------'); |
|
| 68 | + $table->render(); |
|
| 69 | + $this->line('<fg=default>-------------------------------------------------------------------------------'); |
|
| 70 | 70 | $this->line('<fg=yellow>Configuration'); |
| 71 | 71 | foreach($conf as $key => $val){ |
| 72 | 72 | if(is_array($val)){ |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $row[] = ['<fg=default>'.$key,' <fg=cyan>'.$vl]; |
| 80 | 80 | } |
| 81 | 81 | // dd($row); |
| 82 | - $table = new Table($this->output); |
|
| 82 | + $table = new Table($this->output); |
|
| 83 | 83 | $table->setRows($row); |
| 84 | 84 | $table->render(); |
| 85 | 85 | } |
@@ -45,13 +45,13 @@ |
||
| 45 | 45 | if($lock){ |
| 46 | 46 | $table->setRows([ |
| 47 | 47 | ['<fg=yellow>'.$username.' is locked',]]); |
| 48 | - $table->render(); |
|
| 48 | + $table->render(); |
|
| 49 | 49 | $this->line('<fg=default>Run <fg=cyan>php artisan lockout:unlock '.$username.'<fg=default> to unlock account.'); |
| 50 | 50 | } else{ |
| 51 | - $table->setRows([ |
|
| 51 | + $table->setRows([ |
|
| 52 | 52 | ['<fg=green>'.$username.' is unlocked',]]); |
| 53 | - $table->render(); |
|
| 54 | - $this->line('<fg=default>Run <fg=cyan>php artisan lockout:lock '.$username.'<fg=default> to lock account.'); |
|
| 53 | + $table->render(); |
|
| 54 | + $this->line('<fg=default>Run <fg=cyan>php artisan lockout:lock '.$username.'<fg=default> to lock account.'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // $this->line('<fg=yellow>Valid input is lock, unlock, and attemps.'); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $content = ['username' => $input,'attemps' => $login_fail,'ip' => isset($ip_list)?$ip_list:[$ip],'last_attemps' => date("Y-m-d H:i:s",time())]; |
| 40 | 40 | File::put($path,json_encode($content)); |
| 41 | 41 | if(File::exists($path)){ |
| 42 | - chmod($path,0750); |
|
| 42 | + chmod($path,0750); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | } |
@@ -59,12 +59,12 @@ discard block |
||
| 59 | 59 | $path = $dir.md5($username); |
| 60 | 60 | if(File::exists($path)) |
| 61 | 61 | { |
| 62 | - $get = json_decode(File::get($path)); |
|
| 63 | - if($get->attemps > $attemps || $get->attemps == "lock"){ |
|
| 64 | - return true; |
|
| 65 | - } else{ |
|
| 66 | - return false; |
|
| 67 | - } |
|
| 62 | + $get = json_decode(File::get($path)); |
|
| 63 | + if($get->attemps > $attemps || $get->attemps == "lock"){ |
|
| 64 | + return true; |
|
| 65 | + } else{ |
|
| 66 | + return false; |
|
| 67 | + } |
|
| 68 | 68 | } else{ |
| 69 | 69 | return false; |
| 70 | 70 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $content = ['username' => $input,'attemps' => $login_fail,'ip' => isset($ip_list)?$ip_list:[$ip],'last_attemps' => date("Y-m-d H:i:s",time())]; |
| 190 | 190 | File::put($path,json_encode($content)); |
| 191 | 191 | if(File::exists($path)){ |
| 192 | - chmod($path,0750); |
|
| 192 | + chmod($path,0750); |
|
| 193 | 193 | } |
| 194 | 194 | if(php_sapi_name() == "cli"){ |
| 195 | 195 | return Lang::get('lockoutMessage.user_lock_success')."\n"; |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | } |
| 17 | 17 | return true; |
| 18 | 18 | } |
| 19 | - public function isLocked($username){ |
|
| 20 | - return $this->is_locked($username); |
|
| 21 | - } |
|
| 19 | + public function isLocked($username){ |
|
| 20 | + return $this->is_locked($username); |
|
| 21 | + } |
|
| 22 | 22 | public function message(){ |
| 23 | 23 | return $this->showMessage(); |
| 24 | 24 | } |