From 5fdf956eb44a1cb81da1e4671c88311619214c7a Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 15 Jan 2022 22:37:46 -0500 Subject: [PATCH] Added Basic Opt In Telemetry during install to help determine the number of installs and what country of origin are using the application along with any comments --- blank.php | 35 +++++++++++++++--- setup.php | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 133 insertions(+), 6 deletions(-) diff --git a/blank.php b/blank.php index 8568419c..970c0c57 100644 --- a/blank.php +++ b/blank.php @@ -12,15 +12,40 @@

Blank Page


This is a great starting point for new custom pages.

- + + "$company_name", + 'city' => "$city", + 'state' => "$state", + 'country' => "$country", + 'currency' => "$currency", + 'comments' => "$comments" + ) + ); + + $opts = array('http' => + array( + 'method' => 'POST', + 'header' => 'Content-type: application/x-www-form-urlencoded', + 'content' => $postdata + ) + ); + + $context = stream_context_create($opts); + + $result = file_get_contents('https://telemetry.itflow.org', false, $context); + + echo $result; + + header("Location: clients.php"); ?> diff --git a/setup.php b/setup.php index d5e923ff..1fef219d 100644 --- a/setup.php +++ b/setup.php @@ -561,6 +561,64 @@ if(isset($_POST['add_company_settings'])){ mysqli_query($mysqli,"INSERT INTO calendars SET calendar_name = 'Default', calendar_color = 'blue', calendar_created_at = NOW(), company_id = $company_id"); + + $_SESSION['alert_message'] = "Company $name created!"; + + header("Location: setup.php?telemetry"); + +} + +if(isset($_POST['add_telemetry'])){ + + $comments = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['comments']))); + + $sql = mysqli_query($mysqli,"SELECT * FROM companies LIMIT 1"); + $row = mysqli_fetch_array($sql); + + $comments = $_POST['comments']; + + + if($_POST['company_name'] == 1){ + $company_name = $row['company_name']; + } + + if($_POST['geographics'] == 1){ + $city = $row['company_city']; + $state = $row['company_state']; + $country = $row['company_country']; + $currency = $row['company_currency']; + } + + if($_POST['geographics'] == 1 OR $_POST['company_name'] == 1){ + + $postdata = http_build_query( + array( + 'company_name' => "$company_name", + 'city' => "$city", + 'state' => "$state", + 'country' => "$country", + 'currency' => "$currency", + 'comments' => "$comments" + ) + ); + + $opts = array('http' => + array( + 'method' => 'POST', + 'header' => 'Content-type: application/x-www-form-urlencoded', + 'content' => $postdata + ) + ); + + $context = stream_context_create($opts); + + $result = file_get_contents('https://telemetry.itflow.com', false, $context); + + echo $result; + + } + + //final setup stages $myfile = fopen("config.php", "a"); $txt = "\$config_enable_setup = 0;\n\n"; @@ -649,6 +707,12 @@ if(isset($_POST['add_company_settings'])){

Company

+ @@ -937,13 +1001,51 @@ if(isset($_POST['add_company_settings'])){
- + + + + +
+
+

Telemetry

+
+
+
+
Choose the data you would like to share with us
+ +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ + +
+ +
+ + + +
+
+
+