From 6bf5df4a7fe312731bff3c4f6cc877f784f42882 Mon Sep 17 00:00:00 2001 From: Florian Bogner <f.bogner@pcsg.de> Date: Thu, 10 Nov 2016 16:54:44 +0100 Subject: [PATCH] fix: Changed crosnervice url to cron.quiqqer.com --- src/QUI/Cron/CronService.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/QUI/Cron/CronService.php b/src/QUI/Cron/CronService.php index eed6452..a67aed0 100644 --- a/src/QUI/Cron/CronService.php +++ b/src/QUI/Cron/CronService.php @@ -8,7 +8,7 @@ use QUI\System\Log; class CronService { - const CRONSERVICE_URL = "http://server.local"; + const CRONSERVICE_URL = "https://cron.quiqqer.com"; private $domain; private $https; @@ -108,11 +108,12 @@ class CronService $url = self::CRONSERVICE_URL . "/admin/ajax.php?" . "_rf=" . urlencode("[\"package_pcsg_cronservice_ajax_register\"]") . "&package=" . urlencode("pcsg/cronservice") . - "&lang=de" . // TODO Detect language + "&lang=" . QUI::getUserBySession()->getLang() . "&domain=" . urlencode($domain) . "&email=" . urlencode($email) . "&packageDir=" . urlencode($packageDir) . - "&https=" . ($https ? "1" : "0"); + "&https=" . ($https ? "1" : "0") . + "&user=" . QUI::getUserBySession()->getName(); $curl = curl_init(); @@ -138,6 +139,10 @@ class CronService if (!isset($data['status']) || $data['status'] != 1) { Log::addDebug($response); Log::writeRecursive($data); + if (isset($data['message'])) { + throw new Exception($data['message']); + } + throw new Exception("Something went wrong!"); } @@ -160,7 +165,7 @@ class CronService $url = self::CRONSERVICE_URL . "/admin/ajax.php?" . "_rf=" . urlencode('["' . $function . '"]') . "&package=" . urlencode("pcsg/cronservice") . - "&lang=de";// TODO Detect language + "&lang=" . QUI::getUserBySession()->getLang(); foreach ($params as $param => $value) { $url .= '&' . $param . '=' . urlencode($value); -- GitLab