@@ -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 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | return $this->datatables |
| 41 | 41 | ->eloquent($this->query()) |
| 42 | - ->editColumn('device.hostname', function ($syslog) { |
|
| 42 | + ->editColumn('device.hostname', function($syslog) { |
|
| 43 | 43 | $hostname = is_null($syslog->device) ? trans('devices.text.deleted') : $syslog->device->hostname; |
| 44 | 44 | return '<a href="'.url("devices/".$syslog->device_id).'">'.$hostname.'</a>'; |
| 45 | 45 | }) |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | return $this->datatables |
| 44 | 44 | ->eloquent($this->query()) |
| 45 | - ->editColumn('device.hostname', function ($eventlog) { |
|
| 45 | + ->editColumn('device.hostname', function($eventlog) { |
|
| 46 | 46 | $hostname = is_null($eventlog->device) ? trans('devices.text.deleted') : $eventlog->device->hostname; |
| 47 | 47 | return '<a href="'.url("devices/".$eventlog->device_id).'">'.$hostname.'</a>'; |
| 48 | 48 | }) |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function getAjax() |
| 107 | 107 | { |
| 108 | - return url('eventlog?device_id=' . $this->device_id); |
|
| 108 | + return url('eventlog?device_id='.$this->device_id); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | public function forDevice($device_id) |
@@ -40,11 +40,11 @@ |
||
| 40 | 40 | { |
| 41 | 41 | return $this->datatables |
| 42 | 42 | ->eloquent($this->query()) |
| 43 | - ->editColumn('hostname', function ($data) { |
|
| 43 | + ->editColumn('hostname', function($data) { |
|
| 44 | 44 | $hostname = is_null($data->device) ? trans('devices.text.deleted') : $data->device->hostname; |
| 45 | 45 | return '<a href="'.url("devices/".$data->device_id).'">'.$hostname.'</a>'; |
| 46 | 46 | }) |
| 47 | - ->editColumn('ifName', function ($data) { |
|
| 47 | + ->editColumn('ifName', function($data) { |
|
| 48 | 48 | $ifName = is_null($data->ifName) ? trans('devices.text.deleted') : $data->ifName; |
| 49 | 49 | return '<a href="'.url("devices/".$data->device_id."/ports/".$data->port_id).'">'.$ifName.'</a>'; |
| 50 | 50 | }) |