@@ -25,14 +25,14 @@ |
||
| 25 | 25 | public function boot() |
| 26 | 26 | { |
| 27 | 27 | // Service provider to customize form inputs |
| 28 | - Form::component('bsText', 'components.form.text', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 28 | + Form::component('bsText', 'components.form.text', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 29 | 29 | Form::component('bsPassword', 'components.form.password', ['name', 'label', 'value' => null, 'attributes' => []]); |
| 30 | - Form::component('bsNumber', 'components.form.number', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 31 | - Form::component('bsEmail', 'components.form.email', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 32 | - Form::component('bsDate', 'components.form.date', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 30 | + Form::component('bsNumber', 'components.form.number', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 31 | + Form::component('bsEmail', 'components.form.email', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 32 | + Form::component('bsDate', 'components.form.date', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 33 | 33 | Form::component('bsTextarea', 'components.form.textarea', ['name', 'label', 'value' => null, 'attributes' => []]); |
| 34 | 34 | Form::component('bsCheckbox', 'components.form.checkbox', ['name', 'label', 'value' => 'on', 'checked' => false, 'attributes' => []]); |
| 35 | - Form::component('bsSelect', 'components.form.select', ['name', 'label', 'list', 'selected' => null, 'attributes' => []]); |
|
| 35 | + Form::component('bsSelect', 'components.form.select', ['name', 'label', 'list', 'selected' => null, 'attributes' => []]); |
|
| 36 | 36 | // Custom Submit button |
| 37 | 37 | Form::component('bsSubmit', 'components.form.submit', ['name']); |
| 38 | 38 | // List of all states in a dropdown box |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | // Determine if a user can see the Administration Nav Link |
| 38 | 38 | public function seeAdminLink(User $user) |
| 39 | 39 | { |
| 40 | - if ($this->isInstaller($user)) |
|
| 40 | + if($this->isInstaller($user)) |
|
| 41 | 41 | { |
| 42 | 42 | return true; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $data = UserRolePermissions::with('UserRolePermissionTypes') |
| 46 | - ->whereHas('UserRolePermissionTypes', function ($query) { |
|
| 46 | + ->whereHas('UserRolePermissionTypes', function($query) { |
|
| 47 | 47 | $query->where('description', 'Manage Users') |
| 48 | 48 | ->orWhere('description', 'Manage User Roles') |
| 49 | 49 | ->orWhere('description', 'Manage Customers') |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | ->get(); |
| 55 | 55 | |
| 56 | 56 | $allow = $data->isEmpty() ? 'Denied' : 'Allowed'; |
| 57 | - Log::debug('User ' . $user->full_name . ' is trying to see admin link. Result - ' . $allow); |
|
| 57 | + Log::debug('User '.$user->full_name.' is trying to see admin link. Result - '.$allow); |
|
| 58 | 58 | |
| 59 | 59 | return $data->isEmpty() ? false : true; |
| 60 | 60 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $data = UserRolePermissions::with('UserRolePermissionTypes') |
| 72 | - ->whereHas('UserRolePermissionTypes', function ($query) use ($task) { |
|
| 72 | + ->whereHas('UserRolePermissionTypes', function($query) use ($task) { |
|
| 73 | 73 | $query->where('description', $task); |
| 74 | 74 | }) |
| 75 | 75 | ->where('role_id', $user->role_id) |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | ->get(); |
| 78 | 78 | |
| 79 | 79 | $allow = $data->isEmpty() ? 'false' : 'true'; |
| 80 | - Log::debug('User '.$user->full_name.' is trying to access '.$task.'. Result - ' . $allow); |
|
| 81 | - if ($allow === 'Denied') |
|
| 80 | + Log::debug('User '.$user->full_name.' is trying to access '.$task.'. Result - '.$allow); |
|
| 81 | + if($allow === 'Denied') |
|
| 82 | 82 | { |
| 83 | - Log::alert('User ' . $user->full_name . ' was denied from accessing '.$task.' link.'); |
|
| 83 | + Log::alert('User '.$user->full_name.' was denied from accessing '.$task.' link.'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $data->isEmpty() ? false : true; |
@@ -25,7 +25,8 @@ discard block |
||
| 25 | 25 | // Validate the hash token |
| 26 | 26 | $user = UserInitialize::where('token', $hash)->get(); |
| 27 | 27 | |
| 28 | - if($user->isEmpty()) { |
|
| 28 | + if($user->isEmpty()) |
|
| 29 | + { |
|
| 29 | 30 | Log::warning('Visitor at IP Address '.\Request::ip().' tried to access invalid initialize hash - '.$hash); |
| 30 | 31 | return abort(404); |
| 31 | 32 | } |
@@ -43,7 +44,8 @@ discard block |
||
| 43 | 44 | |
| 44 | 45 | // Verify that the link matches the assigned email address |
| 45 | 46 | $valid = UserInitialize::where('token', $hash)->first(); |
| 46 | - if(empty($valid)) { |
|
| 47 | + if(empty($valid)) |
|
| 48 | + { |
|
| 47 | 49 | Log::warning('Visitor at IP Address '.\Request::ip().' tried to submit an invalid User Initialization link - '.$hash); |
| 48 | 50 | return abort(404); |
| 49 | 51 | } |
@@ -41,7 +41,8 @@ discard block |
||
| 41 | 41 | ]; |
| 42 | 42 | } |
| 43 | 43 | $mods = Module::allDisabled(); |
| 44 | - foreach($mods as $name => $mod) { |
|
| 44 | + foreach($mods as $name => $mod) |
|
| 45 | + { |
|
| 45 | 46 | $moduleList[] = [ |
| 46 | 47 | 'name' => $name, |
| 47 | 48 | 'status' => 'Disabled', |
@@ -78,7 +79,8 @@ discard block |
||
| 78 | 79 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
| 79 | 80 | |
| 80 | 81 | // Verify that the upload is valid and being processed |
| 81 | - if($receiver->isUploaded() === false) { |
|
| 82 | + if($receiver->isUploaded() === false) |
|
| 83 | + { |
|
| 82 | 84 | Log::error('Upload File Missing - '. |
| 83 | 85 | /** @scrutinizer ignore-type */ |
| 84 | 86 | $request->toArray()); |
@@ -89,7 +91,8 @@ discard block |
||
| 89 | 91 | $save = $receiver->receive(); |
| 90 | 92 | |
| 91 | 93 | // See if the uploade has finished |
| 92 | - if($save->isFinished()) { |
|
| 94 | + if($save->isFinished()) |
|
| 95 | + { |
|
| 93 | 96 | $this->saveFile($save->getFile()); |
| 94 | 97 | |
| 95 | 98 | return 'uploaded successfully'; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ]); |
| 81 | 81 | |
| 82 | 82 | // Update the site timezone |
| 83 | - if (config('app.timezone') !== $request->timezone) |
|
| 83 | + if(config('app.timezone') !== $request->timezone) |
|
| 84 | 84 | { |
| 85 | 85 | Settings::firstOrCreate( |
| 86 | 86 | ['key' => 'app.timezone'], |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | )->update(['value' => $request->timezone]); |
| 89 | 89 | } |
| 90 | 90 | // Update the maximum file upload size |
| 91 | - if (config('filesystems.paths.max_size') !== $request->filesize) |
|
| 91 | + if(config('filesystems.paths.max_size') !== $request->filesize) |
|
| 92 | 92 | { |
| 93 | 93 | Settings::firstOrCreate( |
| 94 | 94 | ['key' => 'filesystems.paths.max_size'], |
@@ -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); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | Log::debug('Preparing to clean a file. Current Name - '.$fileName.'. Current Path - '.$path); |
| 20 | 20 | // Remove all spaces |
| 21 | 21 | $fileName = str_replace(' ', '_', $fileName); |
| 22 | - Log::debug('Cleaned Filename. Current Name - ' . $fileName . '. Current Path - ' . $path); |
|
| 22 | + Log::debug('Cleaned Filename. Current Name - '.$fileName.'. Current Path - '.$path); |
|
| 23 | 23 | |
| 24 | 24 | // Determine if the filename already exists |
| 25 | 25 | if(Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)) |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // Increase the number until one that is not in use is found |
| 45 | 45 | do |
| 46 | 46 | { |
| 47 | - Log::debug('Filename ' . $fileName . ' already exists. Appending name.'); |
|
| 47 | + Log::debug('Filename '.$fileName.' already exists. Appending name.'); |
|
| 48 | 48 | $fileName = $base.'('.++$number.')'.$extension; |
| 49 | 49 | } while(Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)); |
| 50 | 50 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | // Display all file links |
| 35 | 35 | public function userLinks() |
| 36 | 36 | { |
| 37 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 37 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 38 | 38 | |
| 39 | 39 | $userLinks = new UserCollection( |
| 40 | 40 | User::withCount([ |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | Log::notice('User '.Auth::user()->full_name.' updated User Password Policy requiring resets every '.$request->passExpire.' days'); |
| 95 | 95 | |
| 96 | 96 | // If the setting is changing from never to xx days, update all users |
| 97 | - if ($request->passExpire == 0) |
|
| 97 | + if($request->passExpire == 0) |
|
| 98 | 98 | { |
| 99 | 99 | User::whereNotNull('password_expires')->update([ |
| 100 | 100 | 'password_expires' => null |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | // View the current roles that can be assigned to users |
| 117 | 117 | public function roleSettings() |
| 118 | 118 | { |
| 119 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 119 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 120 | 120 | $this->authorize('hasAccess', 'Manage User Roles'); |
| 121 | 121 | |
| 122 | 122 | $roles = UserRoleType::with(['UserRolePermissions' => function($query) { |