@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | if($files == 0 && $details->allow_upload === 'No') |
57 | 57 | { |
58 | - Log::warning('Visitor ' . \Request::ip() . ' visited a link that they cannot do anything with. Hash - ' . $id); |
|
58 | + Log::warning('Visitor '.\Request::ip().' visited a link that they cannot do anything with. Hash - '.$id); |
|
59 | 59 | return view('links.guestDeadLink'); |
60 | 60 | } |
61 | 61 |
@@ -54,7 +54,7 @@ |
||
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 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | // Determine if the note should go to the customer, or its parent |
44 | 44 | $details = Customers::find($request->cust_id); |
45 | - if ($details->parent_id && $request->shared == 'true') |
|
45 | + if($details->parent_id && $request->shared == 'true') |
|
46 | 46 | { |
47 | 47 | $request->cust_id = $details->parent_id; |
48 | 48 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | // Determine if there is a parent site with shared files |
104 | 104 | $parent = Customers::find($id)->parent_id; |
105 | - if ($parent) { |
|
105 | + if($parent) { |
|
106 | 106 | $parentList = Customerfiles::where('cust_id', $parent) |
107 | 107 | ->where('shared', 1) |
108 | 108 | ->with('Files') |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | ]); |
127 | 127 | |
128 | 128 | $details = Customers::find($request->cust_id); |
129 | - if ($details->parent_id && $request->shared == 1) { |
|
129 | + if($details->parent_id && $request->shared == 1) { |
|
130 | 130 | $request->cust_id = $details->parent_id; |
131 | 131 | } |
132 | 132 |
@@ -29,7 +29,7 @@ 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 | $request->cust_id = $details->parent_id; |
34 | 34 | } |
35 | 35 | |
@@ -55,7 +55,7 @@ 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); |
@@ -76,7 +76,7 @@ discard block |
||
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 |
@@ -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 |
@@ -25,13 +25,13 @@ discard block |
||
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 |
||
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 |
||
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')); |
@@ -25,7 +25,8 @@ discard block |
||
25 | 25 | // Validate the hash token |
26 | 26 | $user = UserInitialize::where('token', $hash)->get(); |
27 | 27 | |
28 | - if ($user->isEmpty()) { |
|
28 | + if ($user->isEmpty()) |
|
29 | + { |
|
29 | 30 | Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to access invalid initialize hash - ' . $hash); |
30 | 31 | return abort(404); |
31 | 32 | } |
@@ -40,7 +41,8 @@ discard block |
||
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 | } |
@@ -5,7 +5,7 @@ |
||
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)), |
@@ -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 | } |