From 3306292f93068c10f636ee2365da1db8c5aa1060 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 28 Jun 2011 12:26:34 -0400 Subject: [PATCH 1/2] CC-2463:Install doesn't overwrite cron file -fixed --- install/include/airtime-install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/include/airtime-install.php b/install/include/airtime-install.php index 717198a92..b260179a1 100644 --- a/install/include/airtime-install.php +++ b/install/include/airtime-install.php @@ -151,7 +151,7 @@ AirtimeInstall::CreateZendPhpLogFile(); $hour = rand(0,23); $minute = rand(0,59); -$fp = fopen('/etc/cron.d/airtime-crons','a'); +$fp = fopen('/etc/cron.d/airtime-crons','w'); fwrite($fp, "$minute $hour * * * root /usr/lib/airtime/utils/phone_home_stat\n"); fclose($fp); From f8a1990ec1261e1a7938559335d6d54b44614687 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 28 Jun 2011 12:34:47 -0400 Subject: [PATCH 2/2] CC-2469:Client is sending data without checkout feedback flag - fixed --- utils/phone_home_stat.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/utils/phone_home_stat.php b/utils/phone_home_stat.php index 84cedb5d7..61436ae89 100644 --- a/utils/phone_home_stat.php +++ b/utils/phone_home_stat.php @@ -55,17 +55,19 @@ if (PEAR::isError($CC_DBC)) { echo "* Connected to database".PHP_EOL; $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC); } -$infoArray = Application_Model_Preference::GetSystemInfo(true); - -$ch = curl_init(); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); -curl_setopt($ch, CURLOPT_POST, 1); -curl_setopt($ch, CURLOPT_URL, 'http://stat.sourcefabric.org/index.php?p=airtime'); - -$data = json_encode($infoArray); - -$dataArray = array("data" => $data ); - -curl_setopt($ch, CURLOPT_POSTFIELDS, $dataArray); -$result = curl_exec($ch); +if(Application_Model_Preference::GetSupportFeedback() == '1'){ + $infoArray = Application_Model_Preference::GetSystemInfo(true); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_URL, 'http://stat.sourcefabric.org/index.php?p=airtime'); + + $data = json_encode($infoArray); + + $dataArray = array("data" => $data ); + + curl_setopt($ch, CURLOPT_POSTFIELDS, $dataArray); + $result = curl_exec($ch); +} ?> \ No newline at end of file