@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%') |
| 58 | 58 | ->whereHas('TechTipSystems', function($q) use($request) |
| 59 | 59 | { |
| 60 | - $q->where('sys_id', $request->system); |
|
| 60 | + $q->where('sys_id', $request->system); |
|
| 61 | 61 | }) |
| 62 | 62 | ->get(); |
| 63 | 63 | } |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | $q->where('sys_id', $request->system); |
| 61 | 61 | }) |
| 62 | 62 | ->get(); |
| 63 | - } |
|
| 64 | - else |
|
| 63 | + } else |
|
| 65 | 64 | { |
| 66 | 65 | $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%') |
| 67 | 66 | ->get(); |
@@ -118,8 +117,7 @@ discard block |
||
| 118 | 117 | 'sys_id' => $tag |
| 119 | 118 | ]); |
| 120 | 119 | } |
| 121 | - } |
|
| 122 | - else |
|
| 120 | + } else |
|
| 123 | 121 | { |
| 124 | 122 | TechTipSystems::create([ |
| 125 | 123 | 'tip_id' => $tipID, |
@@ -158,8 +156,7 @@ discard block |
||
| 158 | 156 | try |
| 159 | 157 | { |
| 160 | 158 | Mail::to($userList)->send(new newTechtip($tipData)); |
| 161 | - } |
|
| 162 | - catch(Exception $e) |
|
| 159 | + } catch(Exception $e) |
|
| 163 | 160 | { |
| 164 | 161 | report($e); |
| 165 | 162 | } |
@@ -285,8 +282,7 @@ discard block |
||
| 285 | 282 | 'sys_id' => $tag |
| 286 | 283 | ]); |
| 287 | 284 | } |
| 288 | - } |
|
| 289 | - else |
|
| 285 | + } else |
|
| 290 | 286 | { |
| 291 | 287 | TechTipSystems::create([ |
| 292 | 288 | 'tip_id' => $id, |
@@ -308,8 +304,7 @@ discard block |
||
| 308 | 304 | Files::deleteFile($file->file_id); |
| 309 | 305 | } |
| 310 | 306 | } |
| 311 | - } |
|
| 312 | - else |
|
| 307 | + } else |
|
| 313 | 308 | { |
| 314 | 309 | TechTipFiles::where('tip_id', $id)->delete(); |
| 315 | 310 | } |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | ->get(); |
| 37 | 37 | |
| 38 | 38 | $sysArr = []; |
| 39 | - foreach($systems as $sys) |
|
| 39 | + foreach ($systems as $sys) |
|
| 40 | 40 | { |
| 41 | - foreach($sys->SystemTypes as $s) |
|
| 41 | + foreach ($sys->SystemTypes as $s) |
|
| 42 | 42 | { |
| 43 | 43 | $sysArr[$sys->name][$s->sys_id] = $s->name; |
| 44 | 44 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public function search(Request $request) |
| 54 | 54 | { |
| 55 | 55 | // Run different request based on if system field is filled out or not |
| 56 | - if(!empty($request->system)) |
|
| 56 | + if (!empty($request->system)) |
|
| 57 | 57 | { |
| 58 | 58 | $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%') |
| 59 | 59 | ->whereHas('TechTipSystems', function($q) use($request) |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | ->get(); |
| 83 | 83 | |
| 84 | 84 | $sysArr = []; |
| 85 | - foreach($systems as $sys) |
|
| 85 | + foreach ($systems as $sys) |
|
| 86 | 86 | { |
| 87 | - foreach($sys->SystemTypes as $s) |
|
| 87 | + foreach ($sys->SystemTypes as $s) |
|
| 88 | 88 | { |
| 89 | 89 | $sysArr[$sys->name][$s->sys_id] = $s->name; |
| 90 | 90 | } |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | $tipID = $tip->tip_id; |
| 117 | 117 | |
| 118 | 118 | // Enter all system tags associated with the tip |
| 119 | - if(is_array($request->sysTags)) |
|
| 119 | + if (is_array($request->sysTags)) |
|
| 120 | 120 | { |
| 121 | - foreach($request->sysTags as $tag) |
|
| 121 | + foreach ($request->sysTags as $tag) |
|
| 122 | 122 | { |
| 123 | 123 | TechTipSystems::create([ |
| 124 | 124 | 'tip_id' => $tipID, |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // If there are any files, process them |
| 138 | - if(!empty($request->file)) |
|
| 138 | + if (!empty($request->file)) |
|
| 139 | 139 | { |
| 140 | 140 | $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$tipID; |
| 141 | - foreach($request->file as $file) |
|
| 141 | + foreach ($request->file as $file) |
|
| 142 | 142 | { |
| 143 | 143 | // Clean the file and store it |
| 144 | 144 | $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName()); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | { |
| 167 | 167 | Mail::to($userList)->send(new newTechtip($tipData)); |
| 168 | 168 | } |
| 169 | - catch(Exception $e) |
|
| 169 | + catch (Exception $e) |
|
| 170 | 170 | { |
| 171 | 171 | report($e); |
| 172 | 172 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | public function details($id, $name) |
| 195 | 195 | { |
| 196 | 196 | $tipData = TechTips::where('tip_id', $id)->with('user')->first(); |
| 197 | - if(empty($tipData)) |
|
| 197 | + if (empty($tipData)) |
|
| 198 | 198 | { |
| 199 | 199 | Log::warning('User ID-'.Auth::user()->user_id.' tried to access invlaid Tech Tip ID-'.$id.' Name-'.$name); |
| 200 | 200 | return view('errors.tipNotFound'); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | public function edit($id) |
| 264 | 264 | { |
| 265 | 265 | $tipData = TechTips::find($id); |
| 266 | - if(empty($tipData)) |
|
| 266 | + if (empty($tipData)) |
|
| 267 | 267 | { |
| 268 | 268 | return 'tip not found'; |
| 269 | 269 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | ->first(); |
| 282 | 282 | |
| 283 | 283 | $tipS = []; |
| 284 | - foreach($tipSys as $s) |
|
| 284 | + foreach ($tipSys as $s) |
|
| 285 | 285 | { |
| 286 | 286 | $tipS[] = $s->sys_id; |
| 287 | 287 | } |
@@ -292,9 +292,9 @@ discard block |
||
| 292 | 292 | ->get(); |
| 293 | 293 | |
| 294 | 294 | $sysArr = []; |
| 295 | - foreach($systems as $sys) |
|
| 295 | + foreach ($systems as $sys) |
|
| 296 | 296 | { |
| 297 | - foreach($sys->SystemTypes as $s) |
|
| 297 | + foreach ($sys->SystemTypes as $s) |
|
| 298 | 298 | { |
| 299 | 299 | $sysArr[$sys->name][$s->sys_id] = $s->name; |
| 300 | 300 | } |
@@ -330,9 +330,9 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | // Enter all system tags associated with the tip after destroying the existing systems |
| 332 | 332 | TechTipSystems::where('tip_id', $id)->delete(); |
| 333 | - if(is_array($request->sysTags)) |
|
| 333 | + if (is_array($request->sysTags)) |
|
| 334 | 334 | { |
| 335 | - foreach($request->sysTags as $tag) |
|
| 335 | + foreach ($request->sysTags as $tag) |
|
| 336 | 336 | { |
| 337 | 337 | TechTipSystems::create([ |
| 338 | 338 | 'tip_id' => $id, |
@@ -350,13 +350,13 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | // Determine if any files were removed |
| 352 | 352 | $tipFiles = TechTipFiles::where('tip_id', $id)->get(); |
| 353 | - if(!$tipFiles->isEmpty()) |
|
| 353 | + if (!$tipFiles->isEmpty()) |
|
| 354 | 354 | { |
| 355 | - if(!empty($request->existingFile)) |
|
| 355 | + if (!empty($request->existingFile)) |
|
| 356 | 356 | { |
| 357 | - foreach($tipFiles as $file) |
|
| 357 | + foreach ($tipFiles as $file) |
|
| 358 | 358 | { |
| 359 | - if(!in_array($file->file_id, $request->existingFile)) |
|
| 359 | + if (!in_array($file->file_id, $request->existingFile)) |
|
| 360 | 360 | { |
| 361 | 361 | TechTipFiles::where('file_id', $file->file_id)->delete(); |
| 362 | 362 | Files::deleteFile($file->file_id); |
@@ -370,10 +370,10 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | // Process any new files |
| 373 | - if(!empty($request->file)) |
|
| 373 | + if (!empty($request->file)) |
|
| 374 | 374 | { |
| 375 | 375 | $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$id; |
| 376 | - foreach($request->file as $file) |
|
| 376 | + foreach ($request->file as $file) |
|
| 377 | 377 | { |
| 378 | 378 | // Clean the file and store it |
| 379 | 379 | $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName()); |
@@ -100,4 +100,4 @@ |
||
| 100 | 100 | return $request->all(); |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | - |
|
| 104 | 103 | \ No newline at end of file |
| 104 | + |
|
| 105 | 105 | \ No newline at end of file |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | $details = FileLinks::where('link_hash', $id)->first(); |
| 28 | 28 | |
| 29 | 29 | // Verify that the link is valid |
| 30 | - if(empty($details)) |
|
| 30 | + if (empty($details)) |
|
| 31 | 31 | { |
| 32 | 32 | return view('links.guest.badLink'); |
| 33 | 33 | } |
| 34 | 34 | // Verify that the link has not expired |
| 35 | - else if($details->expire <= date('Y-m-d')) |
|
| 35 | + else if ($details->expire<=date('Y-m-d')) |
|
| 36 | 36 | { |
| 37 | 37 | return view('links.guest.expiredLink'); |
| 38 | 38 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $details = FileLinks::where('link_hash', $hash)->first(); |
| 57 | 57 | |
| 58 | 58 | // Verify that the link is valid |
| 59 | - if(empty($details)) |
|
| 59 | + if (empty($details)) |
|
| 60 | 60 | { |
| 61 | 61 | return abort(404); |
| 62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $path = config('filesystems.disks.local.root').DIRECTORY_SEPARATOR; |
| 70 | 70 | |
| 71 | 71 | $zip = Zip::create($path.'download.zip'); |
| 72 | - foreach($files as $file) |
|
| 72 | + foreach ($files as $file) |
|
| 73 | 73 | { |
| 74 | 74 | $zip->add($path.$file->file_link.$file->file_name); |
| 75 | 75 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $filePath = config('filesystems.paths.links').DIRECTORY_SEPARATOR.$details->link_id; |
| 89 | 89 | |
| 90 | - foreach($request->file as $file) |
|
| 90 | + foreach ($request->file as $file) |
|
| 91 | 91 | { |
| 92 | 92 | // Clean the file and store it |
| 93 | 93 | $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName()); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'upload' => 1 |
| 109 | 109 | ]); |
| 110 | 110 | |
| 111 | - if(!empty($request->note)) |
|
| 111 | + if (!empty($request->note)) |
|
| 112 | 112 | { |
| 113 | 113 | FileLinkNotes::create([ |
| 114 | 114 | 'link_id' => $details->link_id, |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $numberTypes = PhoneNumberType::all(); |
| 27 | 27 | |
| 28 | 28 | $numTypes = []; |
| 29 | - foreach($numberTypes as $type) |
|
| 29 | + foreach ($numberTypes as $type) |
|
| 30 | 30 | { |
| 31 | 31 | $numTypes[$type->phone_type_id] = $type->description; |
| 32 | 32 | } |
@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $contID = $cont->cont_id; |
| 51 | 51 | |
| 52 | - if(!empty(array_filter($request['phoneNumber']))) |
|
| 52 | + if (!empty(array_filter($request['phoneNumber']))) |
|
| 53 | 53 | { |
| 54 | 54 | $num = count($request['phoneNumber']); |
| 55 | - for($i=0; $i < $num; $i++) |
|
| 55 | + for ($i = 0; $i<$num; $i++) |
|
| 56 | 56 | { |
| 57 | - if(!empty($request['phoneNumber'][$i])) |
|
| 57 | + if (!empty($request['phoneNumber'][$i])) |
|
| 58 | 58 | { |
| 59 | 59 | CustomerContactPhones::create([ |
| 60 | 60 | 'cont_id' => $contID, |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $numberTypes = PhoneNumberType::all(); |
| 88 | 88 | |
| 89 | 89 | $numTypes = []; |
| 90 | - foreach($numberTypes as $type) |
|
| 90 | + foreach ($numberTypes as $type) |
|
| 91 | 91 | { |
| 92 | 92 | $numTypes[$type->phone_type_id] = $type->description; |
| 93 | 93 | } |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | // Clear all contact phone numbers and re-enter them |
| 115 | 115 | CustomerContactPhones::where('cont_id', $id)->delete(); |
| 116 | - if(!empty(array_filter($request['phoneNumber']))) |
|
| 116 | + if (!empty(array_filter($request['phoneNumber']))) |
|
| 117 | 117 | { |
| 118 | 118 | $num = count($request['phoneNumber']); |
| 119 | - for($i=0; $i < $num; $i++) |
|
| 119 | + for ($i = 0; $i<$num; $i++) |
|
| 120 | 120 | { |
| 121 | 121 | CustomerContactPhones::create([ |
| 122 | 122 | 'cont_id' => $id, |
@@ -158,9 +158,9 @@ discard block |
||
| 158 | 158 | $vcard->addEmail($contact->email); |
| 159 | 159 | $vcard->addAddress(null, null, $custData->address, $custData->city, $custData->state, $custData->zip, null); |
| 160 | 160 | |
| 161 | - if(!empty($numbers)) |
|
| 161 | + if (!empty($numbers)) |
|
| 162 | 162 | { |
| 163 | - foreach($numbers as $phone) |
|
| 163 | + foreach ($numbers as $phone) |
|
| 164 | 164 | { |
| 165 | 165 | $vcard->addPhoneNumber($phone->phone_number, $phone->description); |
| 166 | 166 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function report(Exception $exception) |
| 37 | 37 | { |
| 38 | - if(config('app.debug')) |
|
| 38 | + if (config('app.debug')) |
|
| 39 | 39 | { |
| 40 | 40 | parent::report($exception); |
| 41 | 41 | } |
@@ -38,8 +38,7 @@ |
||
| 38 | 38 | if(config('app.debug')) |
| 39 | 39 | { |
| 40 | 40 | parent::report($exception); |
| 41 | - } |
|
| 42 | - else |
|
| 41 | + } else |
|
| 43 | 42 | { |
| 44 | 43 | Log::error('['.$exception->getCode().'] "'.$exception->getMessage().'" on line '.$exception->getTrace()[0]['line'].' of file '.$exception->getTrace()[0]['file']); |
| 45 | 44 | } |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | if($role->role_id == 1 && Auth::user()->role_id != 1) |
| 44 | 44 | { |
| 45 | 45 | continue; |
| 46 | - } |
|
| 47 | - else |
|
| 46 | + } else |
|
| 48 | 47 | { |
| 49 | 48 | $roleArr[$role->role_id] = $role->name; |
| 50 | 49 | } |
@@ -94,8 +93,7 @@ discard block |
||
| 94 | 93 | try |
| 95 | 94 | { |
| 96 | 95 | Mail::to($request->email)->send(new InitializeUser($hash, $request->username, $request->first_name.' '.$request->last_name)); |
| 97 | - } |
|
| 98 | - catch(Exception $e) |
|
| 96 | + } catch(Exception $e) |
|
| 99 | 97 | { |
| 100 | 98 | report($e); |
| 101 | 99 | } |
@@ -203,8 +201,7 @@ discard block |
||
| 203 | 201 | if($role->role_id == 1 && Auth::user()->role_id != 1) |
| 204 | 202 | { |
| 205 | 203 | continue; |
| 206 | - } |
|
| 207 | - else |
|
| 204 | + } else |
|
| 208 | 205 | { |
| 209 | 206 | $roleArr[$role->role_id] = $role->name; |
| 210 | 207 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $nextChange = config('users.passExpires') != null ? Carbon::now()->addDays(config('users.passExpires')) : null; |
| 149 | 149 | |
| 150 | - // Update the password |
|
| 150 | + // Update the password |
|
| 151 | 151 | User::find($userData->user_id)->update( |
| 152 | 152 | [ |
| 153 | 153 | 'password' => bcrypt($request->newPass), |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | $nextChange = isset($request->force_change) && $request->force_change == 'on' ? Carbon::now()->subDay() : null; |
| 190 | 190 | |
| 191 | - // Update the user data |
|
| 191 | + // Update the user data |
|
| 192 | 192 | User::find($id)->update( |
| 193 | 193 | [ |
| 194 | 194 | 'password' => bcrypt($request->password), |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $linkController->destroy($link->link_id); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - // Update the user data |
|
| 276 | + // Update the user data |
|
| 277 | 277 | User::find($id)->update( |
| 278 | 278 | [ |
| 279 | 279 | 'active' => 0 |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | $roles = Role::all(); |
| 42 | 42 | |
| 43 | 43 | $roleArr = []; |
| 44 | - foreach($roles as $role) |
|
| 44 | + foreach ($roles as $role) |
|
| 45 | 45 | { |
| 46 | - if($role->role_id == 1 && Auth::user()->role_id != 1) |
|
| 46 | + if ($role->role_id == 1 && Auth::user()->role_id != 1) |
|
| 47 | 47 | { |
| 48 | 48 | continue; |
| 49 | 49 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | Mail::to($request->email)->send(new InitializeUser($hash, $request->username, $request->first_name.' '.$request->last_name)); |
| 98 | 98 | } |
| 99 | - catch(Exception $e) |
|
| 99 | + catch (Exception $e) |
|
| 100 | 100 | { |
| 101 | 101 | report($e); |
| 102 | 102 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | // Validate the hash token |
| 115 | 115 | $user = UserInitialize::where('token', $hash)->get(); |
| 116 | 116 | |
| 117 | - if($user->isEmpty()) |
|
| 117 | + if ($user->isEmpty()) |
|
| 118 | 118 | { |
| 119 | 119 | return abort(404); |
| 120 | 120 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | // Verify that the link matches the assigned email address |
| 129 | 129 | $valid = UserInitialize::where('token', $hash)->first(); |
| 130 | - if(empty($valid)) |
|
| 130 | + if (empty($valid)) |
|
| 131 | 131 | { |
| 132 | 132 | Log::notice('Someone tried to access an invalid User Initialization link - '.$hash); |
| 133 | 133 | return abort(404); |
@@ -207,9 +207,9 @@ discard block |
||
| 207 | 207 | $userRole = DB::select('SELECT `role_id` FROM `user_role` WHERE `user_id` = ?', [$id])[0]->role_id; |
| 208 | 208 | |
| 209 | 209 | $roleArr = []; |
| 210 | - foreach($roles as $role) |
|
| 210 | + foreach ($roles as $role) |
|
| 211 | 211 | { |
| 212 | - if($role->role_id == 1 && Auth::user()->role_id != 1) |
|
| 212 | + if ($role->role_id == 1 && Auth::user()->role_id != 1) |
|
| 213 | 213 | { |
| 214 | 214 | continue; |
| 215 | 215 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $linkController = new FileLinksController(); |
| 266 | 266 | $links = FileLinks::where('user_id', $id)->get(); |
| 267 | 267 | |
| 268 | - foreach($links as $link) |
|
| 268 | + foreach ($links as $link) |
|
| 269 | 269 | { |
| 270 | 270 | $linkController->destroy($link->link_id); |
| 271 | 271 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $user = $request->user(); |
| 22 | 22 | $passExp = new Carbon(($user->password_expires)); |
| 23 | 23 | |
| 24 | - if(!empty($passExp) && Carbon::now() > $passExp && !empty(config('users.passExpires'))) |
|
| 24 | + if (!empty($passExp) && Carbon::now()>$passExp && !empty(config('users.passExpires'))) |
|
| 25 | 25 | { |
| 26 | 26 | Log::notice('User ID-'.Auth::user()->user_id.' is being forced to change their password.'); |
| 27 | 27 | $request->session()->flash('change_password', 'change_password'); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $i = 0; |
| 40 | 40 | do |
| 41 | 41 | { |
| 42 | - if($i) |
|
| 42 | + if ($i) |
|
| 43 | 43 | { |
| 44 | 44 | $backupName = $backupBase.'('.$i.')'; |
| 45 | 45 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $backupName = $backupBase; |
| 49 | 49 | } |
| 50 | 50 | $i++; |
| 51 | - } while(Storage::disk('backup')->exists($backupName.'.zip')); |
|
| 51 | + } while (Storage::disk('backup')->exists($backupName.'.zip')); |
|
| 52 | 52 | |
| 53 | 53 | // Write a file that shows the system version |
| 54 | 54 | $version = new \PragmaRX\Version\Package\Version(); |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | if($i) |
| 43 | 43 | { |
| 44 | 44 | $backupName = $backupBase.'('.$i.')'; |
| 45 | - } |
|
| 46 | - else |
|
| 45 | + } else |
|
| 47 | 46 | { |
| 48 | 47 | $backupName = $backupBase; |
| 49 | 48 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | public function markNotification($id) |
| 41 | 41 | { |
| 42 | 42 | $notification = Auth::user()->notifications()->where('id', $id)->first(); |
| 43 | - if($notification) |
|
| 43 | + if ($notification) |
|
| 44 | 44 | { |
| 45 | 45 | $notification->delete(); |
| 46 | 46 | Log::info('Notification ID-'.$id.' deleted for User ID-'.Auth::user()->user_id); |
@@ -44,8 +44,7 @@ |
||
| 44 | 44 | { |
| 45 | 45 | $notification->delete(); |
| 46 | 46 | Log::info('Notification ID-'.$id.' deleted for User ID-'.Auth::user()->user_id); |
| 47 | - } |
|
| 48 | - else |
|
| 47 | + } else |
|
| 49 | 48 | { |
| 50 | 49 | Log::notice('Notification ID-'.$id.' not found for user ID-'.Auth::user()->user_id); |
| 51 | 50 | } |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | $cats = SystemCategories::all(); |
| 28 | 28 | $sysArr = []; |
| 29 | 29 | // Populate that list with the matching systems |
| 30 | - foreach($cats as $cat) |
|
| 30 | + foreach ($cats as $cat) |
|
| 31 | 31 | { |
| 32 | 32 | $systems = SystemTypes::where('cat_id', $cat->cat_id)->get(); |
| 33 | - if(!$systems->isEmpty()) |
|
| 33 | + if (!$systems->isEmpty()) |
|
| 34 | 34 | { |
| 35 | - foreach($systems as $sys) |
|
| 35 | + foreach ($systems as $sys) |
|
| 36 | 36 | { |
| 37 | 37 | $sysArr[$cat->name][] = $sys->name; |
| 38 | 38 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | Log::info('Tech Bench Settings Updated', ['user_id' => Auth::user()->user_id]); |
| 69 | 69 | |
| 70 | - return redirect()->back()->with('success', 'Tech Bench Successfully Updated');// |
|
| 70 | + return redirect()->back()->with('success', 'Tech Bench Successfully Updated'); // |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Upload and submit a new site logo |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | 'mail.username' => $request->username, |
| 112 | 112 | ]); |
| 113 | 113 | |
| 114 | - if(!empty($request->password)) |
|
| 114 | + if (!empty($request->password)) |
|
| 115 | 115 | { |
| 116 | 116 | config(['mail.password' => $request->password]); |
| 117 | 117 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | Mail::to(Auth::user()->email)->send(new TestEmail()); |
| 124 | 124 | return 'success'; |
| 125 | 125 | } |
| 126 | - catch(Exception $e) |
|
| 126 | + catch (Exception $e) |
|
| 127 | 127 | { |
| 128 | 128 | Log::notice('Test Email Failed. Message: '.$e); |
| 129 | 129 | $msg = '['.$e->getCode().'] "'.$e->getMessage().'" on line '.$e->getTrace()[0]['line'].' of file '.$e->getTrace()[0]['file']; |
@@ -146,13 +146,13 @@ discard block |
||
| 146 | 146 | Settings::where('key', 'mail.port')->update(['value' => $request->port]); |
| 147 | 147 | Settings::where('key', 'mail.encryption')->update(['value' => $request->encryption]); |
| 148 | 148 | Settings::where('key', 'mail.username')->update(['value' => $request->username]); |
| 149 | - if(!empty($request->password)) |
|
| 149 | + if (!empty($request->password)) |
|
| 150 | 150 | { |
| 151 | 151 | Settings::where('key', 'mail.password')->update(['value' => $request->password]); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | Log::info('Email Settings have been changed by User ID-'.Auth::user()->user_id); |
| 155 | - return redirect()->back()->with('success', 'Tech Bench Successfully Updated');// |
|
| 155 | + return redirect()->back()->with('success', 'Tech Bench Successfully Updated'); // |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | // User settings form |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | // Determine if the password expires field is updated |
| 176 | 176 | $oldExpire = config('users.passExpires'); |
| 177 | - if($request->passExpire != $oldExpire) |
|
| 177 | + if ($request->passExpire != $oldExpire) |
|
| 178 | 178 | { |
| 179 | 179 | // Update the setting in the database |
| 180 | 180 | Settings::where('key', 'users.passExpires')->update([ |
| 181 | 181 | 'value' => $request->passExpire |
| 182 | 182 | ]); |
| 183 | 183 | // If the setting is changing from never to xx days, update all users |
| 184 | - if($request->passExpire == 0) |
|
| 184 | + if ($request->passExpire == 0) |
|
| 185 | 185 | { |
| 186 | 186 | User::whereNotNull('password_expires')->update([ |
| 187 | 187 | 'password_expires' => null |
@@ -36,8 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $sysArr[$cat->name][] = $sys->name; |
| 38 | 38 | } |
| 39 | - } |
|
| 40 | - else |
|
| 39 | + } else |
|
| 41 | 40 | { |
| 42 | 41 | $sysArr[$cat->name] = null; |
| 43 | 42 | } |
@@ -122,8 +121,7 @@ discard block |
||
| 122 | 121 | Log::info('Test Email Successfully Sent to '.Auth::user()->email); |
| 123 | 122 | Mail::to(Auth::user()->email)->send(new TestEmail()); |
| 124 | 123 | return 'success'; |
| 125 | - } |
|
| 126 | - catch(Exception $e) |
|
| 124 | + } catch(Exception $e) |
|
| 127 | 125 | { |
| 128 | 126 | Log::notice('Test Email Failed. Message: '.$e); |
| 129 | 127 | $msg = '['.$e->getCode().'] "'.$e->getMessage().'" on line '.$e->getTrace()[0]['line'].' of file '.$e->getTrace()[0]['file']; |
@@ -186,8 +184,7 @@ discard block |
||
| 186 | 184 | User::whereNotNull('password_expires')->update([ |
| 187 | 185 | 'password_expires' => null |
| 188 | 186 | ]); |
| 189 | - } |
|
| 190 | - else |
|
| 187 | + } else |
|
| 191 | 188 | { |
| 192 | 189 | $newExpire = Carbon::now()->addDays($request->passExpire); |
| 193 | 190 | User::whereNull('password_expires')->update([ |