Passed
Push — dev5 ( 0d97ef...978ab8 )
by Ron
08:29
created
app/Console/Commands/updateRun.php 2 patches
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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']);
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/Console/Commands/backupRestore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
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')) {
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/AdminController.php 2 patches
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/UserController.php 2 patches
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -182,12 +182,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             [
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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::notice('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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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::notice('User ID-' . $request->user_id . ' password chagned by ' . Auth::user()->Full_name, [
303
+        Log::notice('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
 block discarded – undo
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,
Please login to merge, or discard this patch.
app/Policies/GatePolicy.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
54 54
             ->get();
55 55
 
56 56
         $allow = $data->isEmpty() ? 'Denied' : 'Allowed';
57
-        Log::debug('User ' . $user->full_name . ' is trying to access admin link.  Result - ' . $allow);
57
+        Log::debug('User '.$user->full_name.' is trying to access admin link.  Result - '.$allow);
58 58
 
59 59
         return  $data->isEmpty() ? false : true;
60 60
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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,7 +77,7 @@  discard block
 block discarded – undo
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);
80
+        Log::debug('User '.$user->full_name.' is trying to access '.$task.'.  Result - '.$allow);
81 81
 
82 82
         return  $data->isEmpty() ? false : true;
83 83
     }
Please login to merge, or discard this patch.
app/Http/Controllers/FileLinks/FileLinksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
             $id = Auth::user()->user_id;
55 55
         }
56 56
         //  If the user is trying to pull someone elses links, they must be able to manage users
57
-        else if ($id != Auth::user()->user_id)
57
+        else if($id != Auth::user()->user_id)
58 58
         {
59 59
             $this->authorize('hasAccess', 'manage_users');
60 60
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Customers/CustomerNotesController.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
             $request->cust_id = $details->parent_id;
34 34
         }
35 35
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
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);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         ]);
77 77
 
78 78
         $details = Customers::find($request->cust_id);
79
-        if ($details->parent_id && $request->shared == 'true') {
79
+        if($details->parent_id && $request->shared == 'true') {
80 80
             $request->cust_id = $details->parent_id;
81 81
         }
82 82
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/InitializeUserController.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
         //  Validate the hash token
26 26
         $user = UserInitialize::where('token', $hash)->get();
27 27
 
28
-        if ($user->isEmpty()) {
29
-            Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to access invalid initialize hash - ' . $hash);
28
+        if($user->isEmpty()) {
29
+            Log::warning('Visitor at IP Address '.\Request::ip().' tried to access invalid initialize hash - '.$hash);
30 30
             return abort(404);
31 31
         }
32 32
 
33
-        Log::debug('Route ' . Route::currentRouteName() . ' visited.');
34
-        Log::debug('Link Hash -' . $hash);
33
+        Log::debug('Route '.Route::currentRouteName().' visited.');
34
+        Log::debug('Link Hash -'.$hash);
35 35
         return view('account.initializeUser', ['hash' => $hash]);
36 36
     }
37 37
 
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
     {
41 41
         //  Verify that the link matches the assigned email address
42 42
         $valid = UserInitialize::where('token', $hash)->first();
43
-        if (empty($valid)) {
44
-            Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to submit an invalid User Initialization link - ' . $hash);
43
+        if(empty($valid)) {
44
+            Log::warning('Visitor at IP Address '.\Request::ip().' tried to submit an invalid User Initialization link - '.$hash);
45 45
             return abort(404);
46 46
         }
47 47
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         Auth::loginUsingID($userData->user_id);
75 75
 
76 76
         //  Redirect the user to the dashboard
77
-        Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
77
+        Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id);
78 78
         Log::debug('Initialize Data - ', $request->toArray());
79 79
         Log::notice('User has setup account', ['user_id' => $userData->user_id]);
80 80
         return redirect(route('dashboard'));
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@  discard block
 block discarded – undo
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
         }
@@ -40,7 +41,8 @@  discard block
 block discarded – undo
40 41
     {
41 42
         //  Verify that the link matches the assigned email address
42 43
         $valid = UserInitialize::where('token', $hash)->first();
43
-        if (empty($valid)) {
44
+        if (empty($valid))
45
+        {
44 46
             Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to submit an invalid User Initialization link - ' . $hash);
45 47
             return abort(404);
46 48
         }
Please login to merge, or discard this patch.
database/factories/UserInitializeFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use App\Model;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(App\UserInitialize::class, function (Faker $faker) {
8
+$factory->define(App\UserInitialize::class, function(Faker $faker) {
9 9
     return [
10 10
         'username' => factory(App\User::class)->create()->username,
11 11
         'token' => strtolower(Str::random(30)),
Please login to merge, or discard this patch.