@@ -39,8 +39,7 @@ |
||
| 39 | 39 | if ($response instanceof Response and $this->webartisan->isEnabled() and $request->url() != asset(config('webartisan.route_prefix').'/run')) { |
| 40 | 40 | try { |
| 41 | 41 | $response->getContent(); |
| 42 | - } |
|
| 43 | - catch (\ErrorException $e) { |
|
| 42 | + } catch (\ErrorException $e) { |
|
| 44 | 43 | return $response; |
| 45 | 44 | } |
| 46 | 45 | |
@@ -33,12 +33,10 @@ |
||
| 33 | 33 | or (config('webartisan.use_authentication') and $this->webartisan->isAuthenticated())) { |
| 34 | 34 | try { |
| 35 | 35 | Artisan::call($commandPrepared); |
| 36 | - } |
|
| 37 | - catch(\Exception $e) { |
|
| 36 | + } catch(\Exception $e) { |
|
| 38 | 37 | return $this->prepareResultToHtml($e->getMessage(), 'error'); |
| 39 | 38 | } |
| 40 | - } |
|
| 41 | - else { |
|
| 39 | + } else { |
|
| 42 | 40 | return $this->prepareResultToHtml('Please, authenticate yourself before to start using Web Artisan.', 'error'); |
| 43 | 41 | } |
| 44 | 42 | return $this->prepareResultToHtml(Artisan::output(), 'success'); |
@@ -40,14 +40,19 @@ |
||
| 40 | 40 | |
| 41 | 41 | if($this->username and $this->password) { |
| 42 | 42 | $authenticated = true; |
| 43 | - if($this->username != config('webartisan.auth.username')) $authenticated = false; |
|
| 44 | - if($this->password != config('webartisan.auth.password')) $authenticated = false; |
|
| 43 | + if($this->username != config('webartisan.auth.username')) { |
|
| 44 | + $authenticated = false; |
|
| 45 | + } |
|
| 46 | + if($this->password != config('webartisan.auth.password')) { |
|
| 47 | + $authenticated = false; |
|
| 48 | + } |
|
| 45 | 49 | |
| 46 | 50 | if($authenticated) { |
| 47 | 51 | $request->session()->put('webartisan__authenticated', true); |
| 48 | 52 | return $this->prepareResultToHtml("Welcome", 'success'); |
| 53 | + } else { |
|
| 54 | + return $this->prepareResultToHtml("Oops, it looks like we don't know each other.", 'error'); |
|
| 49 | 55 | } |
| 50 | - else return $this->prepareResultToHtml("Oops, it looks like we don't know each other.", 'error'); |
|
| 51 | 56 | } |
| 52 | 57 | return $this->prepareResultToHtml("Username and Password cannot be empty.", 'error'); |
| 53 | 58 | } |