@@ -102,7 +102,8 @@ |
||
| 102 | 102 | } catch(\Exception $e) { |
| 103 | 103 | if(starts_with($e->getMessage(), 'unserialize():')) { |
| 104 | 104 | return $value; |
| 105 | - } else { |
|
| 105 | + } |
|
| 106 | + else { |
|
| 106 | 107 | throw $e; |
| 107 | 108 | } |
| 108 | 109 | } |
@@ -79,8 +79,8 @@ |
||
| 79 | 79 | |
| 80 | 80 | $page_setup['navbar'] = [ |
| 81 | 81 | 'Overview' => $device_url, |
| 82 | - 'Graphs' => $device_url . '/graphs', |
|
| 83 | - 'Health' => $device_url . '/health', |
|
| 82 | + 'Graphs' => $device_url.'/graphs', |
|
| 83 | + 'Health' => $device_url.'/health', |
|
| 84 | 84 | ]; |
| 85 | 85 | return view('devices.show', compact(['device', 'page_setup', 'request', 'page'])); |
| 86 | 86 | } |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | if (Auth::guard($guard)->guest()) { |
| 21 | 21 | if ($request->ajax() || $request->wantsJson()) { |
| 22 | 22 | return response('Unauthorized.', 401); |
| 23 | - } else { |
|
| 23 | + } |
|
| 24 | + else { |
|
| 24 | 25 | return redirect()->guest('login'); |
| 25 | 26 | } |
| 26 | 27 | } |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | if (Auth::guard($guard)->guest()) { |
| 21 | 21 | if ($request->ajax() || $request->wantsJson()) { |
| 22 | 22 | return response('Unauthorized.', 401); |
| 23 | - } else { |
|
| 23 | + } |
|
| 24 | + else { |
|
| 24 | 25 | return redirect()->guest('login'); |
| 25 | 26 | } |
| 26 | 27 | } |
@@ -54,14 +54,16 @@ discard block |
||
| 54 | 54 | // set realname |
| 55 | 55 | if ($this->option('realname')) { |
| 56 | 56 | $user->realname = $this->option('realname'); |
| 57 | - } else { |
|
| 57 | + } |
|
| 58 | + else { |
|
| 58 | 59 | $user->realname = $this->ask('Real Name'); |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | 62 | // set email |
| 62 | 63 | if ($this->option('email')) { |
| 63 | 64 | $user->email = $this->option('email'); |
| 64 | - } else { |
|
| 65 | + } |
|
| 66 | + else { |
|
| 65 | 67 | $user->email = $this->ask('Email'); |
| 66 | 68 | } |
| 67 | 69 | |
@@ -77,14 +79,16 @@ discard block |
||
| 77 | 79 | // set password |
| 78 | 80 | if ($this->argument('password')) { |
| 79 | 81 | $user->password = $this->argument('password'); |
| 80 | - } else { |
|
| 82 | + } |
|
| 83 | + else { |
|
| 81 | 84 | $user->password = $this->secret('Password'); |
| 82 | 85 | } |
| 83 | 86 | |
| 84 | 87 | // save user |
| 85 | 88 | if ($user->save()) { |
| 86 | 89 | $this->info('User '.$user->username.' created.'); |
| 87 | - } else { |
|
| 90 | + } |
|
| 91 | + else { |
|
| 88 | 92 | $this->error('Failed to create user '.$user->username); |
| 89 | 93 | } |
| 90 | 94 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public function register() |
| 48 | 48 | { |
| 49 | - \App::bind('settings', function () { |
|
| 49 | + \App::bind('settings', function() { |
|
| 50 | 50 | return new \App\Settings; |
| 51 | 51 | }); |
| 52 | 52 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | // match the current password for the supplied user id |
| 42 | 42 | Validator::extend( |
| 43 | 43 | 'password', |
| 44 | - function ($attribute, $value, $parameters, $validator) { |
|
| 44 | + function($attribute, $value, $parameters, $validator) { |
|
| 45 | 45 | return Auth::validate([ |
| 46 | 46 | 'user_id' => $parameters[0], |
| 47 | 47 | 'password' => $value, |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | { |
| 151 | 151 | parent::boot(); |
| 152 | 152 | |
| 153 | - static::deleting(function (Device $device) { |
|
| 153 | + static::deleting(function(Device $device) { |
|
| 154 | 154 | // delete related data |
| 155 | 155 | $device->ports()->delete(); |
| 156 | 156 | $device->syslogs()->delete(); |
@@ -197,7 +197,8 @@ discard block |
||
| 197 | 197 | $icon = $this->icon; |
| 198 | 198 | if (isset($icon)) { |
| 199 | 199 | return asset('images/os/'.$icon.'.png'); |
| 200 | - } else { |
|
| 200 | + } |
|
| 201 | + else { |
|
| 201 | 202 | return asset('images/os/generic.png'); |
| 202 | 203 | } |
| 203 | 204 | } |
@@ -212,11 +213,14 @@ discard block |
||
| 212 | 213 | $disabled = $this->disabled; |
| 213 | 214 | if ($disabled == 1) { |
| 214 | 215 | return 'teal'; |
| 215 | - } elseif ($ignore == 1) { |
|
| 216 | + } |
|
| 217 | + elseif ($ignore == 1) { |
|
| 216 | 218 | return 'yellow'; |
| 217 | - } elseif ($status == 0) { |
|
| 219 | + } |
|
| 220 | + elseif ($status == 0) { |
|
| 218 | 221 | return 'danger'; |
| 219 | - } else { |
|
| 222 | + } |
|
| 223 | + else { |
|
| 220 | 224 | return 'success'; |
| 221 | 225 | } |
| 222 | 226 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // return the table filter merged with $filter, fetch from cache if available |
| 65 | - return array_merge($filter, Cache::rememberForever('query_builder_table_filter', function () { |
|
| 65 | + return array_merge($filter, Cache::rememberForever('query_builder_table_filter', function() { |
|
| 66 | 66 | $tableFilter = []; |
| 67 | 67 | $schema = DB::getDoctrineSchemaManager(); |
| 68 | 68 | |