@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | $this->line(''); |
23 | 23 | // Select which update file to use |
24 | 24 | $updateFile = $this->checkForUpdate(); |
25 | - if ($updateFile) { |
|
25 | + if ($updateFile) |
|
26 | + { |
|
26 | 27 | // Open up the file and verify it is at least the same version as the current setup |
27 | 28 | $valid = $this->openUpdate($updateFile); |
28 | 29 | |
@@ -80,7 +81,8 @@ discard block |
||
80 | 81 | $this->line(''); |
81 | 82 | |
82 | 83 | $anticipate = []; |
83 | - foreach ($updateList as $key => $up) { |
|
84 | + foreach ($updateList as $key => $up) |
|
85 | + { |
|
84 | 86 | $opt = $key + 1; |
85 | 87 | $anticipate[$opt] = $up; |
86 | 88 | $this->line('[' . $opt . '] ' . $up); |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | $userLinks = new UserCollection( |
37 | 37 | User::withCount([ |
38 | 38 | 'FileLinks', |
39 | - 'FileLinks as expired_file_links_count' => function($query) |
|
40 | - { |
|
39 | + 'FileLinks as expired_file_links_count' => function($query) { |
|
41 | 40 | $query->where('expire', '<', Carbon::now()); |
42 | 41 | } |
43 | 42 | ]) |
@@ -91,7 +90,8 @@ discard block |
||
91 | 90 | Log::notice('User '.Auth::user()->full_name.' updated User Password Policy'); |
92 | 91 | |
93 | 92 | // If the setting is changing from never to xx days, update all users |
94 | - if ($request->passExpire == 0) { |
|
93 | + if ($request->passExpire == 0) |
|
94 | + { |
|
95 | 95 | User::whereNotNull('password_expires')->update([ |
96 | 96 | 'password_expires' => null |
97 | 97 | ]); |
@@ -112,8 +112,7 @@ discard block |
||
112 | 112 | { |
113 | 113 | $this->authorize('hasAccess', 'Manage User Roles'); |
114 | 114 | Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
115 | - $roles = UserRoleType::with(['UserRolePermissions' => function($query) |
|
116 | - { |
|
115 | + $roles = UserRoleType::with(['UserRolePermissions' => function($query) { |
|
117 | 116 | $query->join('user_role_permission_types', 'user_role_permission_types.perm_type_id', '=', 'user_role_permissions.perm_type_id'); |
118 | 117 | }])->get(); |
119 | 118 | $perms = UserRolePermissionTypes::all(); |
@@ -182,12 +182,18 @@ discard block |
||
182 | 182 | |
183 | 183 | // Good to go - get role information |
184 | 184 | $roleArr = []; |
185 | - foreach ($roles as $role) { |
|
186 | - if ($role->role_id == 1 && Auth::user()->role_id != 1) { |
|
185 | + foreach ($roles as $role) |
|
186 | + { |
|
187 | + if ($role->role_id == 1 && Auth::user()->role_id != 1) |
|
188 | + { |
|
187 | 189 | continue; |
188 | - } else if ($role->role_id == 2 && Auth::user()->role_id > 1) { |
|
190 | + } |
|
191 | + else if ($role->role_id == 2 && Auth::user()->role_id > 1) |
|
192 | + { |
|
189 | 193 | continue; |
190 | - } else { |
|
194 | + } |
|
195 | + else |
|
196 | + { |
|
191 | 197 | // $roleArr[$role->role_id] = $role->name; |
192 | 198 | $roleArr[] = [ |
193 | 199 | 'value' => $role->role_id, |
@@ -279,17 +285,20 @@ discard block |
||
279 | 285 | $user = User::find($request->user_id); |
280 | 286 | |
281 | 287 | // Verify this is a valid user ID |
282 | - if (!$user) { |
|
288 | + if (!$user) |
|
289 | + { |
|
283 | 290 | $success = false; |
284 | 291 | $reason = 'Cannot find user with this ID'; |
285 | 292 | } |
286 | 293 | // Make sure that the user is not trying to deactivate someone with more permissions |
287 | - else if ($user->role_id < Auth::user()->role_id) { |
|
294 | + else if ($user->role_id < Auth::user()->role_id) |
|
295 | + { |
|
288 | 296 | $success = false; |
289 | 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.'; |
290 | 298 | } |
291 | 299 | // Good to go - update user password |
292 | - else { |
|
300 | + else |
|
301 | + { |
|
293 | 302 | // Update the user data |
294 | 303 | $user->update( |
295 | 304 | [ |