@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->configureRateLimiting(); |
| 39 | 39 | |
| 40 | - $this->routes(function () { |
|
| 40 | + $this->routes(function() { |
|
| 41 | 41 | Route::prefix('api') |
| 42 | 42 | ->middleware('api') |
| 43 | 43 | ->namespace($this->namespace) |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function configureRateLimiting() |
| 58 | 58 | { |
| 59 | - RateLimiter::for('api', function (Request $request) { |
|
| 59 | + RateLimiter::for ('api', function(Request $request) { |
|
| 60 | 60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); |
| 61 | 61 | }); |
| 62 | 62 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | protected function commands() |
| 36 | 36 | { |
| 37 | - $this->load(__DIR__.'/Commands'); |
|
| 37 | + $this->load(__DIR__ . '/Commands'); |
|
| 38 | 38 | |
| 39 | 39 | require base_path('routes/console.php'); |
| 40 | 40 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | for ($c = 0; $c < strlen($b) - 2; $c += 3) { |
| 63 | 63 | $d = $b[$c + 2]; |
| 64 | - $d = $d >= 'a' ? ord($d[0]) - 87 : (int) $d; |
|
| 64 | + $d = $d >= 'a' ? ord($d[0]) - 87 : (int)$d; |
|
| 65 | 65 | $d = $b[$c + 1] === '+' ? $this->unsignedRightShift($a, $d) : $a << $d; |
| 66 | 66 | $a = $b[$c] === '+' ? ($a + $d & 4294967295) : $a ^ $d; |
| 67 | 67 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | private function unsignedRightShift(int $a, int $b): int |
| 73 | 73 | { |
| 74 | 74 | if ($b >= 32 || $b < -32) { |
| 75 | - $m = (int) ($b / 32); |
|
| 75 | + $m = (int)($b / 32); |
|
| 76 | 76 | $b -= ($m * 32); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -258,13 +258,13 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if (is_array($responseArray[0])) { |
| 261 | - return (string) array_reduce($responseArray[0], static function ($carry, $item) { |
|
| 261 | + return (string)array_reduce($responseArray[0], static function($carry, $item) { |
|
| 262 | 262 | $carry .= $item[0]; |
| 263 | 263 | return $carry; |
| 264 | 264 | }); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - return (string) $responseArray[0]; |
|
| 267 | + return (string)$responseArray[0]; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | public function getResponse(string $string): array |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | protected function isValidLocale(string $lang): bool |
| 309 | 309 | { |
| 310 | - return (bool) preg_match('/^([a-z]{2,3})(-[A-Za-z]{2,4})?$/', $lang); |
|
| 310 | + return (bool)preg_match('/^([a-z]{2,3})(-[A-Za-z]{2,4})?$/', $lang); |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | parent::boot(); |
| 17 | 17 | |
| 18 | 18 | static::creating(function ($link) { |
| 19 | - if (config('linkstack.disable_random_link_ids') != 'true') { |
|
| 19 | + if (config('linkstack.disable_random_link_ids') != 'true') { |
|
| 20 | 20 | $numberOfDigits = config('linkstack.link_id_length') ?? 9; |
| 21 | 21 | |
| 22 | 22 | $minIdValue = 10**($numberOfDigits - 1); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } while (Link::find($randomId)); |
| 28 | 28 | |
| 29 | 29 | $link->id = $randomId; |
| 30 | - } |
|
| 30 | + } |
|
| 31 | 31 | }); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | parent::boot(); |
| 17 | 17 | |
| 18 | - static::creating(function ($link) { |
|
| 18 | + static::creating(function($link) { |
|
| 19 | 19 | if (config('linkstack.disable_random_link_ids') != 'true') { |
| 20 | 20 | $numberOfDigits = config('linkstack.link_id_length') ?? 9; |
| 21 | 21 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | private static function getCachedUserData($userId) |
| 63 | 63 | { |
| 64 | - return Cache::remember('user_data_' . $userId, now()->addMinutes(10), function () use ($userId) { |
|
| 64 | + return Cache::remember('user_data_' . $userId, now()->addMinutes(10), function() use ($userId) { |
|
| 65 | 65 | return self::where('id', $userId)->first(); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | { |
| 62 | 62 | parent::boot(); |
| 63 | 63 | |
| 64 | - static::creating(function ($user) { |
|
| 64 | + static::creating(function($user) { |
|
| 65 | 65 | if (config('linkstack.disable_random_user_ids') != 'true') { |
| 66 | 66 | if (is_null(User::first())) { |
| 67 | 67 | $user->id = 1; |
@@ -34,11 +34,11 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function register() |
| 36 | 36 | { |
| 37 | - $this->reportable(function (Throwable $e) { |
|
| 37 | + $this->reportable(function(Throwable $e) { |
|
| 38 | 38 | // |
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | - $this->renderable(function (\Exception $e) { |
|
| 41 | + $this->renderable(function(\Exception $e) { |
|
| 42 | 42 | if ($e->getPrevious() instanceof \Illuminate\Session\TokenMismatchException) { |
| 43 | 43 | return redirect()->route('login'); |
| 44 | 44 | }; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | 'countries' => visits('App\Models\User', $littlelink_name)->countries(), |
| 71 | 71 | ]; |
| 72 | 72 | |
| 73 | - return view('panel/index', ['lastMonthCount' => $lastMonthCount,'lastWeekCount' => $lastWeekCount,'last24HrsCount' => $last24HrsCount,'updatedLast30DaysCount' => $updatedLast30DaysCount,'updatedLast7DaysCount' => $updatedLast7DaysCount,'updatedLast24HrsCount' => $updatedLast24HrsCount,'toplinks' => $topLinks, 'links' => $links, 'clicks' => $clicks, 'pageStats' => $pageStats, 'littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]); |
|
| 73 | + return view('panel/index', ['lastMonthCount' => $lastMonthCount, 'lastWeekCount' => $lastWeekCount, 'last24HrsCount' => $last24HrsCount, 'updatedLast30DaysCount' => $updatedLast30DaysCount, 'updatedLast7DaysCount' => $updatedLast7DaysCount, 'updatedLast24HrsCount' => $updatedLast24HrsCount, 'toplinks' => $topLinks, 'links' => $links, 'clicks' => $clicks, 'pageStats' => $pageStats, 'littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Users page |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $userId = auth()->id(); |
| 87 | 87 | $user = User::findOrFail($userId); |
| 88 | 88 | |
| 89 | - Mail::send('auth.test', ['user' => $user], function ($message) use ($user) { |
|
| 89 | + Mail::send('auth.test', ['user' => $user], function($message) use ($user) { |
|
| 90 | 90 | $message->to($user->email) |
| 91 | 91 | ->subject('Test Email'); |
| 92 | 92 | }); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | User::where('id', $id)->update(['role' => $verify]); |
| 131 | 131 | |
| 132 | - return redirect(url('u')."/".$id); |
|
| 132 | + return redirect(url('u') . "/" . $id); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | //Verify or un-verify users emails |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | }); |
| 174 | 174 | |
| 175 | 175 | $numbers = array_map(function($name) { |
| 176 | - return (int) str_replace('Admin-Created-', '', $name); |
|
| 176 | + return (int)str_replace('Admin-Created-', '', $name); |
|
| 177 | 177 | }, $adminCreatedNames); |
| 178 | 178 | |
| 179 | 179 | $maxNumber = !empty($numbers) ? max($numbers) : 0; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $customBackground = $request->file('background'); |
| 278 | 278 | $theme = $request->theme; |
| 279 | 279 | |
| 280 | - if(User::where('id', $id)->get('role')->first()->role =! $role) { |
|
| 280 | + if (User::where('id', $id)->get('role')->first()->role = !$role) { |
|
| 281 | 281 | if ($role == 'vip') { |
| 282 | 282 | UserData::saveData($id, 'checkmark', true); |
| 283 | 283 | } |
@@ -295,11 +295,11 @@ discard block |
||
| 295 | 295 | $directory = base_path('assets/img/background-img/'); |
| 296 | 296 | $files = scandir($directory); |
| 297 | 297 | $pathinfo = "error.error"; |
| 298 | - foreach($files as $file) { |
|
| 299 | - if (strpos($file, $id.'.') !== false) { |
|
| 300 | - $pathinfo = $id. "." . pathinfo($file, PATHINFO_EXTENSION); |
|
| 298 | + foreach ($files as $file) { |
|
| 299 | + if (strpos($file, $id . '.') !== false) { |
|
| 300 | + $pathinfo = $id . "." . pathinfo($file, PATHINFO_EXTENSION); |
|
| 301 | 301 | }} |
| 302 | - if(file_exists(base_path('assets/img/background-img/').$pathinfo)){File::delete(base_path('assets/img/background-img/').$pathinfo);} |
|
| 302 | + if (file_exists(base_path('assets/img/background-img/') . $pathinfo)) {File::delete(base_path('assets/img/background-img/') . $pathinfo); } |
|
| 303 | 303 | |
| 304 | 304 | $customBackground->move(base_path('assets/img/background-img/'), $id . '_' . time() . "." . $request->file('background')->extension()); |
| 305 | 305 | } |
@@ -346,20 +346,20 @@ discard block |
||
| 346 | 346 | if (!empty($logo)) { |
| 347 | 347 | // Delete existing image |
| 348 | 348 | $path = findFile('avatar'); |
| 349 | - $path = base_path('/assets/linkstack/images/'.$path); |
|
| 349 | + $path = base_path('/assets/linkstack/images/' . $path); |
|
| 350 | 350 | |
| 351 | 351 | // Delete existing image |
| 352 | 352 | if (File::exists($path)) { |
| 353 | 353 | File::delete($path); |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - $logo->move(base_path('/assets/linkstack/images/'), "avatar" . '_' . time() . "." .$request->file('image')->extension()); |
|
| 356 | + $logo->move(base_path('/assets/linkstack/images/'), "avatar" . '_' . time() . "." . $request->file('image')->extension()); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | if (!empty($icon)) { |
| 360 | 360 | // Delete existing image |
| 361 | 361 | $path = findFile('favicon'); |
| 362 | - $path = base_path('/assets/linkstack/images/'.$path); |
|
| 362 | + $path = base_path('/assets/linkstack/images/' . $path); |
|
| 363 | 363 | |
| 364 | 364 | // Delete existing image |
| 365 | 365 | if (File::exists($path)) { |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | public function delAvatar() |
| 376 | 376 | { |
| 377 | 377 | $path = findFile('avatar'); |
| 378 | - $path = base_path('/assets/linkstack/images/'.$path); |
|
| 378 | + $path = base_path('/assets/linkstack/images/' . $path); |
|
| 379 | 379 | |
| 380 | 380 | // Delete existing image |
| 381 | 381 | if (File::exists($path)) { |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | { |
| 391 | 391 | // Delete existing image |
| 392 | 392 | $path = findFile('favicon'); |
| 393 | - $path = base_path('/assets/linkstack/images/'.$path); |
|
| 393 | + $path = base_path('/assets/linkstack/images/' . $path); |
|
| 394 | 394 | |
| 395 | 395 | // Delete existing image |
| 396 | 396 | if (File::exists($path)) { |
@@ -624,46 +624,46 @@ discard block |
||
| 624 | 624 | $entry = $request->entry; |
| 625 | 625 | $value = $request->value; |
| 626 | 626 | |
| 627 | - if($type === "toggle"){ |
|
| 628 | - if($request->toggle != ''){$value = "true";}else{$value = "false";} |
|
| 629 | - if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
|
| 630 | - } elseif($type === "toggle2") { |
|
| 631 | - if($request->toggle != ''){$value = "verified";}else{$value = "auth";} |
|
| 632 | - if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
|
| 633 | - } elseif($type === "text") { |
|
| 634 | - if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, '"' . $value . '"');} |
|
| 635 | - } elseif($type === "debug") { |
|
| 636 | - if($request->toggle != ''){ |
|
| 637 | - if(EnvEditor::keyExists('APP_DEBUG')){EnvEditor::editKey('APP_DEBUG', 'true');} |
|
| 638 | - if(EnvEditor::keyExists('APP_ENV')){EnvEditor::editKey('APP_ENV', 'local');} |
|
| 639 | - if(EnvEditor::keyExists('LOG_LEVEL')){EnvEditor::editKey('LOG_LEVEL', 'debug');} |
|
| 627 | + if ($type === "toggle") { |
|
| 628 | + if ($request->toggle != '') {$value = "true"; } else {$value = "false"; } |
|
| 629 | + if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); } |
|
| 630 | + } elseif ($type === "toggle2") { |
|
| 631 | + if ($request->toggle != '') {$value = "verified"; } else {$value = "auth"; } |
|
| 632 | + if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); } |
|
| 633 | + } elseif ($type === "text") { |
|
| 634 | + if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, '"' . $value . '"'); } |
|
| 635 | + } elseif ($type === "debug") { |
|
| 636 | + if ($request->toggle != '') { |
|
| 637 | + if (EnvEditor::keyExists('APP_DEBUG')) {EnvEditor::editKey('APP_DEBUG', 'true'); } |
|
| 638 | + if (EnvEditor::keyExists('APP_ENV')) {EnvEditor::editKey('APP_ENV', 'local'); } |
|
| 639 | + if (EnvEditor::keyExists('LOG_LEVEL')) {EnvEditor::editKey('LOG_LEVEL', 'debug'); } |
|
| 640 | 640 | } else { |
| 641 | - if(EnvEditor::keyExists('APP_DEBUG')){EnvEditor::editKey('APP_DEBUG', 'false');} |
|
| 642 | - if(EnvEditor::keyExists('APP_ENV')){EnvEditor::editKey('APP_ENV', 'production');} |
|
| 643 | - if(EnvEditor::keyExists('LOG_LEVEL')){EnvEditor::editKey('LOG_LEVEL', 'error');} |
|
| 641 | + if (EnvEditor::keyExists('APP_DEBUG')) {EnvEditor::editKey('APP_DEBUG', 'false'); } |
|
| 642 | + if (EnvEditor::keyExists('APP_ENV')) {EnvEditor::editKey('APP_ENV', 'production'); } |
|
| 643 | + if (EnvEditor::keyExists('LOG_LEVEL')) {EnvEditor::editKey('LOG_LEVEL', 'error'); } |
|
| 644 | 644 | } |
| 645 | - } elseif($type === "register") { |
|
| 646 | - if($request->toggle != ''){$register = "true";}else{$register = "false";} |
|
| 645 | + } elseif ($type === "register") { |
|
| 646 | + if ($request->toggle != '') {$register = "true"; } else {$register = "false"; } |
|
| 647 | 647 | Page::first()->update(['register' => $register]); |
| 648 | - } elseif($type === "smtp") { |
|
| 649 | - if($request->toggle != ''){$value = "built-in";}else{$value = "smtp";} |
|
| 650 | - if(EnvEditor::keyExists('MAIL_MAILER')){EnvEditor::editKey('MAIL_MAILER', $value);} |
|
| 651 | - |
|
| 652 | - if(EnvEditor::keyExists('MAIL_HOST')){EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST);} |
|
| 653 | - if(EnvEditor::keyExists('MAIL_PORT')){EnvEditor::editKey('MAIL_PORT', $request->MAIL_PORT);} |
|
| 654 | - if(EnvEditor::keyExists('MAIL_USERNAME')){EnvEditor::editKey('MAIL_USERNAME', '"' . $request->MAIL_USERNAME . '"');} |
|
| 655 | - if(EnvEditor::keyExists('MAIL_PASSWORD')){EnvEditor::editKey('MAIL_PASSWORD', '"' . $request->MAIL_PASSWORD . '"');} |
|
| 656 | - if(EnvEditor::keyExists('MAIL_ENCRYPTION')){EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION);} |
|
| 657 | - if(EnvEditor::keyExists('MAIL_FROM_ADDRESS')){EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS);} |
|
| 658 | - } elseif($type === "homeurl") { |
|
| 659 | - if($request->value == 'default'){$value = "";}else{$value = '"' . $request->value . '"';} |
|
| 660 | - if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
|
| 661 | - } elseif($type === "maintenance") { |
|
| 662 | - if($request->toggle != ''){$value = "true";}else{$value = "false";} |
|
| 663 | - if(file_exists(base_path("storage/MAINTENANCE"))){unlink(base_path("storage/MAINTENANCE"));} |
|
| 664 | - if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
|
| 648 | + } elseif ($type === "smtp") { |
|
| 649 | + if ($request->toggle != '') {$value = "built-in"; } else {$value = "smtp"; } |
|
| 650 | + if (EnvEditor::keyExists('MAIL_MAILER')) {EnvEditor::editKey('MAIL_MAILER', $value); } |
|
| 651 | + |
|
| 652 | + if (EnvEditor::keyExists('MAIL_HOST')) {EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST); } |
|
| 653 | + if (EnvEditor::keyExists('MAIL_PORT')) {EnvEditor::editKey('MAIL_PORT', $request->MAIL_PORT); } |
|
| 654 | + if (EnvEditor::keyExists('MAIL_USERNAME')) {EnvEditor::editKey('MAIL_USERNAME', '"' . $request->MAIL_USERNAME . '"'); } |
|
| 655 | + if (EnvEditor::keyExists('MAIL_PASSWORD')) {EnvEditor::editKey('MAIL_PASSWORD', '"' . $request->MAIL_PASSWORD . '"'); } |
|
| 656 | + if (EnvEditor::keyExists('MAIL_ENCRYPTION')) {EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION); } |
|
| 657 | + if (EnvEditor::keyExists('MAIL_FROM_ADDRESS')) {EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS); } |
|
| 658 | + } elseif ($type === "homeurl") { |
|
| 659 | + if ($request->value == 'default') {$value = ""; } else {$value = '"' . $request->value . '"'; } |
|
| 660 | + if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); } |
|
| 661 | + } elseif ($type === "maintenance") { |
|
| 662 | + if ($request->toggle != '') {$value = "true"; } else {$value = "false"; } |
|
| 663 | + if (file_exists(base_path("storage/MAINTENANCE"))) {unlink(base_path("storage/MAINTENANCE")); } |
|
| 664 | + if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); } |
|
| 665 | 665 | } else { |
| 666 | - if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
|
| 666 | + if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); } |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | |
| 688 | 688 | $user = User::find($userID); |
| 689 | 689 | |
| 690 | - if($user->remember_token == $token && $request->session()->get('display_auth_nav') === $user->remember_token){ |
|
| 690 | + if ($user->remember_token == $token && $request->session()->get('display_auth_nav') === $user->remember_token) { |
|
| 691 | 691 | $user->auth_as = null; |
| 692 | 692 | $user->remember_token = null; |
| 693 | 693 | $user->save(); |
@@ -527,7 +527,9 @@ discard block |
||
| 527 | 527 | $text = file_get_contents(base_path('themes') . '/' . $entry . '/readme.md'); |
| 528 | 528 | $pattern = '/Theme Version:.*/'; |
| 529 | 529 | preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE); |
| 530 | - if (!count($matches)) continue; |
|
| 530 | + if (!count($matches)) { |
|
| 531 | + continue; |
|
| 532 | + } |
|
| 531 | 533 | $verNr = substr($matches[0][0], 15); |
| 532 | 534 | |
| 533 | 535 | } |
@@ -625,10 +627,10 @@ discard block |
||
| 625 | 627 | $value = $request->value; |
| 626 | 628 | |
| 627 | 629 | if($type === "toggle"){ |
| 628 | - if($request->toggle != ''){$value = "true";}else{$value = "false";} |
|
| 630 | + if($request->toggle != ''){$value = "true";} else{$value = "false";} |
|
| 629 | 631 | if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
| 630 | 632 | } elseif($type === "toggle2") { |
| 631 | - if($request->toggle != ''){$value = "verified";}else{$value = "auth";} |
|
| 633 | + if($request->toggle != ''){$value = "verified";} else{$value = "auth";} |
|
| 632 | 634 | if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
| 633 | 635 | } elseif($type === "text") { |
| 634 | 636 | if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, '"' . $value . '"');} |
@@ -643,10 +645,10 @@ discard block |
||
| 643 | 645 | if(EnvEditor::keyExists('LOG_LEVEL')){EnvEditor::editKey('LOG_LEVEL', 'error');} |
| 644 | 646 | } |
| 645 | 647 | } elseif($type === "register") { |
| 646 | - if($request->toggle != ''){$register = "true";}else{$register = "false";} |
|
| 648 | + if($request->toggle != ''){$register = "true";} else{$register = "false";} |
|
| 647 | 649 | Page::first()->update(['register' => $register]); |
| 648 | 650 | } elseif($type === "smtp") { |
| 649 | - if($request->toggle != ''){$value = "built-in";}else{$value = "smtp";} |
|
| 651 | + if($request->toggle != ''){$value = "built-in";} else{$value = "smtp";} |
|
| 650 | 652 | if(EnvEditor::keyExists('MAIL_MAILER')){EnvEditor::editKey('MAIL_MAILER', $value);} |
| 651 | 653 | |
| 652 | 654 | if(EnvEditor::keyExists('MAIL_HOST')){EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST);} |
@@ -656,10 +658,10 @@ discard block |
||
| 656 | 658 | if(EnvEditor::keyExists('MAIL_ENCRYPTION')){EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION);} |
| 657 | 659 | if(EnvEditor::keyExists('MAIL_FROM_ADDRESS')){EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS);} |
| 658 | 660 | } elseif($type === "homeurl") { |
| 659 | - if($request->value == 'default'){$value = "";}else{$value = '"' . $request->value . '"';} |
|
| 661 | + if($request->value == 'default'){$value = "";} else{$value = '"' . $request->value . '"';} |
|
| 660 | 662 | if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
| 661 | 663 | } elseif($type === "maintenance") { |
| 662 | - if($request->toggle != ''){$value = "true";}else{$value = "false";} |
|
| 664 | + if($request->toggle != ''){$value = "true";} else{$value = "false";} |
|
| 663 | 665 | if(file_exists(base_path("storage/MAINTENANCE"))){unlink(base_path("storage/MAINTENANCE"));} |
| 664 | 666 | if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
| 665 | 667 | } else { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $name = $request->input('name'); |
| 47 | 47 | |
| 48 | - if(env('MANUAL_USER_VERIFICATION') == true){ |
|
| 48 | + if (env('MANUAL_USER_VERIFICATION') == true) { |
|
| 49 | 49 | $block = 'yes'; |
| 50 | 50 | } else { |
| 51 | 51 | $block = 'no'; |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | $user = $request->name; |
| 67 | 67 | $email = $request->email; |
| 68 | 68 | |
| 69 | - if(env('REGISTER_AUTH') == 'verified'){ |
|
| 70 | - if(env('MANUAL_USER_VERIFICATION') == true){ |
|
| 69 | + if (env('REGISTER_AUTH') == 'verified') { |
|
| 70 | + if (env('MANUAL_USER_VERIFICATION') == true) { |
|
| 71 | 71 | try { |
| 72 | - Mail::send('auth.user-confirmation', ['user' => $user, 'email' => $email], function ($message) use ($user) { |
|
| 72 | + Mail::send('auth.user-confirmation', ['user' => $user, 'email' => $email], function($message) use ($user) { |
|
| 73 | 73 | $message->to(env('ADMIN_EMAIL')) |
| 74 | 74 | ->subject('New user registration'); |
| 75 | 75 | }); |