@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | // Create the archive and place the version file in it |
80 | 80 | $this->zip = Zip::create(config('filesystems.disks.backup.root').DIRECTORY_SEPARATOR.$backupName); |
81 | 81 | $this->bar->advance(); |
82 | - $this->zip->add(config('filesystems.disks.backup.root') . DIRECTORY_SEPARATOR . 'version.txt'); |
|
82 | + $this->zip->add(config('filesystems.disks.backup.root').DIRECTORY_SEPARATOR.'version.txt'); |
|
83 | 83 | $this->bar->advance(); |
84 | 84 | $this->zip->add(base_path().DIRECTORY_SEPARATOR.'.env'); |
85 | 85 | $this->bar->advance(); |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | 'mysqldump tb-dev5-data -u root'); |
114 | 114 | $process->run(); |
115 | 115 | |
116 | - File::put(config('filesystems.disks.backup.root') . DIRECTORY_SEPARATOR . 'database.sql', $process->getOutput()); |
|
116 | + File::put(config('filesystems.disks.backup.root').DIRECTORY_SEPARATOR.'database.sql', $process->getOutput()); |
|
117 | 117 | $this->bar->advance(); |
118 | - $this->zip->add(config('filesystems.disks.backup.root') . DIRECTORY_SEPARATOR . 'database.sql'); |
|
118 | + $this->zip->add(config('filesystems.disks.backup.root').DIRECTORY_SEPARATOR.'database.sql'); |
|
119 | 119 | $this->bar->advance(); |
120 | 120 | } |
121 | 121 |
@@ -22,11 +22,11 @@ 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 | // Open up the file and verify it is at least the same version as the current setup |
27 | 27 | $valid = $this->openUpdate($updateFile); |
28 | 28 | |
29 | - if ($valid) |
|
29 | + if($valid) |
|
30 | 30 | { |
31 | 31 | $this->call('down'); |
32 | 32 | $this->copyFiles($updateFile); |
@@ -48,26 +48,26 @@ discard block |
||
48 | 48 | $updates = Storage::disk('staging')->files('updates'); |
49 | 49 | |
50 | 50 | // Cycle through each file in the update directory to see if they are update files |
51 | - foreach ($updates as $update) |
|
51 | + foreach($updates as $update) |
|
52 | 52 | { |
53 | 53 | $baseName = explode('/', $update)[1]; |
54 | 54 | |
55 | 55 | // Verify the file is in the .zip format |
56 | 56 | $fileParts = pathinfo($baseName); |
57 | - if ($fileParts['extension'] == 'zip') |
|
57 | + if($fileParts['extension'] == 'zip') |
|
58 | 58 | { |
59 | 59 | // Verify this is actually an update file |
60 | - $zip = Zip::open(config('filesystems.disks.staging.root') . |
|
61 | - DIRECTORY_SEPARATOR . 'updates' . DIRECTORY_SEPARATOR . $baseName); |
|
60 | + $zip = Zip::open(config('filesystems.disks.staging.root'). |
|
61 | + DIRECTORY_SEPARATOR.'updates'.DIRECTORY_SEPARATOR.$baseName); |
|
62 | 62 | $files = $zip->listFiles(); |
63 | - if (in_array($fileParts['filename'] . '/config/version.yml', $files)) |
|
63 | + if(in_array($fileParts['filename'].'/config/version.yml', $files)) |
|
64 | 64 | { |
65 | 65 | $updateList[] = $baseName; |
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - if (empty($updateList)) |
|
70 | + if(empty($updateList)) |
|
71 | 71 | { |
72 | 72 | $this->error('No updates have been loaded to the system'); |
73 | 73 | $this->error('Please upload update package to the Storage/Staging/Updates folder'); |
@@ -75,15 +75,15 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // Determine if there is more than one update that can be applied |
78 | - if (count($updateList) > 1) |
|
78 | + if(count($updateList) > 1) |
|
79 | 79 | { |
80 | 80 | $this->line(''); |
81 | 81 | |
82 | 82 | $anticipate = []; |
83 | - foreach ($updateList as $key => $up) { |
|
83 | + foreach($updateList as $key => $up) { |
|
84 | 84 | $opt = $key + 1; |
85 | 85 | $anticipate[$opt] = $up; |
86 | - $this->line('[' . $opt . '] ' . $up); |
|
86 | + $this->line('['.$opt.'] '.$up); |
|
87 | 87 | } |
88 | 88 | $updateFile = $this->choice('Please select which update you would like to load', $anticipate); |
89 | 89 | } |
@@ -101,21 +101,21 @@ discard block |
||
101 | 101 | $fileParts = pathinfo($file); |
102 | 102 | $folder = $fileParts['filename']; |
103 | 103 | |
104 | - $zip = Zip::open(config('filesystems.disks.staging.root') . |
|
105 | - DIRECTORY_SEPARATOR . 'updates' . DIRECTORY_SEPARATOR . $file); |
|
104 | + $zip = Zip::open(config('filesystems.disks.staging.root'). |
|
105 | + DIRECTORY_SEPARATOR.'updates'.DIRECTORY_SEPARATOR.$file); |
|
106 | 106 | |
107 | - $zip->extract(config('filesystems.disks.staging.root') . |
|
108 | - DIRECTORY_SEPARATOR . 'updates' . DIRECTORY_SEPARATOR . 'tmp'); |
|
107 | + $zip->extract(config('filesystems.disks.staging.root'). |
|
108 | + DIRECTORY_SEPARATOR.'updates'.DIRECTORY_SEPARATOR.'tmp'); |
|
109 | 109 | $zip->close(); |
110 | 110 | |
111 | - $verFile = fopen(config('filesystems.disks.staging.root') . |
|
112 | - DIRECTORY_SEPARATOR . 'updates' . DIRECTORY_SEPARATOR . 'tmp' . |
|
113 | - DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . 'config' . |
|
114 | - DIRECTORY_SEPARATOR . 'version.yml', 'r'); |
|
111 | + $verFile = fopen(config('filesystems.disks.staging.root'). |
|
112 | + DIRECTORY_SEPARATOR.'updates'.DIRECTORY_SEPARATOR.'tmp'. |
|
113 | + DIRECTORY_SEPARATOR.$folder.DIRECTORY_SEPARATOR.'config'. |
|
114 | + DIRECTORY_SEPARATOR.'version.yml', 'r'); |
|
115 | 115 | |
116 | 116 | $verData = []; |
117 | 117 | $i = 0; |
118 | - while (!feof( |
|
118 | + while(!feof( |
|
119 | 119 | /** @scrutinizer ignore-type */ |
120 | 120 | $verFile)) |
121 | 121 | { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $verFile); |
125 | 125 | $data = explode(':', $line); |
126 | 126 | |
127 | - if (($data[0] === ' major' || $data[0] === ' minor' || $data[0] === ' patch') && $i < 3) |
|
127 | + if(($data[0] === ' major' || $data[0] === ' minor' || $data[0] === ' patch') && $i < 3) |
|
128 | 128 | { |
129 | 129 | $verData[trim($data[0])] = trim($data[1]); |
130 | 130 | $i++; |
@@ -134,15 +134,15 @@ discard block |
||
134 | 134 | $curVersion = new \PragmaRX\Version\Package\Version(); |
135 | 135 | |
136 | 136 | $valid = false; |
137 | - if ($verData['major'] > $curVersion->major()) |
|
137 | + if($verData['major'] > $curVersion->major()) |
|
138 | 138 | { |
139 | 139 | $valid = true; |
140 | 140 | } |
141 | - else if ($verData['minor'] > $curVersion->minor()) |
|
141 | + else if($verData['minor'] > $curVersion->minor()) |
|
142 | 142 | { |
143 | 143 | $valid = true; |
144 | 144 | } |
145 | - else if ($verData['patch'] >= $curVersion->patch()) |
|
145 | + else if($verData['patch'] >= $curVersion->patch()) |
|
146 | 146 | { |
147 | 147 | $valid = true; |
148 | 148 | } |
@@ -156,24 +156,24 @@ discard block |
||
156 | 156 | $fileParts = pathinfo($updateFile); |
157 | 157 | $folder = $fileParts['filename']; |
158 | 158 | |
159 | - $updateFile = config('filesystems.disks.staging.root') . |
|
160 | - DIRECTORY_SEPARATOR . 'updates' . DIRECTORY_SEPARATOR . 'tmp' . |
|
161 | - DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR; |
|
159 | + $updateFile = config('filesystems.disks.staging.root'). |
|
160 | + DIRECTORY_SEPARATOR.'updates'.DIRECTORY_SEPARATOR.'tmp'. |
|
161 | + DIRECTORY_SEPARATOR.$folder.DIRECTORY_SEPARATOR; |
|
162 | 162 | |
163 | 163 | // Copy files |
164 | - File::copyDirectory($updateFile . 'app', base_path() . DIRECTORY_SEPARATOR . 'app'); |
|
165 | - File::copyDirectory($updateFile . 'bootstrap', base_path() . DIRECTORY_SEPARATOR . 'bootstrap'); |
|
166 | - File::copyDirectory($updateFile . 'config', base_path() . DIRECTORY_SEPARATOR . 'config'); |
|
167 | - File::copyDirectory($updateFile . 'database', base_path() . DIRECTORY_SEPARATOR . 'database'); |
|
168 | - File::copyDirectory($updateFile . 'resources', base_path() . DIRECTORY_SEPARATOR . 'resources'); |
|
169 | - File::copyDirectory($updateFile . 'routes', base_path() . DIRECTORY_SEPARATOR . 'routes'); |
|
164 | + File::copyDirectory($updateFile.'app', base_path().DIRECTORY_SEPARATOR.'app'); |
|
165 | + File::copyDirectory($updateFile.'bootstrap', base_path().DIRECTORY_SEPARATOR.'bootstrap'); |
|
166 | + File::copyDirectory($updateFile.'config', base_path().DIRECTORY_SEPARATOR.'config'); |
|
167 | + File::copyDirectory($updateFile.'database', base_path().DIRECTORY_SEPARATOR.'database'); |
|
168 | + File::copyDirectory($updateFile.'resources', base_path().DIRECTORY_SEPARATOR.'resources'); |
|
169 | + File::copyDirectory($updateFile.'routes', base_path().DIRECTORY_SEPARATOR.'routes'); |
|
170 | 170 | |
171 | 171 | // Run Composer Updates |
172 | - exec('cd ' . base_path() . ' && composer install --no-dev --no-interaction --optimize-autoloader --no-ansi > /dev/null 2>&1'); |
|
172 | + exec('cd '.base_path().' && composer install --no-dev --no-interaction --optimize-autoloader --no-ansi > /dev/null 2>&1'); |
|
173 | 173 | $this->call('ziggy:generate'); |
174 | 174 | // Run NPM |
175 | - exec('cd ' . base_path() . ' && npm install --only=production > /dev/null 2>&1'); |
|
176 | - exec('cd ' . base_path() . ' && npm run production > /dev/null 2>&1'); |
|
175 | + exec('cd '.base_path().' && npm install --only=production > /dev/null 2>&1'); |
|
176 | + exec('cd '.base_path().' && npm run production > /dev/null 2>&1'); |
|
177 | 177 | |
178 | 178 | // Update the database |
179 | 179 | $this->call('migrate', ['--force' => 'default']); |
@@ -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); |
@@ -92,7 +92,7 @@ |
||
92 | 92 | /** @scrutinizer ignore-type */ |
93 | 93 | $this->argument('filename')); |
94 | 94 | $this->baseName = $fileParts['filename']; |
95 | - $this->archive = Zip::open(config('filesystems.disks.backup.root') . DIRECTORY_SEPARATOR . |
|
95 | + $this->archive = Zip::open(config('filesystems.disks.backup.root').DIRECTORY_SEPARATOR. |
|
96 | 96 | /** @scrutinizer ignore-type */ |
97 | 97 | $this->argument('filename')); |
98 | 98 | // if (!$this->archive->has('version.txt')) { |
@@ -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(); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // Admin landing page |
27 | 27 | public function index() |
28 | 28 | { |
29 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
29 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
30 | 30 | return view('admin.index'); |
31 | 31 | } |
32 | 32 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | ->makeVisible('user_id') |
46 | 46 | ); |
47 | 47 | |
48 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
48 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
49 | 49 | return view('admin.userLinks', [ |
50 | 50 | 'links' => $userLinks, |
51 | 51 | ]); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $user = User::find($id); |
58 | 58 | |
59 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
59 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
60 | 60 | Log::debug('User Link Data:', $user->toArray()); |
61 | 61 | return view('admin.linkDetails', [ |
62 | 62 | 'user' => $user, |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | public function passwordPolicy() |
68 | 68 | { |
69 | 69 | $this->authorize('hasAccess', 'Manage Users'); |
70 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
70 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
71 | 71 | return view('admin.userSecurity', [ |
72 | 72 | 'passExpire' => config('auth.passwords.settings.expire'), |
73 | 73 | ]); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | // Submit the form to change the user password policy |
77 | 77 | public function submitPolicy(Request $request) |
78 | 78 | { |
79 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data:', $request->toArray()); |
|
79 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data:', $request->toArray()); |
|
80 | 80 | $this->authorize('hasAccess', 'Manage Users'); |
81 | 81 | |
82 | 82 | $request->validate([ |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | Log::notice('User '.Auth::user()->full_name.' updated User Password Policy'); |
91 | 91 | |
92 | 92 | // If the setting is changing from never to xx days, update all users |
93 | - if ($request->passExpire == 0) { |
|
93 | + if($request->passExpire == 0) { |
|
94 | 94 | User::whereNotNull('password_expires')->update([ |
95 | 95 | 'password_expires' => null |
96 | 96 | ]); |
@@ -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 | { |
116 | 116 | $query->join('user_role_permission_types', 'user_role_permission_types.perm_type_id', '=', 'user_role_permissions.perm_type_id'); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | public function submitRoleSettings(Request $request) |
129 | 129 | { |
130 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data: ', $request->toArray()); |
|
130 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data: ', $request->toArray()); |
|
131 | 131 | $this->authorize('hasAccess', 'Manage User Roles'); |
132 | 132 | |
133 | 133 | $request->validate([ |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | 'name' => $request->name, |
166 | 166 | 'description' => $request->description, |
167 | 167 | ]); |
168 | - foreach ($request->permissions as $perm) |
|
168 | + foreach($request->permissions as $perm) |
|
169 | 169 | { |
170 | 170 | UserRolePermissions::create([ |
171 | 171 | 'role_id' => $role->role_id, |
@@ -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 | [ |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function __construct() |
26 | 26 | { |
27 | 27 | $this->middleware('auth')->except('initializeUser', 'submitInitializeUser'); |
28 | - $this->middleware(function ($request, $next) { |
|
28 | + $this->middleware(function($request, $next) { |
|
29 | 29 | $this->authorize('hasAccess', 'Manage Users'); |
30 | 30 | return $next($request); |
31 | 31 | }); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $userList = User::with('LastUserLogin')->get()->makeVisible('user_id'); |
38 | 38 | $route = 'admin.user.edit'; |
39 | 39 | |
40 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
40 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
41 | 41 | Log::debug('User list:', $userList->toArray()); |
42 | 42 | return view('admin.userIndex', [ |
43 | 43 | 'userList' => $userList, |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | // Check if a username is in use |
49 | 49 | public function checkUser($username, $type) |
50 | 50 | { |
51 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data:', ['username' => $username, 'type' => $type]); |
|
51 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data:', ['username' => $username, 'type' => $type]); |
|
52 | 52 | $user = User::where($type, $username)->first(); |
53 | 53 | |
54 | 54 | if(!$user) |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
94 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
95 | 95 | Log::debug('Role data: ', $roleArr); |
96 | 96 | return view('admin.newUser', [ |
97 | 97 | 'roles' => $roleArr |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | // Submit the Add User form |
102 | 102 | public function store(Request $request) |
103 | 103 | { |
104 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data:', $request->toArray()); |
|
104 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data:', $request->toArray()); |
|
105 | 105 | // Validate the new user form |
106 | 106 | $request->validate([ |
107 | 107 | 'role' => 'required|numeric|exists:user_role_types,role_id', |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | // List all inactive users |
146 | 146 | public function show($type) |
147 | 147 | { |
148 | - $route = ''; |
|
148 | + $route = ''; |
|
149 | 149 | |
150 | 150 | if($type !== 'inactive') |
151 | 151 | { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | ->makeVisible('user_id')); |
157 | 157 | // dd($userList); |
158 | 158 | |
159 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
159 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
160 | 160 | |
161 | 161 | return view('admin.userDeleted', [ |
162 | 162 | 'userList' => $userList, |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | $roles = UserRoleType::all(); |
172 | 172 | $user = new UserResource(User::findOrFail($id)); |
173 | 173 | |
174 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
174 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
175 | 175 | |
176 | 176 | // Make sure that the user is not trying to edit someone with more permissions |
177 | - if ($user->role_id < Auth::user()->role_id) |
|
177 | + if($user->role_id < Auth::user()->role_id) |
|
178 | 178 | { |
179 | 179 | Log::warning('User '.Auth::user()->full_name.' tried to update a user that has more permissions than they do. This request was denied.'); |
180 | 180 | return abort(403); |
@@ -182,10 +182,10 @@ 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 | + if($role->role_id == 1 && Auth::user()->role_id != 1) { |
|
187 | 187 | continue; |
188 | - } else if ($role->role_id == 2 && Auth::user()->role_id > 1) { |
|
188 | + } else if($role->role_id == 2 && Auth::user()->role_id > 1) { |
|
189 | 189 | continue; |
190 | 190 | } else { |
191 | 191 | // $roleArr[$role->role_id] = $role->name; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | // Reactivate a disabled user |
209 | 209 | public function reactivateUser($id) |
210 | 210 | { |
211 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
211 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
212 | 212 | User::withTrashed()->where('user_id', $id)->restore(); |
213 | 213 | |
214 | 214 | Log::info('User ID '.$id.' reactivated by '.Auth::user()->full_name); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | // Submit the update user form |
221 | 221 | public function update(Request $request, $id) |
222 | 222 | { |
223 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data:', $request->toArray()); |
|
223 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data:', $request->toArray()); |
|
224 | 224 | $request->validate([ |
225 | 225 | 'username' => [ |
226 | 226 | 'required', |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | // Update the user data |
239 | 239 | $user = User::findOrFail($id); |
240 | 240 | |
241 | - if ($user->role_id < Auth::user()->role_id) |
|
241 | + if($user->role_id < Auth::user()->role_id) |
|
242 | 242 | { |
243 | 243 | return abort(403); |
244 | 244 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | // Submit the change password form |
261 | 261 | public function submitPassword(Request $request) |
262 | 262 | { |
263 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
263 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
264 | 264 | |
265 | 265 | $request->validate([ |
266 | 266 | 'password' => 'required|string|min:6|confirmed', |
@@ -279,12 +279,12 @@ discard block |
||
279 | 279 | $user = User::find($request->user_id); |
280 | 280 | |
281 | 281 | // Verify this is a valid user ID |
282 | - if (!$user) { |
|
282 | + if(!$user) { |
|
283 | 283 | $success = false; |
284 | 284 | $reason = 'Cannot find user with this ID'; |
285 | 285 | } |
286 | 286 | // Make sure that the user is not trying to deactivate someone with more permissions |
287 | - else if ($user->role_id < Auth::user()->role_id) { |
|
287 | + else if($user->role_id < Auth::user()->role_id) { |
|
288 | 288 | $success = false; |
289 | 289 | $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 | 290 | } |
@@ -297,10 +297,10 @@ discard block |
||
297 | 297 | 'password_expires' => $nextChange |
298 | 298 | ]); |
299 | 299 | $success = true; |
300 | - $reason = 'Password for ' . $user->full_name . ' successfully reset.'; |
|
300 | + $reason = 'Password for '.$user->full_name.' successfully reset.'; |
|
301 | 301 | } |
302 | 302 | |
303 | - Log::info('User ID-' . $request->user_id . ' password chagned by ' . Auth::user()->Full_name, [ |
|
303 | + Log::info('User ID-'.$request->user_id.' password chagned by '.Auth::user()->Full_name, [ |
|
304 | 304 | 'success' => $success, |
305 | 305 | 'reason' => $reason, |
306 | 306 | ]); |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $reason = 'User '.$user->full_name.' successfully deactivated.'; |
344 | 344 | } |
345 | 345 | |
346 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
346 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
347 | 347 | Log::notice('User ID-'.$id.' disabled by '.Auth::user()->full_name, [ |
348 | 348 | 'success' => $success, |
349 | 349 | 'reason' => $reason, |
@@ -29,7 +29,8 @@ discard block |
||
29 | 29 | |
30 | 30 | // Determine if the note should go to the customer, or its parent |
31 | 31 | $details = Customers::find($request->cust_id); |
32 | - if ($details->parent_id && $request->shared == 'true') { |
|
32 | + if ($details->parent_id && $request->shared == 'true') |
|
33 | + { |
|
33 | 34 | $request->cust_id = $details->parent_id; |
34 | 35 | } |
35 | 36 | |
@@ -55,7 +56,8 @@ discard block |
||
55 | 56 | |
56 | 57 | // Determine if there is a parent site with shared notes |
57 | 58 | $parent = Customers::find($id)->parent_id; |
58 | - if ($parent) { |
|
59 | + if ($parent) |
|
60 | + { |
|
59 | 61 | $parentList = CustomerNotes::where('cust_id', $parent)->where('shared', 1)->orderBy('urgent', 'desc')->get(); |
60 | 62 | |
61 | 63 | $notes = $notes->merge($parentList); |
@@ -76,7 +78,8 @@ discard block |
||
76 | 78 | ]); |
77 | 79 | |
78 | 80 | $details = Customers::find($request->cust_id); |
79 | - if ($details->parent_id && $request->shared == 'true') { |
|
81 | + if ($details->parent_id && $request->shared == 'true') |
|
82 | + { |
|
80 | 83 | $request->cust_id = $details->parent_id; |
81 | 84 | } |
82 | 85 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | // Store a new customer note |
22 | 22 | public function store(Request $request) |
23 | 23 | { |
24 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
24 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
25 | 25 | |
26 | 26 | $request->validate([ |
27 | 27 | 'cust_id' => 'required|numeric', |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | // Determine if the note should go to the customer, or its parent |
33 | 33 | $details = Customers::find($request->cust_id); |
34 | - if ($details->parent_id && $request->shared == 'true') { |
|
34 | + if($details->parent_id && $request->shared == 'true') { |
|
35 | 35 | $request->cust_id = $details->parent_id; |
36 | 36 | } |
37 | 37 | |
@@ -55,20 +55,20 @@ discard block |
||
55 | 55 | |
56 | 56 | // Determine if there is a parent site with shared notes |
57 | 57 | $parent = Customers::find($id)->parent_id; |
58 | - if ($parent) { |
|
58 | + if($parent) { |
|
59 | 59 | $parentList = CustomerNotes::where('cust_id', $parent)->where('shared', 1)->orderBy('urgent', 'desc')->get(); |
60 | 60 | |
61 | 61 | $notes = $notes->merge($parentList); |
62 | 62 | } |
63 | 63 | |
64 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
64 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
65 | 65 | return $notes; |
66 | 66 | } |
67 | 67 | |
68 | 68 | // Update a customer note |
69 | 69 | public function update(Request $request, $id) |
70 | 70 | { |
71 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
71 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
72 | 72 | |
73 | 73 | $request->validate([ |
74 | 74 | 'cust_id' => 'required', |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ]); |
78 | 78 | |
79 | 79 | $details = Customers::find($request->cust_id); |
80 | - if ($details->parent_id && $request->shared == 'true') { |
|
80 | + if($details->parent_id && $request->shared == 'true') { |
|
81 | 81 | $request->cust_id = $details->parent_id; |
82 | 82 | } |
83 | 83 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | CustomerNotes::find($id)->delete(); |
100 | 100 | |
101 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
101 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
102 | 102 | Log::notice('Customer Note ID - '.$id.' deleted by '.Auth::user()->full_name); |
103 | 103 | return response()->json(['success' => true]); |
104 | 104 | } |
@@ -12,10 +12,10 @@ |
||
12 | 12 | public function run() |
13 | 13 | { |
14 | 14 | // TODO: add seeders for demo setup |
15 | - $this->call(UserTableSeeder::class); |
|
16 | - $this->call(EquipmentSeeder::class); |
|
17 | - $this->call(CustomerSeeder::class); |
|
18 | - $this->call(TechTipsSeeder::class); |
|
19 | - $this->call(ConfigSeeder::class); |
|
15 | + $this->call(UserTableSeeder::class); |
|
16 | + $this->call(EquipmentSeeder::class); |
|
17 | + $this->call(CustomerSeeder::class); |
|
18 | + $this->call(TechTipsSeeder::class); |
|
19 | + $this->call(ConfigSeeder::class); |
|
20 | 20 | } |
21 | 21 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Submit the new customer form |
34 | 34 | public function store(Request $request) |
35 | 35 | { |
36 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
36 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
37 | 37 | $this->authorize('hasAccess', 'Add Customer'); |
38 | 38 | |
39 | 39 | $request->validate([ |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ]); |
73 | 73 | |
74 | 74 | Log::notice('New Customer ID-'.$request->custID.' created by '.Auth::user()->full_name); |
75 | - return response()->json(['success' => true, 'cust_id' => $custData->cust_id ]); |
|
75 | + return response()->json(['success' => true, 'cust_id' => $custData->cust_id]); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | // Show the customer details |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $fileTypes = new CustomerFileTypesCollection(CustomerFileTypes::all()); |
92 | 92 | $parent = $custDetails->parent_id ? Customers::find($custDetails->parent_id)->name : null; |
93 | 93 | |
94 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
94 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
95 | 95 | return view('customer.details', [ |
96 | 96 | 'cust_id' => $custDetails->cust_id, |
97 | 97 | 'details' => $custDetails->toJson(), |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | // Update the customer details |
107 | 107 | public function update(Request $request, $id) |
108 | 108 | { |
109 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
109 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
110 | 110 | |
111 | 111 | $request->validate([ |
112 | 112 | 'name' => 'required', |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | // Link a site to a parent site |
136 | 136 | public function linkParent(Request $request) |
137 | 137 | { |
138 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
138 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
139 | 139 | |
140 | 140 | $request->validate([ |
141 | 141 | 'parent_id' => 'required|numeric|exists:customers,cust_id', |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | $parentsParent = Customers::find($request->parent_id); |
146 | 146 | |
147 | - if ($parentsParent->parent_id) |
|
147 | + if($parentsParent->parent_id) |
|
148 | 148 | { |
149 | 149 | $request->parent_id = $parentsParent->parent_id; |
150 | 150 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | public function removeParent($id) |
162 | 162 | { |
163 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
163 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
164 | 164 | Customers::find($id)->update(['parent_id' => null]); |
165 | 165 | Log::info('Parent Customer ID was removed for Customer ID '.$id.' by '.Auth::user()->full_name); |
166 | 166 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | // Deactivate a customer - note this will not remove it from the database, but make it inaccessable |
169 | 169 | public function destroy($id) |
170 | 170 | { |
171 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
171 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
172 | 172 | $this->authorize('hasAccess', 'Deactivate Customer'); |
173 | 173 | |
174 | 174 | // Remove the customer from any users favorites |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // Get the possible system types that can be assigned to the customer |
25 | 25 | public function index() |
26 | 26 | { |
27 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
27 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
28 | 28 | $sysList = new CategoriesCollection(SystemCategories::with('SystemTypes')->with('SystemTypes.SystemDataFields.SystemDataFieldTypes')->get()); |
29 | 29 | |
30 | 30 | return $sysList; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Store a new system for the customer |
34 | 34 | public function store(Request $request) |
35 | 35 | { |
36 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
36 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
37 | 37 | |
38 | 38 | $request->validate([ |
39 | 39 | 'cust_id' => 'required', |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | // Get the list of systems attached to the customer |
77 | 77 | public function show($id) |
78 | 78 | { |
79 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
79 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
80 | 80 | |
81 | 81 | $sysList = CustomerSystems::where('cust_id', $id) |
82 | 82 | ->with('SystemTypes') |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | // Update the customers system data |
106 | 106 | public function update(Request $request, $id) |
107 | 107 | { |
108 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
108 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
109 | 109 | |
110 | 110 | $request->validate([ |
111 | 111 | 'cust_id' => 'required', |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | foreach($fields as $data) |
126 | 126 | { |
127 | - $fieldName = 'field_' . $data->field_id; |
|
127 | + $fieldName = 'field_'.$data->field_id; |
|
128 | 128 | if(isset($request->$fieldName)) |
129 | 129 | { |
130 | 130 | Log::debug($request->$fieldName); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | // Delete a system attached to a customer |
143 | 143 | public function destroy($id) |
144 | 144 | { |
145 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
145 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
146 | 146 | |
147 | 147 | // return response('deleted '.$id); |
148 | 148 | $system = CustomerSystems::find($id); |