From 4badbadf0131bf6b4b62d8e337ff6020e66b35ff Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 17 Jan 2017 13:04:13 +0100 Subject: [statistics_reporting] added cronjob for weekly report --- .../statistics_reporting/hooks/cron.inc.php | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'modules-available') diff --git a/modules-available/statistics_reporting/hooks/cron.inc.php b/modules-available/statistics_reporting/hooks/cron.inc.php index b79883df..57e64a84 100644 --- a/modules-available/statistics_reporting/hooks/cron.inc.php +++ b/modules-available/statistics_reporting/hooks/cron.inc.php @@ -1,3 +1,35 @@ array(), 'perClient' => array(), 'perUser' => array(), 'perVM' => array())); + $data['perLocation'] = GetData::perLocation(true); + $data['perClient'] = GetData::perClient(true); + $data['perUser'] = GetData::perUser(true); + $data['perVM'] = GetData::perVM(); + + + $statisticsReport = json_encode($data); + + $url = CONFIG_REPORTING_URL; + + $curl = curl_init($url); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json")); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $statisticsReport); + + $json_response = curl_exec($curl); + + curl_close($curl); +} -- cgit v1.2.3-55-g7522