@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function handle() |
| 45 | 45 | { |
| 46 | - $curTime = microtime(true); |
|
| 46 | + $curTime = microtime(true); |
|
| 47 | 47 | $domain = 'locktest-'.md5(strtolower(config("app.name"))).'@'.strtolower(config("app.name")).".com"; |
| 48 | - $this->line('<fg=default>--------------------------------------------'); |
|
| 48 | + $this->line('<fg=default>--------------------------------------------'); |
|
| 49 | 49 | $this->testConfigurations(); |
| 50 | 50 | $this->line('<fg=default>Testing Mail : <fg=cyan>'.$domain); |
| 51 | 51 | $this->testWrite($domain); |
@@ -60,54 +60,54 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | private function testWrite($domain){ |
| 62 | 62 | $test = new Testing(); |
| 63 | - if( $test->testWriteEventFailedLogin($domain) AND $test->testWritable($domain)){ |
|
| 64 | - $this->line('<fg=default>Auto Lock : <fg=green>OK'); |
|
| 63 | + if( $test->testWriteEventFailedLogin($domain) AND $test->testWritable($domain)){ |
|
| 64 | + $this->line('<fg=default>Auto Lock : <fg=green>OK'); |
|
| 65 | 65 | } elseif(!$test->testWritable($domain)){ |
| 66 | 66 | $this->success += 1; |
| 67 | 67 | $this->line('<fg=default>Auto Lock : <fg=yellow>Warning (Permission denied)'); |
| 68 | 68 | } else{ |
| 69 | 69 | $this->error += 1; |
| 70 | - $this->line('<fg=default>Auto Lock : <fg=red>Failed'); |
|
| 70 | + $this->line('<fg=default>Auto Lock : <fg=red>Failed'); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | private function testManualLock($domain){ |
| 74 | 74 | $test = new Testing(); |
| 75 | - if( $test->testManualLocking($domain)){ |
|
| 75 | + if( $test->testManualLocking($domain)){ |
|
| 76 | 76 | $this->success += 1; |
| 77 | - $this->line('<fg=default>Manual Lock : <fg=green>OK'); |
|
| 77 | + $this->line('<fg=default>Manual Lock : <fg=green>OK'); |
|
| 78 | 78 | } else{ |
| 79 | 79 | $this->error += 1; |
| 80 | - $this->line('<fg=default>Manual Lock : <fg=red>Failed'); |
|
| 80 | + $this->line('<fg=default>Manual Lock : <fg=red>Failed'); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | private function testUnlock($domain){ |
| 84 | 84 | $test = new Testing(); |
| 85 | - if( $test->testUnlocking($domain)){ |
|
| 86 | - $this->success += 1; |
|
| 87 | - $this->line('<fg=default>Unlock Account : <fg=green>OK'); |
|
| 85 | + if( $test->testUnlocking($domain)){ |
|
| 86 | + $this->success += 1; |
|
| 87 | + $this->line('<fg=default>Unlock Account : <fg=green>OK'); |
|
| 88 | 88 | } else{ |
| 89 | - $this->error += 1; |
|
| 90 | - $this->line('<fg=default>Unlock Account : <fg=red>Failed'); |
|
| 89 | + $this->error += 1; |
|
| 90 | + $this->line('<fg=default>Unlock Account : <fg=red>Failed'); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | private function testLocked($domain){ |
| 95 | 95 | $test = new Testing(); |
| 96 | - if( $test->testLockLogin($domain)){ |
|
| 97 | - $this->success += 1; |
|
| 98 | - $this->line('<fg=default>Try Login with locked account : <fg=green>Account is Locked'); |
|
| 96 | + if( $test->testLockLogin($domain)){ |
|
| 97 | + $this->success += 1; |
|
| 98 | + $this->line('<fg=default>Try Login with locked account : <fg=green>Account is Locked'); |
|
| 99 | 99 | } else{ |
| 100 | - $this->error += 1; |
|
| 101 | - $this->line('<fg=default>Try Login with locked account : <fg=red>Account logged in'); |
|
| 100 | + $this->error += 1; |
|
| 101 | + $this->line('<fg=default>Try Login with locked account : <fg=red>Account logged in'); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | private function testConfigurations(){ |
| 106 | - $test = new Testing(); |
|
| 107 | - $res = $test->testConfig(); |
|
| 106 | + $test = new Testing(); |
|
| 107 | + $res = $test->testConfig(); |
|
| 108 | 108 | |
| 109 | - $table = new Table($this->output); |
|
| 110 | - $this->line('<fg=cyan>Testing Config:'); |
|
| 109 | + $table = new Table($this->output); |
|
| 110 | + $this->line('<fg=cyan>Testing Config:'); |
|
| 111 | 111 | $table->setRows([ |
| 112 | 112 | ['<fg=default>login_attemps',isset($res['login_attemps']) ? $res['login_attemps']:"<fg=red>Not Found"], |
| 113 | 113 | ['<fg=default>logging',isset($res['logging']) ? $res['logging']:"<fg=red>Not Found"], |
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | private function configCheck($res){ |
| 135 | - if($res['err'] > 0){ |
|
| 135 | + if($res['err'] > 0){ |
|
| 136 | 136 | $this->line('<fg=red>Config invalid, testing is canceled.'); |
| 137 | 137 | $this->line('<fg=default>--------------------------------------------'); |
| 138 | 138 | $this->line('<fg=default>Tested at: '.date('Y-m-d H:m:s',time())); |
| 139 | 139 | exit(); |
| 140 | - } |
|
| 140 | + } |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | private function configExists($res){ |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $this->line('<fg=default>--------------------------------------------'); |
| 148 | 148 | $this->line('<fg=default>Tested at: '.date('Y-m-d H:m:s',time())); |
| 149 | 149 | exit(); |
| 150 | - } |
|
| 150 | + } |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |