@@ -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 | } |
@@ -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 | } |
@@ -76,7 +76,8 @@ |
||
| 76 | 76 | if ($type == 'settings-value') { |
| 77 | 77 | Settings::set($key, Input::get('value')); |
| 78 | 78 | return response('OK', 200); |
| 79 | - } elseif ($type == 'settings-array') { |
|
| 79 | + } |
|
| 80 | + elseif ($type == 'settings-array') { |
|
| 80 | 81 | $new = Input::get('value'); |
| 81 | 82 | $current = Settings::get($key); |
| 82 | 83 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function apply($query) |
| 23 | 23 | { |
| 24 | - return $query->whereHas('groups', function ($q) { |
|
| 24 | + return $query->whereHas('groups', function($q) { |
|
| 25 | 25 | $q->where('id', '=', $this->group_id); |
| 26 | 26 | }); |
| 27 | 27 | } |
@@ -60,7 +60,6 @@ |
||
| 60 | 60 | /** |
| 61 | 61 | * Display the alerts widget. |
| 62 | 62 | * |
| 63 | - * @param AlertsDataTable $dataTable |
|
| 64 | 63 | * @param null $action |
| 65 | 64 | * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View |
| 66 | 65 | */ |
@@ -52,7 +52,8 @@ discard block |
||
| 52 | 52 | if ($request->device_id) { |
| 53 | 53 | return $EventlogDataTable->forDevice($request->device_id) |
| 54 | 54 | ->render('widgets.eventlog', compact(['tableName', 'action'])); |
| 55 | - } else { |
|
| 55 | + } |
|
| 56 | + else { |
|
| 56 | 57 | return $EventlogDataTable->render('widgets.eventlog', compact(['tableName', 'action'])); |
| 57 | 58 | } |
| 58 | 59 | } |
@@ -95,7 +96,8 @@ discard block |
||
| 95 | 96 | $uptime = Settings::get('uptime_warning', 84600); |
| 96 | 97 | if ($request->user()->hasGlobalRead()) { |
| 97 | 98 | $devices = Device::where('ignore', '=', 0)->get(); |
| 98 | - } else { |
|
| 99 | + } |
|
| 100 | + else { |
|
| 99 | 101 | $devices = User::find($request->user()->user_id)->devices()->where('ignore', '=', 0)->get(); |
| 100 | 102 | } |
| 101 | 103 | $count = ['warn' => 0, 'up' => 0, 'down' => 0]; |
@@ -103,10 +105,12 @@ discard block |
||
| 103 | 105 | if ($device->status == 1) { |
| 104 | 106 | if (($device->uptime < $uptime) && ($device->uptime != '0')) { |
| 105 | 107 | $count['warn']++; |
| 106 | - } else { |
|
| 108 | + } |
|
| 109 | + else { |
|
| 107 | 110 | $count['up']++; |
| 108 | 111 | } |
| 109 | - } else { |
|
| 112 | + } |
|
| 113 | + else { |
|
| 110 | 114 | $count['down']++; |
| 111 | 115 | } |
| 112 | 116 | } |
@@ -137,7 +141,8 @@ discard block |
||
| 137 | 141 | $count['ports']['down'] = Port::isDown()->count(); |
| 138 | 142 | $count['ports']['ignored'] = Port::isIgnored()->count(); |
| 139 | 143 | $count['ports']['disabled'] = Port::isDisabled()->count(); |
| 140 | - } else { |
|
| 144 | + } |
|
| 145 | + else { |
|
| 141 | 146 | $user = User::find($request->user()->user_id); |
| 142 | 147 | |
| 143 | 148 | $count['devices']['total'] = $user->devices()->count(); |
@@ -64,7 +64,8 @@ |
||
| 64 | 64 | |
| 65 | 65 | if ($format == 'json') { |
| 66 | 66 | return $this->jsonSerialize(); |
| 67 | - } elseif ($format == 'csv') { |
|
| 67 | + } |
|
| 68 | + elseif ($format == 'csv') { |
|
| 68 | 69 | return $this->csvSerialize(); |
| 69 | 70 | } |
| 70 | 71 | return null; // shouldn't get here |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | } elseif ($format == 'csv') { |
| 66 | 66 | return $this->csvSerialize(); |
| 67 | 67 | } |
| 68 | - return null; // shouldn't get here |
|
| 68 | + return null; // shouldn't get here |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -191,8 +191,8 @@ discard block |
||
| 191 | 191 | public static function escape($string, $length = null) |
| 192 | 192 | { |
| 193 | 193 | $result = shorten_interface_type($string); |
| 194 | - $result = str_replace("'", '', $result); # remove quotes |
|
| 195 | - $result = str_replace('%', '%%', $result); # double percent signs |
|
| 194 | + $result = str_replace("'", '', $result); # remove quotes |
|
| 195 | + $result = str_replace('%', '%%', $result); # double percent signs |
|
| 196 | 196 | if (is_numeric($length) && strlen($string) > $length) { |
| 197 | 197 | $extra = substr_count($string, ':', 0, $length); |
| 198 | 198 | $result = substr(str_pad($result, $length), 0, ($length + $extra)); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - $result = str_replace(':', '\:', $result); # escape colons |
|
| 204 | + $result = str_replace(':', '\:', $result); # escape colons |
|
| 205 | 205 | return $result.' '; |
| 206 | 206 | } |
| 207 | 207 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | { |
| 34 | 34 | if ($this->hasIDs()) { |
| 35 | 35 | return [ |
| 36 | - 'storage' => function (Builder $query) { |
|
| 36 | + 'storage' => function(Builder $query) { |
|
| 37 | 37 | $query->whereIn('storage_id', $this->getIDs()); |
| 38 | 38 | }, |
| 39 | 39 | ]; |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | { |
| 34 | 34 | if ($this->hasIDs()) { |
| 35 | 35 | return [ |
| 36 | - 'processors' => function (Builder $query) { |
|
| 36 | + 'processors' => function(Builder $query) { |
|
| 37 | 37 | $query->whereIn('processor_id', $this->getIDs()); |
| 38 | 38 | }, |
| 39 | 39 | ]; |