@@ -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 | }) |
@@ -19,7 +19,8 @@ |
||
| 19 | 19 | if (!Auth::guard($guard)->user()->isAdmin()) { |
| 20 | 20 | if ($request->ajax() || $request->wantsJson()) { |
| 21 | 21 | return response(trans('general.text.unauthorized'), 401); |
| 22 | - } else { |
|
| 22 | + } |
|
| 23 | + else { |
|
| 23 | 24 | //FIXME: Errors not working |
| 24 | 25 | return redirect('/')->withErrors(['msg', trans('general.text.unauthorized')]); |
| 25 | 26 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | if ($this->input('update') == 'password') { |
| 54 | 54 | $user_id = $this->input('user_id'); |
| 55 | 55 | $rules = ['password' => 'required|min:6|max:255', |
| 56 | - 'password_confirmation' => 'required|same:password', |
|
| 56 | + 'password_confirmation' => 'required|same:password', |
|
| 57 | 57 | ]; |
| 58 | 58 | if (!Auth::user()->isAdmin() || Auth::id() == $user_id) { |
| 59 | 59 | $rules['current_password'] = 'required|password:'.$user_id; |
@@ -59,7 +59,8 @@ |
||
| 59 | 59 | $rules['current_password'] = 'required|password:'.$user_id; |
| 60 | 60 | } |
| 61 | 61 | return $rules; |
| 62 | - } else { |
|
| 62 | + } |
|
| 63 | + else { |
|
| 63 | 64 | $user = User::find($this->input('user_id')); |
| 64 | 65 | return ['username' => 'required|max:20|unique:users,username,'.$user->username.',username', |
| 65 | 66 | 'email' => 'required|email|max:60|unique:users,email,'.$user->username.',username', |
@@ -23,7 +23,8 @@ |
||
| 23 | 23 | $page = ''; |
| 24 | 24 | $button = 'Notifications'; |
| 25 | 25 | $bg = 'maroon'; |
| 26 | - } else { |
|
| 26 | + } |
|
| 27 | + else { |
|
| 27 | 28 | $page = 'archive'; |
| 28 | 29 | $button = 'Archive'; |
| 29 | 30 | $bg = 'blue'; |
@@ -108,7 +108,8 @@ |
||
| 108 | 108 | $user->update($request->all()); |
| 109 | 109 | if ($request->input('update') == 'password') { |
| 110 | 110 | $message = trans('user.text.pwdupdated'); |
| 111 | - } else { |
|
| 111 | + } |
|
| 112 | + else { |
|
| 112 | 113 | $message = trans('user.text.updated', ['username' => $user->username]); |
| 113 | 114 | } |
| 114 | 115 | |
@@ -70,7 +70,8 @@ |
||
| 70 | 70 | if ($type == 'settings-value') { |
| 71 | 71 | Settings::set($key, $value); |
| 72 | 72 | return response('OK', 200); |
| 73 | - } elseif ($type == 'settings-array') { |
|
| 73 | + } |
|
| 74 | + elseif ($type == 'settings-array') { |
|
| 74 | 75 | $current = Settings::get($key); |
| 75 | 76 | |
| 76 | 77 | // remove entries with missing indexes |
@@ -118,7 +118,8 @@ |
||
| 118 | 118 | $group = DeviceGroup::find($id); |
| 119 | 119 | if ($group && $group->delete()) { |
| 120 | 120 | return response()->json(['message' => trans('devices.groups.deleted', ['name' => $group->name])]); |
| 121 | - } else { |
|
| 121 | + } |
|
| 122 | + else { |
|
| 122 | 123 | return response()->json(['message' => trans('devices.groups.deletefailed', ['name' => $group ? $group->name : ""])], 422); |
| 123 | 124 | } |
| 124 | 125 | } |
@@ -36,7 +36,8 @@ |
||
| 36 | 36 | if (Dashboard::find($request->route('dashboard_id'))) { |
| 37 | 37 | $dash = Api::be(auth()->user())->get('/api/dashboard/'.$request->route('dashboard_id')); |
| 38 | 38 | $widgets = Api::be(auth()->user())->get('/api/widget'); |
| 39 | - } else { |
|
| 39 | + } |
|
| 40 | + else { |
|
| 40 | 41 | return redirect()->route('home'); |
| 41 | 42 | } |
| 42 | 43 | return view('home', ['dashboards' => $dashboards, 'request' => $request, 'dash_widgets' => $dash['widgets'], 'token' => $token, 'dash_details' => $dash['dashboard'], 'widgets' => $widgets]); |
@@ -87,7 +87,8 @@ |
||
| 87 | 87 | $read->value = 1; |
| 88 | 88 | $this->attribs()->save($read); |
| 89 | 89 | return true; |
| 90 | - } else { |
|
| 90 | + } |
|
| 91 | + else { |
|
| 91 | 92 | return $this->attribs()->where('key', $name)->delete(); |
| 92 | 93 | } |
| 93 | 94 | } |