@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function up() |
| 17 | 17 | { |
| 18 | - Schema::table('users', function(Blueprint $table) |
|
| 19 | - { |
|
| 18 | + Schema::table('users', function(Blueprint $table) { |
|
| 20 | 19 | $table->timestamp('password_expires') |
| 21 | 20 | ->nullable() |
| 22 | 21 | ->after('active'); |
@@ -41,8 +40,7 @@ discard block |
||
| 41 | 40 | */ |
| 42 | 41 | public function down() |
| 43 | 42 | { |
| 44 | - Schema::table('users', function(Blueprint $table) |
|
| 45 | - { |
|
| 43 | + Schema::table('users', function(Blueprint $table) { |
|
| 46 | 44 | $table->dropColumn('password_expires'); |
| 47 | 45 | }); |
| 48 | 46 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | |
| 61 | 61 | // Upload new file |
| 62 | 62 | public function update(Request $request, $id) |
| 63 | - { |
|
| 63 | + { |
|
| 64 | 64 | $request->validate(['name' => 'required', 'file' => 'required']); |
| 65 | 65 | |
| 66 | 66 | $details = FileLinks::where('link_hash', $id)->first(); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | $nextChange = config('users.passExpires') != null ? Carbon::now()->addDays(config('users.passExpires')) : null; |
| 139 | 139 | |
| 140 | - // Update the password |
|
| 140 | + // Update the password |
|
| 141 | 141 | User::find($userData->user_id)->update( |
| 142 | 142 | [ |
| 143 | 143 | 'password' => bcrypt($request->newPass), |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | |
| 270 | 270 | $nextChange = isset($request->force_change) && $request->force_change == 'on' ? Carbon::now()->subDay() : null; |
| 271 | 271 | |
| 272 | - // Update the user data |
|
| 272 | + // Update the user data |
|
| 273 | 273 | User::find($id)->update( |
| 274 | 274 | [ |
| 275 | 275 | 'password' => bcrypt($request->password), |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $roleArr = []; |
| 40 | 40 | foreach($roles as $role) |
| 41 | 41 | { |
| 42 | - if($role->role_id == 1 && !Auth::user()->hasAnyRole(['installer'])) |
|
| 42 | + if($role->role_id == 1 && !Auth::user()->hasAnyRole(['installer'])) |
|
| 43 | 43 | { |
| 44 | 44 | |
| 45 | 45 | continue; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | // Submit the initialize user form |
| 116 | 116 | public function submitInitializeUser(Request $request, $hash) |
| 117 | - { |
|
| 117 | + { |
|
| 118 | 118 | // Verify that the link matches the assigned email address |
| 119 | 119 | $valid = UserInitialize::where('token', $hash)->first(); |
| 120 | 120 | if(empty($valid)) |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $roleArr = []; |
| 192 | 192 | foreach($roles as $role) |
| 193 | 193 | { |
| 194 | - if($role->role_id == 1 && !Auth::user()->hasAnyRole(['installer'])) |
|
| 194 | + if($role->role_id == 1 && !Auth::user()->hasAnyRole(['installer'])) |
|
| 195 | 195 | { |
| 196 | 196 | continue; |
| 197 | 197 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function handle($request, Closure $next, $guard = null) |
| 19 | 19 | { |
| 20 | - if (Auth::guard($guard)->check()) { |
|
| 20 | + if(Auth::guard($guard)->check()) { |
|
| 21 | 21 | return redirect('/dashboard'); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -17,7 +17,8 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function handle($request, Closure $next, $guard = null) |
| 19 | 19 | { |
| 20 | - if (Auth::guard($guard)->check()) { |
|
| 20 | + if (Auth::guard($guard)->check()) |
|
| 21 | + { |
|
| 21 | 22 | return redirect('/dashboard'); |
| 22 | 23 | } |
| 23 | 24 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $user = $request->user(); |
| 22 | 22 | |
| 23 | - if($user->password_expires != NULL) |
|
| 23 | + if($user->password_expires != null) |
|
| 24 | 24 | { |
| 25 | 25 | $passExp = new Carbon(($user->password_expires)); |
| 26 | 26 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $actions = $request->route()->getAction(); |
| 21 | 21 | $roles = isset($actions['roles']) ? $actions['roles'] : null; |
| 22 | 22 | |
| 23 | - if($request->user()->hasAnyRole($roles) || !$roles) |
|
| 23 | + if($request->user()->hasAnyRole($roles) || !$roles) |
|
| 24 | 24 | { |
| 25 | 25 | return $next($request); |
| 26 | 26 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | protected function redirectTo($request) |
| 16 | 16 | { |
| 17 | - if (! $request->expectsJson()) { |
|
| 17 | + if(!$request->expectsJson()) { |
|
| 18 | 18 | return route('login'); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -14,7 +14,8 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | protected function redirectTo($request) |
| 16 | 16 | { |
| 17 | - if (! $request->expectsJson()) { |
|
| 17 | + if (! $request->expectsJson()) |
|
| 18 | + { |
|
| 18 | 19 | return route('login'); |
| 19 | 20 | } |
| 20 | 21 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $extension = isset($fileParts['extension']) ? ('.'.$fileParts['extension']) : ''; |
| 39 | 39 | |
| 40 | 40 | // check for matching file names |
| 41 | - if (preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 41 | + if(preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 42 | 42 | { |
| 43 | 43 | // Have a number; increment it |
| 44 | 44 | $base = $match[1]; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | do |
| 55 | 55 | { |
| 56 | 56 | $fileName = $base.'('.++$number.')'.$extension; |
| 57 | - } while (Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)); |
|
| 57 | + } while(Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $fileName; |
@@ -38,20 +38,20 @@ |
||
| 38 | 38 | $extension = isset($fileParts['extension']) ? ('.'.$fileParts['extension']) : ''; |
| 39 | 39 | |
| 40 | 40 | // check for matching file names |
| 41 | - if (preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 41 | + if (preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 42 | 42 | { |
| 43 | 43 | // Have a number; increment it |
| 44 | 44 | $base = $match[1]; |
| 45 | 45 | $number = intVal($match[2]); |
| 46 | - } |
|
| 47 | - else |
|
| 46 | + } |
|
| 47 | + else |
|
| 48 | 48 | { |
| 49 | 49 | // No number; add one |
| 50 | 50 | $base = $fileParts['filename']; |
| 51 | 51 | $number = 0; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - do |
|
| 54 | + do |
|
| 55 | 55 | { |
| 56 | 56 | $fileName = $base.'('.++$number.')'.$extension; |
| 57 | 57 | } while (Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)); |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | ->action('Click to View Link', |
| 33 | 33 | url(route('links.details', |
| 34 | 34 | [ |
| 35 | - 'id' => $this->details->link_id, |
|
| 36 | - 'name' => urlencode($this->details->link_name) |
|
| 35 | + 'id' => $this->details->link_id, |
|
| 36 | + 'name' => urlencode($this->details->link_name) |
|
| 37 | 37 | ]))); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | 'type' => 'warning', |
| 45 | 45 | 'message' => 'New File Uploaded to link - '.$this->details->link_name, |
| 46 | 46 | 'link' => url(route('links.details', |
| 47 | - [ |
|
| 47 | + [ |
|
| 48 | 48 | 'id' => $this->details->link_id, |
| 49 | - 'name' => urlencode($this->details->link_name) |
|
| 50 | - ])) |
|
| 49 | + 'name' => urlencode($this->details->link_name) |
|
| 50 | + ])) |
|
| 51 | 51 | ]; |
| 52 | 52 | } |
| 53 | 53 | } |