@@ -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 | }); |
@@ -18,13 +18,13 @@ |
||
| 18 | 18 | public function __invoke(EmailVerificationRequest $request) |
| 19 | 19 | { |
| 20 | 20 | if ($request->user()->hasVerifiedEmail()) { |
| 21 | - return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); |
|
| 21 | + return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | if ($request->user()->markEmailAsVerified()) { |
| 25 | 25 | event(new Verified($request->user())); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); |
|
| 28 | + return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function store(Request $request) |
| 31 | 31 | { |
| 32 | - if (! Auth::guard('web')->validate([ |
|
| 32 | + if (!Auth::guard('web')->validate([ |
|
| 33 | 33 | 'email' => $request->user()->email, |
| 34 | 34 | 'password' => $request->password, |
| 35 | 35 | ])) { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | // database. Otherwise we will parse the error and return the response. |
| 43 | 43 | $status = Password::reset( |
| 44 | 44 | $request->only('email', 'password', 'password_confirmation', 'token'), |
| 45 | - function ($user) use ($request) { |
|
| 45 | + function($user) use ($request) { |
|
| 46 | 46 | $user->forceFill([ |
| 47 | 47 | 'password' => Hash::make($request->password), |
| 48 | 48 | 'remember_token' => Str::random(60), |
@@ -1094,7 +1094,7 @@ |
||
| 1094 | 1094 | $pathinfo = "/img/" . $name. "." . pathinfo($file, PATHINFO_EXTENSION); |
| 1095 | 1095 | }} |
| 1096 | 1096 | return $pathinfo; |
| 1097 | - } |
|
| 1097 | + } |
|
| 1098 | 1098 | |
| 1099 | 1099 | if (file_exists(base_path(findAvatar($userId)))){ |
| 1100 | 1100 | $imagePath = base_path(findAvatar($userId)); |
@@ -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"; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $customParams = []; |
| 210 | 210 | foreach ($request->all() as $key => $param) { |
| 211 | 211 | //echo $key . " = " . $param . "<br />"; |
| 212 | - if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) |
|
| 212 | + if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) |
|
| 213 | 213 | continue; |
| 214 | 214 | |
| 215 | 215 | $customParams[$key] = $param; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $message = (ucwords($button?->name) ?? ucwords($linkType->typename)). " has been "; |
|
| 231 | + $message = (ucwords($button?->name) ?? ucwords($linkType->typename)) . " has been "; |
|
| 232 | 232 | |
| 233 | 233 | if ($OrigLink) { |
| 234 | 234 | //EDITING EXISTING |
@@ -236,50 +236,50 @@ discard block |
||
| 236 | 236 | $isCustomWebsite = $customParams['GetSiteIcon'] ?? null; |
| 237 | 237 | $SpacerHeight = $customParams['height'] ?? null; |
| 238 | 238 | |
| 239 | - if($linkType->typename == "link" and $isCustomWebsite == "1"){ |
|
| 239 | + if ($linkType->typename == "link" and $isCustomWebsite == "1") { |
|
| 240 | 240 | $OrigLink->update([ |
| 241 | 241 | 'link' => $LinkURL, |
| 242 | 242 | 'title' => $LinkTitle, |
| 243 | 243 | 'button_id' => "2", |
| 244 | 244 | ]); |
| 245 | - }elseif($linkType->typename == "link"){ |
|
| 245 | + }elseif ($linkType->typename == "link") { |
|
| 246 | 246 | $OrigLink->update([ |
| 247 | 247 | 'link' => $LinkURL, |
| 248 | 248 | 'title' => $LinkTitle, |
| 249 | 249 | 'button_id' => "1", |
| 250 | 250 | ]); |
| 251 | - }elseif($linkType->typename == "spacer"){ |
|
| 251 | + }elseif ($linkType->typename == "spacer") { |
|
| 252 | 252 | $OrigLink->update([ |
| 253 | 253 | 'link' => $LinkURL, |
| 254 | 254 | 'title' => $customParams['height'] ?? null, |
| 255 | 255 | 'button_id' => "43", |
| 256 | 256 | ]); |
| 257 | - }elseif($linkType->typename == "heading"){ |
|
| 257 | + }elseif ($linkType->typename == "heading") { |
|
| 258 | 258 | $OrigLink->update([ |
| 259 | 259 | 'link' => $LinkURL, |
| 260 | 260 | 'title' => $LinkTitle, |
| 261 | 261 | 'button_id' => "42", |
| 262 | 262 | ]); |
| 263 | - }elseif($linkType->typename == "text"){ |
|
| 263 | + }elseif ($linkType->typename == "text") { |
|
| 264 | 264 | $OrigLink->update([ |
| 265 | 265 | 'button_id' => "93", |
| 266 | 266 | 'title' => $request->text, |
| 267 | 267 | ]); |
| 268 | - }elseif($linkType->typename == "email"){ |
|
| 269 | - $LinkURL = "mailto:".$LinkURL; |
|
| 268 | + }elseif ($linkType->typename == "email") { |
|
| 269 | + $LinkURL = "mailto:" . $LinkURL; |
|
| 270 | 270 | $OrigLink->update([ |
| 271 | 271 | 'link' => $LinkURL, |
| 272 | 272 | 'button_id' => $button?->id, |
| 273 | 273 | 'title' => $LinkTitle, |
| 274 | 274 | ]); |
| 275 | - }elseif($linkType->typename == "telephone"){ |
|
| 276 | - $LinkURL = "tel:".$LinkURL; |
|
| 275 | + }elseif ($linkType->typename == "telephone") { |
|
| 276 | + $LinkURL = "tel:" . $LinkURL; |
|
| 277 | 277 | $OrigLink->update([ |
| 278 | 278 | 'link' => $LinkURL, |
| 279 | 279 | 'button_id' => $button?->id, |
| 280 | 280 | 'title' => $LinkTitle, |
| 281 | 281 | ]); |
| 282 | - }elseif($linkType->typename == "vcard"){ |
|
| 282 | + }elseif ($linkType->typename == "vcard") { |
|
| 283 | 283 | |
| 284 | 284 | $prefix = $request->input('prefix'); |
| 285 | 285 | $firstName = $request->input('first_name'); |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | 'button_id' => 96, |
| 352 | 352 | 'title' => $LinkTitle, |
| 353 | 353 | ]); |
| 354 | - }else{ |
|
| 354 | + } else { |
|
| 355 | 355 | $OrigLink->update([ |
| 356 | 356 | 'link' => $LinkURL, |
| 357 | 357 | 'title' => $LinkTitle, |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | ]); |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - $message .="updated"; |
|
| 362 | + $message .= "updated"; |
|
| 363 | 363 | |
| 364 | 364 | } else { |
| 365 | 365 | // ADDING NEW |
@@ -370,29 +370,29 @@ discard block |
||
| 370 | 370 | $links = new Link; |
| 371 | 371 | $links->link = $LinkURL; |
| 372 | 372 | $links->user_id = $userId; |
| 373 | - if($linkType->typename == "spacer"){ |
|
| 373 | + if ($linkType->typename == "spacer") { |
|
| 374 | 374 | $links->title = $SpacerHeight; |
| 375 | - }else{ |
|
| 375 | + } else { |
|
| 376 | 376 | $links->title = $LinkTitle; |
| 377 | 377 | } |
| 378 | - if($linkType->typename == "link" and $isCustomWebsite == "1"){ |
|
| 378 | + if ($linkType->typename == "link" and $isCustomWebsite == "1") { |
|
| 379 | 379 | $links->button_id = "2"; |
| 380 | - }elseif($linkType->typename == "link"){ |
|
| 380 | + }elseif ($linkType->typename == "link") { |
|
| 381 | 381 | $links->button_id = "1"; |
| 382 | - }elseif($linkType->typename == "spacer"){ |
|
| 382 | + }elseif ($linkType->typename == "spacer") { |
|
| 383 | 383 | $links->button_id = "43"; |
| 384 | - }elseif($linkType->typename == "heading"){ |
|
| 384 | + }elseif ($linkType->typename == "heading") { |
|
| 385 | 385 | $links->button_id = "42"; |
| 386 | - }elseif($linkType->typename == "text"){ |
|
| 386 | + }elseif ($linkType->typename == "text") { |
|
| 387 | 387 | $links->button_id = "93"; |
| 388 | 388 | $links->title = $request->text; |
| 389 | - }elseif($linkType->typename == "email"){ |
|
| 390 | - $links->link = "mailto:".$links->link; |
|
| 389 | + }elseif ($linkType->typename == "email") { |
|
| 390 | + $links->link = "mailto:" . $links->link; |
|
| 391 | 391 | $links->button_id = $button?->id; |
| 392 | - }elseif($linkType->typename == "telephone"){ |
|
| 393 | - $links->link = "tel:".$links->link; |
|
| 392 | + }elseif ($linkType->typename == "telephone") { |
|
| 393 | + $links->link = "tel:" . $links->link; |
|
| 394 | 394 | $links->button_id = $button?->id; |
| 395 | - }elseif($linkType->typename == "vcard"){ |
|
| 395 | + }elseif ($linkType->typename == "vcard") { |
|
| 396 | 396 | |
| 397 | 397 | $prefix = $request->input('prefix'); |
| 398 | 398 | $firstName = $request->input('first_name'); |
@@ -460,11 +460,11 @@ discard block |
||
| 460 | 460 | $links->link = $json ? $json : null; |
| 461 | 461 | |
| 462 | 462 | $links->button_id = 96; |
| 463 | - }else{ |
|
| 463 | + } else { |
|
| 464 | 464 | $links->button_id = $button?->id; |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | - if(empty($links->button_id)) { |
|
| 467 | + if (empty($links->button_id)) { |
|
| 468 | 468 | return redirect(route('showButtons')); die; |
| 469 | 469 | } |
| 470 | 470 | |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | |
| 532 | 532 | if (substr($linkId, -1) == '+') { |
| 533 | 533 | $linkWithoutPlus = str_replace('+', '', $linkId); |
| 534 | - return redirect(url('info/'.$linkWithoutPlus)); |
|
| 534 | + return redirect(url('info/' . $linkWithoutPlus)); |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | $link = Link::find($linkId); |
@@ -622,11 +622,11 @@ discard block |
||
| 622 | 622 | |
| 623 | 623 | $directory = base_path("assets/favicon/icons"); |
| 624 | 624 | $files = scandir($directory); |
| 625 | - foreach($files as $file) { |
|
| 626 | - if (strpos($file, $linkId.".") !== false) { |
|
| 627 | - $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}} |
|
| 625 | + foreach ($files as $file) { |
|
| 626 | + if (strpos($file, $linkId . ".") !== false) { |
|
| 627 | + $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }} |
|
| 628 | 628 | if (isset($pathinfo)) { |
| 629 | - try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {} |
|
| 629 | + try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {} |
|
| 630 | 630 | } |
| 631 | 631 | |
| 632 | 632 | return redirect('/studio/links'); |
@@ -639,11 +639,11 @@ discard block |
||
| 639 | 639 | |
| 640 | 640 | $directory = base_path("assets/favicon/icons"); |
| 641 | 641 | $files = scandir($directory); |
| 642 | - foreach($files as $file) { |
|
| 643 | - if (strpos($file, $linkId.".") !== false) { |
|
| 644 | - $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}} |
|
| 642 | + foreach ($files as $file) { |
|
| 643 | + if (strpos($file, $linkId . ".") !== false) { |
|
| 644 | + $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }} |
|
| 645 | 645 | if (isset($pathinfo)) { |
| 646 | - try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {} |
|
| 646 | + try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {} |
|
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | return redirect('/studio/links'); |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | 'sometimes', |
| 768 | 768 | 'max:255', |
| 769 | 769 | 'string', |
| 770 | - 'isunique:users,id,'.$userId, |
|
| 770 | + 'isunique:users,id,' . $userId, |
|
| 771 | 771 | ], |
| 772 | 772 | 'name' => 'sometimes|max:255|string', |
| 773 | 773 | 'image' => 'sometimes|image|mimes:jpeg,jpg,png,webp|max:2048', // Max file size: 2MB |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | $sharebtn = $request->sharebtn; |
| 792 | 792 | $tablinks = $request->tablinks; |
| 793 | 793 | |
| 794 | - if(env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')){ |
|
| 794 | + if (env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')) { |
|
| 795 | 795 | EnvEditor::editKey('HOME_URL', $pageName); |
| 796 | 796 | } |
| 797 | 797 | |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | |
| 881 | 881 | $user_id = Auth::user()->id; |
| 882 | 882 | $path = findBackground($user_id); |
| 883 | - $path = base_path('assets/img/background-img/'.$path); |
|
| 883 | + $path = base_path('assets/img/background-img/' . $path); |
|
| 884 | 884 | |
| 885 | 885 | if (File::exists($path)) { |
| 886 | 886 | File::delete($path); |
@@ -1017,7 +1017,7 @@ discard block |
||
| 1017 | 1017 | // echo Auth::id(); |
| 1018 | 1018 | $id = $request->id; |
| 1019 | 1019 | |
| 1020 | - if($id == Auth::id() and $id != "1") { |
|
| 1020 | + if ($id == Auth::id() and $id != "1") { |
|
| 1021 | 1021 | |
| 1022 | 1022 | Link::where('user_id', $id)->delete(); |
| 1023 | 1023 | |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | $fileName = "links-$domain-$date.json"; |
| 1064 | 1064 | $headers = [ |
| 1065 | 1065 | 'Content-Type' => 'application/json', |
| 1066 | - 'Content-Disposition' => 'attachment; filename="'.$fileName.'"', |
|
| 1066 | + 'Content-Disposition' => 'attachment; filename="' . $fileName . '"', |
|
| 1067 | 1067 | ]; |
| 1068 | 1068 | return response()->json($userData, 200, $headers); |
| 1069 | 1069 | |
@@ -1085,18 +1085,18 @@ discard block |
||
| 1085 | 1085 | $userData = $user->toArray(); |
| 1086 | 1086 | $userData['links'] = $links->toArray(); |
| 1087 | 1087 | |
| 1088 | - function findAvatar($name){ |
|
| 1088 | + function findAvatar($name) { |
|
| 1089 | 1089 | $directory = base_path('assets/img'); |
| 1090 | 1090 | $files = scandir($directory); |
| 1091 | 1091 | $pathinfo = "error.error"; |
| 1092 | - foreach($files as $file) { |
|
| 1093 | - if (strpos($file, $name.'.') !== false) { |
|
| 1094 | - $pathinfo = "/img/" . $name. "." . pathinfo($file, PATHINFO_EXTENSION); |
|
| 1092 | + foreach ($files as $file) { |
|
| 1093 | + if (strpos($file, $name . '.') !== false) { |
|
| 1094 | + $pathinfo = "/img/" . $name . "." . pathinfo($file, PATHINFO_EXTENSION); |
|
| 1095 | 1095 | }} |
| 1096 | 1096 | return $pathinfo; |
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | - if (file_exists(base_path(findAvatar($userId)))){ |
|
| 1099 | + if (file_exists(base_path(findAvatar($userId)))) { |
|
| 1100 | 1100 | $imagePath = base_path(findAvatar($userId)); |
| 1101 | 1101 | $imageData = base64_encode(file_get_contents($imagePath)); |
| 1102 | 1102 | $userData['image_data'] = $imageData; |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | $fileName = "user_data-$domain-$date.json"; |
| 1111 | 1111 | $headers = [ |
| 1112 | 1112 | 'Content-Type' => 'application/json', |
| 1113 | - 'Content-Disposition' => 'attachment; filename="'.$fileName.'"', |
|
| 1113 | + 'Content-Disposition' => 'attachment; filename="' . $fileName . '"', |
|
| 1114 | 1114 | ]; |
| 1115 | 1115 | return response()->json($userData, 200, $headers); |
| 1116 | 1116 | |
@@ -1209,14 +1209,14 @@ discard block |
||
| 1209 | 1209 | ->where('button_id', 94) |
| 1210 | 1210 | ->value('id'); |
| 1211 | 1211 | |
| 1212 | - if (is_null($iconId)){ |
|
| 1212 | + if (is_null($iconId)) { |
|
| 1213 | 1213 | return false; |
| 1214 | 1214 | } else { |
| 1215 | 1215 | return $iconId; |
| 1216 | 1216 | } |
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | - function addIcon($icon, $link){ |
|
| 1219 | + function addIcon($icon, $link) { |
|
| 1220 | 1220 | $userId = Auth::user()->id; |
| 1221 | 1221 | $links = new Link; |
| 1222 | 1222 | $links->link = $link; |
@@ -1228,7 +1228,7 @@ discard block |
||
| 1228 | 1228 | $links->save(); |
| 1229 | 1229 | } |
| 1230 | 1230 | |
| 1231 | - function updateIcon($icon, $link){ |
|
| 1231 | + function updateIcon($icon, $link) { |
|
| 1232 | 1232 | Link::where('id', searchIcon($icon))->update([ |
| 1233 | 1233 | 'button_id' => 94, |
| 1234 | 1234 | 'link' => $link, |
@@ -1236,12 +1236,12 @@ discard block |
||
| 1236 | 1236 | ]); |
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | - function saveIcon($icon, $link){ |
|
| 1240 | - if(isset($link)){ |
|
| 1241 | - if(searchIcon($icon) != NULL){ |
|
| 1239 | + function saveIcon($icon, $link) { |
|
| 1240 | + if (isset($link)) { |
|
| 1241 | + if (searchIcon($icon) != NULL) { |
|
| 1242 | 1242 | updateIcon($icon, $link); |
| 1243 | - }else{ |
|
| 1244 | - addIcon($icon, $link);} |
|
| 1243 | + } else { |
|
| 1244 | + addIcon($icon, $link); } |
|
| 1245 | 1245 | } |
| 1246 | 1246 | } |
| 1247 | 1247 | |
@@ -209,8 +209,9 @@ discard block |
||
| 209 | 209 | $customParams = []; |
| 210 | 210 | foreach ($request->all() as $key => $param) { |
| 211 | 211 | //echo $key . " = " . $param . "<br />"; |
| 212 | - if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) |
|
| 213 | - continue; |
|
| 212 | + if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) { |
|
| 213 | + continue; |
|
| 214 | + } |
|
| 214 | 215 | |
| 215 | 216 | $customParams[$key] = $param; |
| 216 | 217 | } |
@@ -218,8 +219,9 @@ discard block |
||
| 218 | 219 | $userId = Auth::user()->id; |
| 219 | 220 | $button = Button::where('name', $request->button)->first(); |
| 220 | 221 | |
| 221 | - if ($button && empty($LinkTitle)) |
|
| 222 | - $LinkTitle = $button->alt; |
|
| 222 | + if ($button && empty($LinkTitle)) { |
|
| 223 | + $LinkTitle = $button->alt; |
|
| 224 | + } |
|
| 223 | 225 | |
| 224 | 226 | if ($linkType->typename == 'video' && empty($LinkTitle)) { |
| 225 | 227 | $embed = OEmbed::get($LinkURL); |
@@ -242,44 +244,44 @@ discard block |
||
| 242 | 244 | 'title' => $LinkTitle, |
| 243 | 245 | 'button_id' => "2", |
| 244 | 246 | ]); |
| 245 | - }elseif($linkType->typename == "link"){ |
|
| 247 | + } elseif($linkType->typename == "link"){ |
|
| 246 | 248 | $OrigLink->update([ |
| 247 | 249 | 'link' => $LinkURL, |
| 248 | 250 | 'title' => $LinkTitle, |
| 249 | 251 | 'button_id' => "1", |
| 250 | 252 | ]); |
| 251 | - }elseif($linkType->typename == "spacer"){ |
|
| 253 | + } elseif($linkType->typename == "spacer"){ |
|
| 252 | 254 | $OrigLink->update([ |
| 253 | 255 | 'link' => $LinkURL, |
| 254 | 256 | 'title' => $customParams['height'] ?? null, |
| 255 | 257 | 'button_id' => "43", |
| 256 | 258 | ]); |
| 257 | - }elseif($linkType->typename == "heading"){ |
|
| 259 | + } elseif($linkType->typename == "heading"){ |
|
| 258 | 260 | $OrigLink->update([ |
| 259 | 261 | 'link' => $LinkURL, |
| 260 | 262 | 'title' => $LinkTitle, |
| 261 | 263 | 'button_id' => "42", |
| 262 | 264 | ]); |
| 263 | - }elseif($linkType->typename == "text"){ |
|
| 265 | + } elseif($linkType->typename == "text"){ |
|
| 264 | 266 | $OrigLink->update([ |
| 265 | 267 | 'button_id' => "93", |
| 266 | 268 | 'title' => $request->text, |
| 267 | 269 | ]); |
| 268 | - }elseif($linkType->typename == "email"){ |
|
| 270 | + } elseif($linkType->typename == "email"){ |
|
| 269 | 271 | $LinkURL = "mailto:".$LinkURL; |
| 270 | 272 | $OrigLink->update([ |
| 271 | 273 | 'link' => $LinkURL, |
| 272 | 274 | 'button_id' => $button?->id, |
| 273 | 275 | 'title' => $LinkTitle, |
| 274 | 276 | ]); |
| 275 | - }elseif($linkType->typename == "telephone"){ |
|
| 277 | + } elseif($linkType->typename == "telephone"){ |
|
| 276 | 278 | $LinkURL = "tel:".$LinkURL; |
| 277 | 279 | $OrigLink->update([ |
| 278 | 280 | 'link' => $LinkURL, |
| 279 | 281 | 'button_id' => $button?->id, |
| 280 | 282 | 'title' => $LinkTitle, |
| 281 | 283 | ]); |
| 282 | - }elseif($linkType->typename == "vcard"){ |
|
| 284 | + } elseif($linkType->typename == "vcard"){ |
|
| 283 | 285 | |
| 284 | 286 | $prefix = $request->input('prefix'); |
| 285 | 287 | $firstName = $request->input('first_name'); |
@@ -351,7 +353,7 @@ discard block |
||
| 351 | 353 | 'button_id' => 96, |
| 352 | 354 | 'title' => $LinkTitle, |
| 353 | 355 | ]); |
| 354 | - }else{ |
|
| 356 | + } else{ |
|
| 355 | 357 | $OrigLink->update([ |
| 356 | 358 | 'link' => $LinkURL, |
| 357 | 359 | 'title' => $LinkTitle, |
@@ -372,27 +374,27 @@ discard block |
||
| 372 | 374 | $links->user_id = $userId; |
| 373 | 375 | if($linkType->typename == "spacer"){ |
| 374 | 376 | $links->title = $SpacerHeight; |
| 375 | - }else{ |
|
| 377 | + } else{ |
|
| 376 | 378 | $links->title = $LinkTitle; |
| 377 | 379 | } |
| 378 | 380 | if($linkType->typename == "link" and $isCustomWebsite == "1"){ |
| 379 | 381 | $links->button_id = "2"; |
| 380 | - }elseif($linkType->typename == "link"){ |
|
| 382 | + } elseif($linkType->typename == "link"){ |
|
| 381 | 383 | $links->button_id = "1"; |
| 382 | - }elseif($linkType->typename == "spacer"){ |
|
| 384 | + } elseif($linkType->typename == "spacer"){ |
|
| 383 | 385 | $links->button_id = "43"; |
| 384 | - }elseif($linkType->typename == "heading"){ |
|
| 386 | + } elseif($linkType->typename == "heading"){ |
|
| 385 | 387 | $links->button_id = "42"; |
| 386 | - }elseif($linkType->typename == "text"){ |
|
| 388 | + } elseif($linkType->typename == "text"){ |
|
| 387 | 389 | $links->button_id = "93"; |
| 388 | 390 | $links->title = $request->text; |
| 389 | - }elseif($linkType->typename == "email"){ |
|
| 391 | + } elseif($linkType->typename == "email"){ |
|
| 390 | 392 | $links->link = "mailto:".$links->link; |
| 391 | 393 | $links->button_id = $button?->id; |
| 392 | - }elseif($linkType->typename == "telephone"){ |
|
| 394 | + } elseif($linkType->typename == "telephone"){ |
|
| 393 | 395 | $links->link = "tel:".$links->link; |
| 394 | 396 | $links->button_id = $button?->id; |
| 395 | - }elseif($linkType->typename == "vcard"){ |
|
| 397 | + } elseif($linkType->typename == "vcard"){ |
|
| 396 | 398 | |
| 397 | 399 | $prefix = $request->input('prefix'); |
| 398 | 400 | $firstName = $request->input('first_name'); |
@@ -460,7 +462,7 @@ discard block |
||
| 460 | 462 | $links->link = $json ? $json : null; |
| 461 | 463 | |
| 462 | 464 | $links->button_id = 96; |
| 463 | - }else{ |
|
| 465 | + } else{ |
|
| 464 | 466 | $links->button_id = $button?->id; |
| 465 | 467 | } |
| 466 | 468 | |
@@ -709,14 +711,16 @@ discard block |
||
| 709 | 711 | 'button' => 'required', |
| 710 | 712 | ]); |
| 711 | 713 | |
| 712 | - if (stringStartsWith($request->link, 'http://') == 'true' or stringStartsWith($request->link, 'https://') == 'true' or stringStartsWith($request->link, 'mailto:') == 'true') |
|
| 713 | - $link1 = $request->link; |
|
| 714 | - else |
|
| 715 | - $link1 = 'https://' . $request->link; |
|
| 716 | - if (stringEndsWith($request->link, '/') == 'true') |
|
| 717 | - $link = rtrim($link1, "/ "); |
|
| 718 | - else |
|
| 719 | - $link = $link1; |
|
| 714 | + if (stringStartsWith($request->link, 'http://') == 'true' or stringStartsWith($request->link, 'https://') == 'true' or stringStartsWith($request->link, 'mailto:') == 'true') { |
|
| 715 | + $link1 = $request->link; |
|
| 716 | + } else { |
|
| 717 | + $link1 = 'https://' . $request->link; |
|
| 718 | + } |
|
| 719 | + if (stringEndsWith($request->link, '/') == 'true') { |
|
| 720 | + $link = rtrim($link1, "/ "); |
|
| 721 | + } else { |
|
| 722 | + $link = $link1; |
|
| 723 | + } |
|
| 720 | 724 | $title = $request->title; |
| 721 | 725 | $order = $request->order; |
| 722 | 726 | $button = $request->button; |
@@ -1240,7 +1244,7 @@ discard block |
||
| 1240 | 1244 | if(isset($link)){ |
| 1241 | 1245 | if(searchIcon($icon) != NULL){ |
| 1242 | 1246 | updateIcon($icon, $link); |
| 1243 | - }else{ |
|
| 1247 | + } else{ |
|
| 1244 | 1248 | addIcon($icon, $link);} |
| 1245 | 1249 | } |
| 1246 | 1250 | } |
@@ -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('')); |
| 170 | 170 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | { |
| 41 | 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 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 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 | 64 | if(DB::table('users')->count() == '0'){ |
| 65 | 65 | Schema::disableForeignKeyConstraints(); |
@@ -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 | |
@@ -113,14 +113,14 @@ discard block |
||
| 113 | 113 | try {$users = DB::table('buttons')->count(); $failed = false;} catch (exception $e) {$failed = true;} |
| 114 | 114 | |
| 115 | 115 | if($failed == true){ |
| 116 | - if(EnvEditor::keyExists('DB_CONNECTION')){EnvEditor::editKey('DB_CONNECTION', 'sqlite');}else{EnvEditor::addKey('DB_CONNECTION', 'sqlite');} |
|
| 116 | + if(EnvEditor::keyExists('DB_CONNECTION')){EnvEditor::editKey('DB_CONNECTION', 'sqlite');} else{EnvEditor::addKey('DB_CONNECTION', 'sqlite');} |
|
| 117 | 117 | if(EnvEditor::keyExists('DB_HOST')){EnvEditor::deleteKey('DB_HOST');} |
| 118 | 118 | if(EnvEditor::keyExists('DB_PORT')){EnvEditor::deleteKey('DB_PORT');} |
| 119 | 119 | if(EnvEditor::keyExists('DB_DATABASE')){EnvEditor::deleteKey('DB_DATABASE');} |
| 120 | 120 | if(EnvEditor::keyExists('DB_USERNAME')){EnvEditor::deleteKey('DB_USERNAME');} |
| 121 | 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 | } |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | $llName = $user->littlelink_name; |
| 133 | 133 | |
| 134 | 134 | if($request->register == 'Yes'){ |
| 135 | - if(EnvEditor::keyExists('ALLOW_REGISTRATION')){EnvEditor::editKey('ALLOW_REGISTRATION', 'true');}else{EnvEditor::addKey('ALLOW_REGISTRATION', 'true');} |
|
| 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";} |
|
| 140 | + if($request->verify == 'Yes'){$value = "verified";} else{$value = "auth";} |
|
| 141 | 141 | if(EnvEditor::keyExists('REGISTER_AUTH')){EnvEditor::editKey('REGISTER_AUTH', $value);} |
| 142 | 142 | |
| 143 | - if($request->page == 'No'){$value = "";}else{$value = '"' . $llName . '"';} |
|
| 143 | + if($request->page == 'No'){$value = "";} else{$value = '"' . $llName . '"';} |
|
| 144 | 144 | if(EnvEditor::keyExists('HOME_URL')){EnvEditor::editKey('HOME_URL', $value);} |
| 145 | 145 | |
| 146 | 146 | if(EnvEditor::keyExists('APP_NAME')){EnvEditor::editKey('APP_NAME', '"' . $request->app . '"');} |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // store |
| 51 | 51 | $LinkType = new LinkType; |
| 52 | - $LinkType->typename = $request->typename; |
|
| 53 | - $LinkType->title = $request->title; |
|
| 52 | + $LinkType->typename = $request->typename; |
|
| 53 | + $LinkType->title = $request->title; |
|
| 54 | 54 | $LinkType->description = $request->description; |
| 55 | - $LinkType->icon = $request->icon; |
|
| 55 | + $LinkType->icon = $request->icon; |
|
| 56 | 56 | $LinkType->params = $request->params; |
| 57 | 57 | $LinkType->save(); |
| 58 | 58 | |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | // store |
| 103 | - $linktype->title = $request->title; |
|
| 103 | + $linktype->title = $request->title; |
|
| 104 | 104 | $linktype->description = $request->description; |
| 105 | - $linktype->icon = $request->icon; |
|
| 105 | + $linktype->icon = $request->icon; |
|
| 106 | 106 | $linktype->params = $request->params; |
| 107 | 107 | $linktype->save(); |
| 108 | 108 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // dynamiclly create params for predefined website to fill a select list with available buttons |
| 64 | 64 | if (!empty($linkType) && $linkType->typename === 'predefined') { |
| 65 | 65 | $buttons = Button::select('name')->orderBy('name', 'asc')->get(); |
| 66 | - $pdParams[] = ['tag' => 'select', 'name' => 'button', 'id'=> 'button']; |
|
| 66 | + $pdParams[] = ['tag' => 'select', 'name' => 'button', 'id'=> 'button']; |
|
| 67 | 67 | foreach ($buttons as $btn) { |
| 68 | 68 | $pdParams[0]['value'][] = [ |
| 69 | 69 | 'tag'=>'option', |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | $typeParams = json_decode($link['type_params']); |
| 134 | 134 | |
| 135 | 135 | |
| 136 | - //echo "<pre>"; |
|
| 136 | + //echo "<pre>"; |
|
| 137 | 137 | // print_r($typeParams); |
| 138 | - //print_r($params[$idx]); |
|
| 139 | - //echo "</pre>"; |
|
| 138 | + //print_r($params[$idx]); |
|
| 139 | + //echo "</pre>"; |
|
| 140 | 140 | |
| 141 | 141 | if ($typeParams && property_exists($typeParams, $params[$idx]['name'])) { |
| 142 | 142 | if (key_exists('value', $params[$idx]) && is_array($params[$idx]['value'])) { |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $data['params'] = json_decode($link['type_params']); |
| 34 | 34 | $data['link_title'] = $link->title; |
| 35 | 35 | $data['link_url'] = $link->link; |
| 36 | - if (Route::currentRouteName() != 'showButtons') {$data['button_id'] = $link->button_id;} |
|
| 36 | + if (Route::currentRouteName() != 'showButtons') {$data['button_id'] = $link->button_id; } |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | if (!empty($linkType) && $linkType->typename === 'predefined') { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | //echo "<pre>"; print_r($data['params']); exit; |
| 51 | 51 | |
| 52 | 52 | } |
| 53 | - return view('components.pageitems.'. $linkType->typename.'-form', $data); |
|
| 53 | + return view('components.pageitems.' . $linkType->typename . '-form', $data); |
|
| 54 | 54 | |
| 55 | 55 | $jsonForm = FormFactory::jsonForm(); |
| 56 | 56 | try { |
@@ -118,11 +118,13 @@ |
||
| 118 | 118 | $params = json_decode($json, true); |
| 119 | 119 | $idx = 0; |
| 120 | 120 | foreach ($params as $p) { |
| 121 | - if (!array_key_exists('for', $p)) |
|
| 122 | - $params[$idx]['for'] = $p['name']; |
|
| 121 | + if (!array_key_exists('for', $p)) { |
|
| 122 | + $params[$idx]['for'] = $p['name']; |
|
| 123 | + } |
|
| 123 | 124 | |
| 124 | - if (!array_key_exists('label', $p)) |
|
| 125 | - $params[$idx]['label'] = ucwords(preg_replace('/[^a-zA-Z0-9-]/', ' ', $p['name'])); |
|
| 125 | + if (!array_key_exists('label', $p)) { |
|
| 126 | + $params[$idx]['label'] = ucwords(preg_replace('/[^a-zA-Z0-9-]/', ' ', $p['name'])); |
|
| 127 | + } |
|
| 126 | 128 | |
| 127 | 129 | if (!array_key_exists('label', $p) || !str_contains($p['class'], 'form-control')) { |
| 128 | 130 | $params[$idx]['class'] = " form-control"; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |
| 66 | 66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, |
| 67 | 67 | 'link-id' => \App\Http\Middleware\LinkId::class, |
| 68 | - 'admin' => \App\Http\Middleware\admin::class, |
|
| 68 | + 'admin' => \App\Http\Middleware\admin::class, |
|
| 69 | 69 | 'blocked' => \App\Http\Middleware\CheckBlockedUser::class, |
| 70 | 70 | 'max.users' => \App\Http\Middleware\MaxUsers::class, |
| 71 | 71 | 'impersonate' => \App\Http\Middleware\Impersonate::class, |