@@ -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, |
@@ -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) |
@@ -58,7 +58,8 @@ |
||
| 58 | 58 | { |
| 59 | 59 | if (is_numeric($this->device_id)) { |
| 60 | 60 | $eventlogs = Eventlog::with('device')->where('eventlog.device_id', $this->device_id)->select('eventlog.*'); |
| 61 | - } else { |
|
| 61 | + } |
|
| 62 | + else { |
|
| 62 | 63 | $eventlogs = Eventlog::with('device')->select('eventlog.*'); |
| 63 | 64 | } |
| 64 | 65 | return $this->applyScopes($eventlogs); |
@@ -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 | }) |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | return $this->datatables |
| 41 | 41 | ->eloquent($this->query()) |
| 42 | - ->editColumn('device.hostname', function ($inventory) { |
|
| 42 | + ->editColumn('device.hostname', function($inventory) { |
|
| 43 | 43 | $hostname = is_null($inventory->device) ? trans('devices.text.deleted') : $inventory->device->hostname; |
| 44 | 44 | return '<a href="'.url("devices/".$inventory->device_id).'">'.$hostname.'</a>'; |
| 45 | 45 | }) |
@@ -41,21 +41,21 @@ |
||
| 41 | 41 | { |
| 42 | 42 | return $this->datatables |
| 43 | 43 | ->eloquent($this->query()) |
| 44 | - ->editColumn('hostname', function ($data) { |
|
| 44 | + ->editColumn('hostname', function($data) { |
|
| 45 | 45 | $hostname = is_null($data->device) ? trans('devices.text.deleted') : $data->device->hostname; |
| 46 | 46 | return '<a href="'.url("devices/".$data->device_id).'">'.$hostname.'</a>'; |
| 47 | 47 | }) |
| 48 | - ->editColumn('ifName', function ($data) { |
|
| 48 | + ->editColumn('ifName', function($data) { |
|
| 49 | 49 | $ifName = is_null($data->ifName) ? trans('devices.text.deleted') : $data->ifName; |
| 50 | 50 | return '<a href="'.url("devices/".$data->device_id."/ports/".$data->port_id).'">'.$ifName.'</a>'; |
| 51 | 51 | }) |
| 52 | - ->addColumn('remote_device', function ($data) { |
|
| 52 | + ->addColumn('remote_device', function($data) { |
|
| 53 | 53 | $remote_device = IPv4::where('ipv4_addresses.ipv4_address', $data->ipv4_address)->with('port.device')->first(); |
| 54 | 54 | $remote_id = empty($remote_device->port->device->device_id) ? '' : $remote_device->port->device->device_id; |
| 55 | 55 | $remote_hostname = empty($remote_device->port->device->hostname) ? trans('devices.text.deleted') : $remote_device->port->device->hostname; |
| 56 | 56 | return '<a href="'.url("devices/".$remote_id).'">'.$remote_hostname.'</a>'; |
| 57 | 57 | }) |
| 58 | - ->addColumn('remote_interface', function ($data) { |
|
| 58 | + ->addColumn('remote_interface', function($data) { |
|
| 59 | 59 | $remote_device = IPv4::where('ipv4_addresses.ipv4_address', $data->ipv4_address)->with('port.device')->first(); |
| 60 | 60 | $remote_id = empty($remote_device->port->device->device_id) ? '' : $remote_device->port->device->device_id; |
| 61 | 61 | $remote_port_id = empty($remote_device->port->port_id) ? '' : $remote_device->port->port_id; |
@@ -39,10 +39,10 @@ |
||
| 39 | 39 | { |
| 40 | 40 | return $this->datatables |
| 41 | 41 | ->eloquent($this->query()) |
| 42 | - ->editColumn('level', function ($user) { |
|
| 42 | + ->editColumn('level', function($user) { |
|
| 43 | 43 | return trans('user.level.'.$user->level); |
| 44 | 44 | }) |
| 45 | - ->editColumn('actions', function ($user) { |
|
| 45 | + ->editColumn('actions', function($user) { |
|
| 46 | 46 | $edit = '<a type="button" class="btn btn-xs btn-primary" href="'. |
| 47 | 47 | route('users.edit', ['user_id' => $user->user_id]). |
| 48 | 48 | '"><i class="fa fa-edit fa-lg fa-fw"></i><span class="hidden-xs"> '.trans('button.edit').'</span></a> '; |