@@ -211,7 +211,8 @@ |
||
211 | 211 | public function destroy($id) |
212 | 212 | { |
213 | 213 | // |
214 | - try { |
|
214 | + try |
|
215 | + { |
|
215 | 216 | SystemTypes::find($id)->delete(); |
216 | 217 | return response()->json(['success' => true, 'reason' => 'Equipment Successfully Deleted']); |
217 | 218 | } |
@@ -59,9 +59,12 @@ discard block |
||
59 | 59 | public function archiveFiles(Request $request) |
60 | 60 | { |
61 | 61 | // Debug Data |
62 | - if(Auth::user()) { |
|
62 | + if(Auth::user()) |
|
63 | + { |
|
63 | 64 | $user = Auth::user()->full_name; |
64 | - } else { |
|
65 | + } |
|
66 | + else |
|
67 | + { |
|
65 | 68 | $user = \Request::ip(); |
66 | 69 | } |
67 | 70 | Log::debug('Route '.Route::currentRouteName().' visited by '.$user.' Request Data:', $request->toArray()); |
@@ -107,9 +110,12 @@ discard block |
||
107 | 110 | public function downloadArchive($fileName) |
108 | 111 | { |
109 | 112 | // Debug Data |
110 | - if(Auth::user()) { |
|
113 | + if(Auth::user()) |
|
114 | + { |
|
111 | 115 | $user = Auth::user()->full_name; |
112 | - } else { |
|
116 | + } |
|
117 | + else |
|
118 | + { |
|
113 | 119 | $user = \Request::ip(); |
114 | 120 | } |
115 | 121 | Log::debug('Route '.Route::currentRouteName().' visited by '.$user); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | Log::notice('User '.Auth::user()->full_name.' updated User Password Policy'); |
90 | 90 | |
91 | 91 | // If the setting is changing from never to xx days, update all users |
92 | - if ($request->passExpire == 0) |
|
92 | + if($request->passExpire == 0) |
|
93 | 93 | { |
94 | 94 | User::whereNotNull('password_expires')->update([ |
95 | 95 | 'password_expires' => null |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public function roleSettings() |
111 | 111 | { |
112 | 112 | $this->authorize('hasAccess', 'Manage User Roles'); |
113 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
113 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
114 | 114 | $roles = UserRoleType::with(['UserRolePermissions' => function($query) { |
115 | 115 | $query->join('user_role_permission_types', 'user_role_permission_types.perm_type_id', '=', 'user_role_permissions.perm_type_id'); |
116 | 116 | }])->get(); |
@@ -182,13 +182,13 @@ discard block |
||
182 | 182 | |
183 | 183 | // Good to go - get role information |
184 | 184 | $roleArr = []; |
185 | - foreach ($roles as $role) |
|
185 | + foreach($roles as $role) |
|
186 | 186 | { |
187 | - if ($role->role_id == 1 && Auth::user()->role_id != 1) |
|
187 | + if($role->role_id == 1 && Auth::user()->role_id != 1) |
|
188 | 188 | { |
189 | 189 | continue; |
190 | 190 | } |
191 | - else if ($role->role_id == 2 && Auth::user()->role_id > 1) |
|
191 | + else if($role->role_id == 2 && Auth::user()->role_id > 1) |
|
192 | 192 | { |
193 | 193 | continue; |
194 | 194 | } |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | $user = User::find($request->user_id); |
286 | 286 | |
287 | 287 | // Verify this is a valid user ID |
288 | - if (!$user) |
|
288 | + if(!$user) |
|
289 | 289 | { |
290 | 290 | $success = false; |
291 | 291 | $reason = 'Cannot find user with this ID'; |
292 | 292 | } |
293 | 293 | // Make sure that the user is not trying to deactivate someone with more permissions |
294 | - else if ($user->role_id < Auth::user()->role_id) |
|
294 | + else if($user->role_id < Auth::user()->role_id) |
|
295 | 295 | { |
296 | 296 | $success = false; |
297 | 297 | $reason = 'You cannot change password for a user with higher permissions that you. If this user has locked themselves out, have then use the reset link on the login page.'; |