@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | public function boot() |
| 28 | 28 | { |
| 29 | 29 | Paginator::useBootstrap(); |
| 30 | - Validator::extend('isunique', function ($attribute, $value, $parameters, $validator) { |
|
| 30 | + Validator::extend('isunique', function($attribute, $value, $parameters, $validator) { |
|
| 31 | 31 | $value = strtolower($value); |
| 32 | 32 | $query = DB::table($parameters[0])->whereRaw("LOWER({$attribute}) = ?", [$value]); |
| 33 | 33 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | return $query->count() === 0; |
| 39 | 39 | }); |
| 40 | - Validator::extend('exturl', function ($attribute, $value, $parameters, $validator) { |
|
| 40 | + Validator::extend('exturl', function($attribute, $value, $parameters, $validator) { |
|
| 41 | 41 | $allowed_schemes = ['http', 'https', 'mailto', 'tel']; |
| 42 | 42 | return in_array(parse_url($value, PHP_URL_SCHEME), $allowed_schemes, true); |
| 43 | 43 | }); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | //Show littlelink page. example => http://127.0.0.1:8000/+admin |
| 85 | 85 | public function littlelink(request $request) |
| 86 | 86 | { |
| 87 | - if(isset($request->useif)){ |
|
| 87 | + if (isset($request->useif)) { |
|
| 88 | 88 | $littlelink_name = User::select('littlelink_name')->where('id', $request->littlelink)->value('littlelink_name'); |
| 89 | 89 | $id = $request->littlelink; |
| 90 | 90 | } else { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | return abort(404); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - return redirect(url('@'.$user)); |
|
| 143 | + return redirect(url('@' . $user)); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | //Show add/update form |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $bid = $links->button_id; |
| 167 | 167 | |
| 168 | - if($bid == 1 or $bid == 2){ |
|
| 168 | + if ($bid == 1 or $bid == 2) { |
|
| 169 | 169 | $data['linkTypeID'] = "2"; |
| 170 | 170 | } elseif ($bid == 42) { |
| 171 | 171 | $data['linkTypeID'] = "3"; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $customParams = []; |
| 213 | 213 | foreach ($request->all() as $key => $param) { |
| 214 | 214 | //echo $key . " = " . $param . "<br />"; |
| 215 | - if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) |
|
| 215 | + if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) |
|
| 216 | 216 | continue; |
| 217 | 217 | |
| 218 | 218 | $customParams[$key] = $param; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $message = (ucwords($button?->name) ?? ucwords($linkType->typename)). " has been "; |
|
| 234 | + $message = (ucwords($button?->name) ?? ucwords($linkType->typename)) . " has been "; |
|
| 235 | 235 | |
| 236 | 236 | if ($OrigLink) { |
| 237 | 237 | //EDITING EXISTING |
@@ -239,31 +239,31 @@ discard block |
||
| 239 | 239 | $isCustomWebsite = $customParams['GetSiteIcon'] ?? null; |
| 240 | 240 | $SpacerHeight = $customParams['height'] ?? null; |
| 241 | 241 | |
| 242 | - if($linkType->typename == "link" and $isCustomWebsite == "1"){ |
|
| 242 | + if ($linkType->typename == "link" and $isCustomWebsite == "1") { |
|
| 243 | 243 | $OrigLink->update([ |
| 244 | 244 | 'link' => $LinkURL, |
| 245 | 245 | 'title' => $LinkTitle, |
| 246 | 246 | 'button_id' => "2", |
| 247 | 247 | ]); |
| 248 | - }elseif($linkType->typename == "link"){ |
|
| 248 | + }elseif ($linkType->typename == "link") { |
|
| 249 | 249 | $OrigLink->update([ |
| 250 | 250 | 'link' => $LinkURL, |
| 251 | 251 | 'title' => $LinkTitle, |
| 252 | 252 | 'button_id' => "1", |
| 253 | 253 | ]); |
| 254 | - }elseif($linkType->typename == "spacer"){ |
|
| 254 | + }elseif ($linkType->typename == "spacer") { |
|
| 255 | 255 | $OrigLink->update([ |
| 256 | 256 | 'link' => $LinkURL, |
| 257 | 257 | 'title' => $customParams['height'] ?? null, |
| 258 | 258 | 'button_id' => "43", |
| 259 | 259 | ]); |
| 260 | - }elseif($linkType->typename == "heading"){ |
|
| 260 | + }elseif ($linkType->typename == "heading") { |
|
| 261 | 261 | $OrigLink->update([ |
| 262 | 262 | 'link' => $LinkURL, |
| 263 | 263 | 'title' => $LinkTitle, |
| 264 | 264 | 'button_id' => "42", |
| 265 | 265 | ]); |
| 266 | - }elseif($linkType->typename == "text"){ |
|
| 266 | + }elseif ($linkType->typename == "text") { |
|
| 267 | 267 | $sanitizedText = $request->text; |
| 268 | 268 | $sanitizedText = strip_tags($sanitizedText, '<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4>'); |
| 269 | 269 | $sanitizedText = preg_replace("/<a([^>]*)>/i", "<a $1 rel=\"noopener noreferrer nofollow\">", $sanitizedText); |
@@ -272,19 +272,19 @@ discard block |
||
| 272 | 272 | 'button_id' => "93", |
| 273 | 273 | 'title' => $sanitizedText, |
| 274 | 274 | ]); |
| 275 | - }elseif($linkType->typename == "email"){ |
|
| 275 | + }elseif ($linkType->typename == "email") { |
|
| 276 | 276 | $OrigLink->update([ |
| 277 | 277 | 'link' => $LinkURL, |
| 278 | 278 | 'button_id' => $button?->id, |
| 279 | 279 | 'title' => $LinkTitle, |
| 280 | 280 | ]); |
| 281 | - }elseif($linkType->typename == "telephone"){ |
|
| 281 | + }elseif ($linkType->typename == "telephone") { |
|
| 282 | 282 | $OrigLink->update([ |
| 283 | 283 | 'link' => $LinkURL, |
| 284 | 284 | 'button_id' => $button?->id, |
| 285 | 285 | 'title' => $LinkTitle, |
| 286 | 286 | ]); |
| 287 | - }elseif($linkType->typename == "vcard"){ |
|
| 287 | + }elseif ($linkType->typename == "vcard") { |
|
| 288 | 288 | |
| 289 | 289 | $prefix = $request->input('prefix'); |
| 290 | 290 | $firstName = $request->input('first_name'); |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | 'button_id' => 96, |
| 357 | 357 | 'title' => $LinkTitle, |
| 358 | 358 | ]); |
| 359 | - }else{ |
|
| 359 | + } else { |
|
| 360 | 360 | $OrigLink->update([ |
| 361 | 361 | 'link' => $LinkURL, |
| 362 | 362 | 'title' => $LinkTitle, |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | ]); |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - $message .="updated"; |
|
| 367 | + $message .= "updated"; |
|
| 368 | 368 | |
| 369 | 369 | } else { |
| 370 | 370 | // ADDING NEW |
@@ -375,31 +375,31 @@ discard block |
||
| 375 | 375 | $links = new Link; |
| 376 | 376 | $links->link = $LinkURL; |
| 377 | 377 | $links->user_id = $userId; |
| 378 | - if($linkType->typename == "spacer"){ |
|
| 378 | + if ($linkType->typename == "spacer") { |
|
| 379 | 379 | $links->title = $SpacerHeight; |
| 380 | - }else{ |
|
| 380 | + } else { |
|
| 381 | 381 | $links->title = $LinkTitle; |
| 382 | 382 | } |
| 383 | - if($linkType->typename == "link" and $isCustomWebsite == "1"){ |
|
| 383 | + if ($linkType->typename == "link" and $isCustomWebsite == "1") { |
|
| 384 | 384 | $links->button_id = "2"; |
| 385 | - }elseif($linkType->typename == "link"){ |
|
| 385 | + }elseif ($linkType->typename == "link") { |
|
| 386 | 386 | $links->button_id = "1"; |
| 387 | - }elseif($linkType->typename == "spacer"){ |
|
| 387 | + }elseif ($linkType->typename == "spacer") { |
|
| 388 | 388 | $links->button_id = "43"; |
| 389 | - }elseif($linkType->typename == "heading"){ |
|
| 389 | + }elseif ($linkType->typename == "heading") { |
|
| 390 | 390 | $links->button_id = "42"; |
| 391 | - }elseif($linkType->typename == "text"){ |
|
| 391 | + }elseif ($linkType->typename == "text") { |
|
| 392 | 392 | $sanitizedText = $request->text; |
| 393 | 393 | $sanitizedText = strip_tags($sanitizedText, '<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4>'); |
| 394 | 394 | $sanitizedText = preg_replace("/<a([^>]*)>/i", "<a $1 rel=\"noopener noreferrer nofollow\">", $sanitizedText); |
| 395 | 395 | $sanitizedText = strip_tags_except_allowed_protocols($sanitizedText); |
| 396 | 396 | $links->button_id = "93"; |
| 397 | 397 | $links->title = $sanitizedText; |
| 398 | - }elseif($linkType->typename == "email"){ |
|
| 398 | + }elseif ($linkType->typename == "email") { |
|
| 399 | 399 | $links->button_id = $button?->id; |
| 400 | - }elseif($linkType->typename == "telephone"){ |
|
| 400 | + }elseif ($linkType->typename == "telephone") { |
|
| 401 | 401 | $links->button_id = $button?->id; |
| 402 | - }elseif($linkType->typename == "vcard"){ |
|
| 402 | + }elseif ($linkType->typename == "vcard") { |
|
| 403 | 403 | |
| 404 | 404 | $prefix = $request->input('prefix'); |
| 405 | 405 | $firstName = $request->input('first_name'); |
@@ -467,11 +467,11 @@ discard block |
||
| 467 | 467 | $links->link = $json ? $json : null; |
| 468 | 468 | |
| 469 | 469 | $links->button_id = 96; |
| 470 | - }else{ |
|
| 470 | + } else { |
|
| 471 | 471 | $links->button_id = $button?->id; |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - if(empty($links->button_id)) { |
|
| 474 | + if (empty($links->button_id)) { |
|
| 475 | 475 | throw new \Exception('Invalid link'); |
| 476 | 476 | } |
| 477 | 477 | |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | |
| 539 | 539 | if (substr($linkId, -1) == '+') { |
| 540 | 540 | $linkWithoutPlus = str_replace('+', '', $linkId); |
| 541 | - return redirect(url('info/'.$linkWithoutPlus)); |
|
| 541 | + return redirect(url('info/' . $linkWithoutPlus)); |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | $link = Link::find($linkId); |
@@ -629,11 +629,11 @@ discard block |
||
| 629 | 629 | |
| 630 | 630 | $directory = base_path("assets/favicon/icons"); |
| 631 | 631 | $files = scandir($directory); |
| 632 | - foreach($files as $file) { |
|
| 633 | - if (strpos($file, $linkId.".") !== false) { |
|
| 634 | - $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}} |
|
| 632 | + foreach ($files as $file) { |
|
| 633 | + if (strpos($file, $linkId . ".") !== false) { |
|
| 634 | + $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }} |
|
| 635 | 635 | if (isset($pathinfo)) { |
| 636 | - try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {} |
|
| 636 | + try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {} |
|
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | return redirect('/studio/links'); |
@@ -646,11 +646,11 @@ discard block |
||
| 646 | 646 | |
| 647 | 647 | $directory = base_path("assets/favicon/icons"); |
| 648 | 648 | $files = scandir($directory); |
| 649 | - foreach($files as $file) { |
|
| 650 | - if (strpos($file, $linkId.".") !== false) { |
|
| 651 | - $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}} |
|
| 649 | + foreach ($files as $file) { |
|
| 650 | + if (strpos($file, $linkId . ".") !== false) { |
|
| 651 | + $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }} |
|
| 652 | 652 | if (isset($pathinfo)) { |
| 653 | - try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {} |
|
| 653 | + try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {} |
|
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | return redirect('/studio/links'); |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | 'sometimes', |
| 775 | 775 | 'max:255', |
| 776 | 776 | 'string', |
| 777 | - 'isunique:users,id,'.$userId, |
|
| 777 | + 'isunique:users,id,' . $userId, |
|
| 778 | 778 | ], |
| 779 | 779 | 'name' => 'sometimes|max:255|string', |
| 780 | 780 | 'image' => 'sometimes|image|mimes:jpeg,jpg,png,webp|max:2048', // Max file size: 2MB |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | $sharebtn = $request->sharebtn; |
| 800 | 800 | $tablinks = $request->tablinks; |
| 801 | 801 | |
| 802 | - if(env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')){ |
|
| 802 | + if (env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')) { |
|
| 803 | 803 | EnvEditor::editKey('HOME_URL', $pageName); |
| 804 | 804 | } |
| 805 | 805 | |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | // echo Auth::id(); |
| 1034 | 1034 | $id = $request->id; |
| 1035 | 1035 | |
| 1036 | - if($id == Auth::id() and $id != "1") { |
|
| 1036 | + if ($id == Auth::id() and $id != "1") { |
|
| 1037 | 1037 | |
| 1038 | 1038 | Link::where('user_id', $id)->delete(); |
| 1039 | 1039 | |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | $fileName = "links-$domain-$date.json"; |
| 1081 | 1081 | $headers = [ |
| 1082 | 1082 | 'Content-Type' => 'application/json', |
| 1083 | - 'Content-Disposition' => 'attachment; filename="'.$fileName.'"', |
|
| 1083 | + 'Content-Disposition' => 'attachment; filename="' . $fileName . '"', |
|
| 1084 | 1084 | ]; |
| 1085 | 1085 | return response()->json($userData, 200, $headers); |
| 1086 | 1086 | |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | $userData = $user->toArray(); |
| 1103 | 1103 | $userData['links'] = $links->toArray(); |
| 1104 | 1104 | |
| 1105 | - if (file_exists(base_path(findAvatar($userId)))){ |
|
| 1105 | + if (file_exists(base_path(findAvatar($userId)))) { |
|
| 1106 | 1106 | $imagePath = base_path(findAvatar($userId)); |
| 1107 | 1107 | $imageData = base64_encode(file_get_contents($imagePath)); |
| 1108 | 1108 | $userData['image_data'] = $imageData; |
@@ -1116,7 +1116,7 @@ discard block |
||
| 1116 | 1116 | $fileName = "user_data-$domain-$date.json"; |
| 1117 | 1117 | $headers = [ |
| 1118 | 1118 | 'Content-Type' => 'application/json', |
| 1119 | - 'Content-Disposition' => 'attachment; filename="'.$fileName.'"', |
|
| 1119 | + 'Content-Disposition' => 'attachment; filename="' . $fileName . '"', |
|
| 1120 | 1120 | ]; |
| 1121 | 1121 | return response()->json($userData, 200, $headers); |
| 1122 | 1122 | |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function db(request $request) |
| 40 | 40 | { |
| 41 | - if($request->database == 'MySQL'){ |
|
| 41 | + if ($request->database == 'MySQL') { |
|
| 42 | 42 | return redirect(url('?mysql')); |
| 43 | - }else{ |
|
| 43 | + } else { |
|
| 44 | 44 | return redirect(url('?4')); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $file = base_path('INSTALLERLOCK'); |
| 57 | 57 | if (!file_exists($file)) { |
| 58 | - $handleFile = fopen($file, 'w') or die('Cannot create file: '.$file); |
|
| 58 | + $handleFile = fopen($file, 'w') or die('Cannot create file: ' . $file); |
|
| 59 | 59 | fclose($handleFile); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - try{EnvEditor::addKey('ADMIN_EMAIL', $email);}catch(Exception $e){} |
|
| 62 | + try {EnvEditor::addKey('ADMIN_EMAIL', $email); } catch (Exception $e) {} |
|
| 63 | 63 | |
| 64 | - if(DB::table('users')->count() == '0'){ |
|
| 64 | + if (DB::table('users')->count() == '0') { |
|
| 65 | 65 | Schema::disableForeignKeyConstraints(); |
| 66 | 66 | DB::table('users')->delete(); |
| 67 | 67 | DB::table('users')->truncate(); |
@@ -92,12 +92,12 @@ discard block |
||
| 92 | 92 | $DB_USERNAME = $request->username; |
| 93 | 93 | $DB_PASSWORD = $request->password; |
| 94 | 94 | |
| 95 | - if(EnvEditor::keyExists('DB_CONNECTION')){EnvEditor::editKey('DB_CONNECTION', $DB_CONNECTION);}else{EnvEditor::addKey('DB_CONNECTION', $DB_CONNECTION);} |
|
| 96 | - if(EnvEditor::keyExists('DB_HOST')){EnvEditor::editKey('DB_HOST', $DB_HOST);}else{EnvEditor::addKey('DB_HOST', $DB_HOST);} |
|
| 97 | - if(EnvEditor::keyExists('DB_PORT')){EnvEditor::editKey('DB_PORT', $DB_PORT);}else{EnvEditor::addKey('DB_PORT', $DB_PORT);} |
|
| 98 | - if(EnvEditor::keyExists('DB_DATABASE')){EnvEditor::editKey('DB_DATABASE', $DB_DATABASE);}else{EnvEditor::addKey('DB_DATABASE', $DB_DATABASE);} |
|
| 99 | - if(EnvEditor::keyExists('DB_USERNAME')){EnvEditor::editKey('DB_USERNAME', $DB_USERNAME);}else{EnvEditor::addKey('DB_USERNAME', $DB_USERNAME);} |
|
| 100 | - if(EnvEditor::keyExists('DB_PASSWORD')){EnvEditor::editKey('DB_PASSWORD', $DB_PASSWORD);}else{EnvEditor::addKey('DB_PASSWORD', $DB_PASSWORD);} |
|
| 95 | + if (EnvEditor::keyExists('DB_CONNECTION')) {EnvEditor::editKey('DB_CONNECTION', $DB_CONNECTION); } else {EnvEditor::addKey('DB_CONNECTION', $DB_CONNECTION); } |
|
| 96 | + if (EnvEditor::keyExists('DB_HOST')) {EnvEditor::editKey('DB_HOST', $DB_HOST); } else {EnvEditor::addKey('DB_HOST', $DB_HOST); } |
|
| 97 | + if (EnvEditor::keyExists('DB_PORT')) {EnvEditor::editKey('DB_PORT', $DB_PORT); } else {EnvEditor::addKey('DB_PORT', $DB_PORT); } |
|
| 98 | + if (EnvEditor::keyExists('DB_DATABASE')) {EnvEditor::editKey('DB_DATABASE', $DB_DATABASE); } else {EnvEditor::addKey('DB_DATABASE', $DB_DATABASE); } |
|
| 99 | + if (EnvEditor::keyExists('DB_USERNAME')) {EnvEditor::editKey('DB_USERNAME', $DB_USERNAME); } else {EnvEditor::addKey('DB_USERNAME', $DB_USERNAME); } |
|
| 100 | + if (EnvEditor::keyExists('DB_PASSWORD')) {EnvEditor::editKey('DB_PASSWORD', $DB_PASSWORD); } else {EnvEditor::addKey('DB_PASSWORD', $DB_PASSWORD); } |
|
| 101 | 101 | |
| 102 | 102 | return redirect(url('mysql-test')); |
| 103 | 103 | |
@@ -105,22 +105,22 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | public function mysqlTest(request $request) |
| 107 | 107 | { |
| 108 | - try {Artisan::call('migrate');} catch (exception $e) {$failed = "true";} |
|
| 109 | - try {Artisan::call('db:seed --force');} catch (exception $e) {$failed = "true";} |
|
| 110 | - try {Artisan::call('db:seed --class="PageSeeder" --force');} catch (exception $e) {$failed = "true";} |
|
| 111 | - try {Artisan::call('db:seed --class="ButtonSeeder" --force');} catch (exception $e) {$failed = "true";} |
|
| 112 | - |
|
| 113 | - try {$users = DB::table('buttons')->count(); $failed = false;} catch (exception $e) {$failed = true;} |
|
| 114 | - |
|
| 115 | - if($failed == true){ |
|
| 116 | - if(EnvEditor::keyExists('DB_CONNECTION')){EnvEditor::editKey('DB_CONNECTION', 'sqlite');}else{EnvEditor::addKey('DB_CONNECTION', 'sqlite');} |
|
| 117 | - if(EnvEditor::keyExists('DB_HOST')){EnvEditor::deleteKey('DB_HOST');} |
|
| 118 | - if(EnvEditor::keyExists('DB_PORT')){EnvEditor::deleteKey('DB_PORT');} |
|
| 119 | - if(EnvEditor::keyExists('DB_DATABASE')){EnvEditor::deleteKey('DB_DATABASE');} |
|
| 120 | - if(EnvEditor::keyExists('DB_USERNAME')){EnvEditor::deleteKey('DB_USERNAME');} |
|
| 121 | - if(EnvEditor::keyExists('DB_PASSWORD')){EnvEditor::deleteKey('DB_PASSWORD');} |
|
| 108 | + try {Artisan::call('migrate'); } catch (exception $e) {$failed = "true"; } |
|
| 109 | + try {Artisan::call('db:seed --force'); } catch (exception $e) {$failed = "true"; } |
|
| 110 | + try {Artisan::call('db:seed --class="PageSeeder" --force'); } catch (exception $e) {$failed = "true"; } |
|
| 111 | + try {Artisan::call('db:seed --class="ButtonSeeder" --force'); } catch (exception $e) {$failed = "true"; } |
|
| 112 | + |
|
| 113 | + try {$users = DB::table('buttons')->count(); $failed = false; } catch (exception $e) {$failed = true; } |
|
| 114 | + |
|
| 115 | + if ($failed == true) { |
|
| 116 | + if (EnvEditor::keyExists('DB_CONNECTION')) {EnvEditor::editKey('DB_CONNECTION', 'sqlite'); } else {EnvEditor::addKey('DB_CONNECTION', 'sqlite'); } |
|
| 117 | + if (EnvEditor::keyExists('DB_HOST')) {EnvEditor::deleteKey('DB_HOST'); } |
|
| 118 | + if (EnvEditor::keyExists('DB_PORT')) {EnvEditor::deleteKey('DB_PORT'); } |
|
| 119 | + if (EnvEditor::keyExists('DB_DATABASE')) {EnvEditor::deleteKey('DB_DATABASE'); } |
|
| 120 | + if (EnvEditor::keyExists('DB_USERNAME')) {EnvEditor::deleteKey('DB_USERNAME'); } |
|
| 121 | + if (EnvEditor::keyExists('DB_PASSWORD')) {EnvEditor::deleteKey('DB_PASSWORD'); } |
|
| 122 | 122 | return redirect(url('?error')); |
| 123 | - }else{ |
|
| 123 | + } else { |
|
| 124 | 124 | return redirect(url('?4')); |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -131,25 +131,25 @@ discard block |
||
| 131 | 131 | $user = User::find(1); |
| 132 | 132 | $llName = $user->littlelink_name; |
| 133 | 133 | |
| 134 | - if($request->register == 'Yes'){ |
|
| 135 | - if(EnvEditor::keyExists('ALLOW_REGISTRATION')){EnvEditor::editKey('ALLOW_REGISTRATION', 'true');}else{EnvEditor::addKey('ALLOW_REGISTRATION', 'true');} |
|
| 134 | + if ($request->register == 'Yes') { |
|
| 135 | + if (EnvEditor::keyExists('ALLOW_REGISTRATION')) {EnvEditor::editKey('ALLOW_REGISTRATION', 'true'); } else {EnvEditor::addKey('ALLOW_REGISTRATION', 'true'); } |
|
| 136 | 136 | } else { |
| 137 | - if(EnvEditor::keyExists('ALLOW_REGISTRATION')){EnvEditor::editKey('ALLOW_REGISTRATION', 'false');}else{EnvEditor::addKey('ALLOW_REGISTRATION', 'false');} |
|
| 137 | + if (EnvEditor::keyExists('ALLOW_REGISTRATION')) {EnvEditor::editKey('ALLOW_REGISTRATION', 'false'); } else {EnvEditor::addKey('ALLOW_REGISTRATION', 'false'); } |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if($request->verify == 'Yes'){$value = "verified";}else{$value = "auth";} |
|
| 141 | - if(EnvEditor::keyExists('REGISTER_AUTH')){EnvEditor::editKey('REGISTER_AUTH', $value);} |
|
| 140 | + if ($request->verify == 'Yes') {$value = "verified"; } else {$value = "auth"; } |
|
| 141 | + if (EnvEditor::keyExists('REGISTER_AUTH')) {EnvEditor::editKey('REGISTER_AUTH', $value); } |
|
| 142 | 142 | |
| 143 | - if($request->page == 'No'){$value = "";}else{$value = '"' . $llName . '"';} |
|
| 144 | - if(EnvEditor::keyExists('HOME_URL')){EnvEditor::editKey('HOME_URL', $value);} |
|
| 143 | + if ($request->page == 'No') {$value = ""; } else {$value = '"' . $llName . '"'; } |
|
| 144 | + if (EnvEditor::keyExists('HOME_URL')) {EnvEditor::editKey('HOME_URL', $value); } |
|
| 145 | 145 | |
| 146 | - if(EnvEditor::keyExists('APP_NAME')){EnvEditor::editKey('APP_NAME', '"' . $request->app . '"');} |
|
| 146 | + if (EnvEditor::keyExists('APP_NAME')) {EnvEditor::editKey('APP_NAME', '"' . $request->app . '"'); } |
|
| 147 | 147 | |
| 148 | - if(file_exists(base_path("INSTALLING"))){unlink(base_path("INSTALLING"));} |
|
| 148 | + if (file_exists(base_path("INSTALLING"))) {unlink(base_path("INSTALLING")); } |
|
| 149 | 149 | |
| 150 | 150 | $file = base_path('INSTALLERLOCK'); |
| 151 | 151 | if (file_exists($file)) { |
| 152 | - unlink($file) or die('Cannot delete file: '.$file); |
|
| 152 | + unlink($file) or die('Cannot delete file: ' . $file); |
|
| 153 | 153 | sleep(1); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $value = $request->value; |
| 165 | 165 | $value = '"' . $request->value . '"'; |
| 166 | 166 | |
| 167 | - if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);} |
|
| 167 | + if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); } |
|
| 168 | 168 | |
| 169 | 169 | return Redirect(url('dashboard')); |
| 170 | 170 | } |
@@ -11,13 +11,13 @@ |
||
| 11 | 11 | |
| 12 | 12 | public function handle(Request $request, Closure $next) |
| 13 | 13 | { |
| 14 | - $cookiesAlreadySet = $request->hasCookie(strtolower(config('app.name')).'_session') || $request->hasCookie('XSRF-TOKEN'); |
|
| 14 | + $cookiesAlreadySet = $request->hasCookie(strtolower(config('app.name')) . '_session') || $request->hasCookie('XSRF-TOKEN'); |
|
| 15 | 15 | |
| 16 | 16 | if ($cookiesAlreadySet) { |
| 17 | 17 | return $next($request); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - Cookie::queue(Cookie::forget(str_replace(' ', '_', strtolower(config('app.name')).'_session'))); |
|
| 20 | + Cookie::queue(Cookie::forget(str_replace(' ', '_', strtolower(config('app.name')) . '_session'))); |
|
| 21 | 21 | Cookie::queue(Cookie::forget('XSRF-TOKEN')); |
| 22 | 22 | config(['session.driver' => 'array']); |
| 23 | 23 | |