diff --git a/interface/web/sites/cron_edit.php b/interface/web/sites/cron_edit.php index 092c7dd294e6002b762be389b2c2e8a1d9d2f9fc..6ec02c7433be31eee8577cad06ebb111b40b777c 100644 --- a/interface/web/sites/cron_edit.php +++ b/interface/web/sites/cron_edit.php @@ -140,7 +140,7 @@ class page_action extends tform_actions { if($_SESSION["s"]["user"]["typ"] != 'admin') { // Get the limits of the client $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); - $client = $app->db->queryOneRecord("SELECT limit_cron_frequency FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + $client = $app->db->queryOneRecord("SELECT limit_cron_frequency, limit_cron_type FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); if($client["limit_cron_frequency"] > 1) { if($app->tform->cron_min_freq < $client["limit_cron_frequency"]) { @@ -148,6 +148,11 @@ class page_action extends tform_actions { $has_error = true; } } + + if($client["limit_cron_type"] == 'url' && $this->dataRecord["type"] != 'url') { + $app->error($app->tform->wordbook["limit_cron_url_txt"]); + $has_error = true; + } } if($has_error == true) { @@ -165,7 +170,7 @@ class page_action extends tform_actions { if($_SESSION["s"]["user"]["typ"] != 'admin') { // Get the limits of the client $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); - $client = $app->db->queryOneRecord("SELECT limit_cron_frequency FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + $client = $app->db->queryOneRecord("SELECT limit_cron_frequency, limit_cron_type FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); if($client["limit_cron_frequency"] > 1) { if($app->tform->cron_min_freq < $client["limit_cron_frequency"]) { @@ -173,6 +178,11 @@ class page_action extends tform_actions { $has_error = true; } } + + if($client["limit_cron_type"] == 'url' && $this->dataRecord["type"] != 'url') { + $app->error($app->tform->wordbook["limit_cron_url_txt"]); + $has_error = true; + } } if($has_error == true) { diff --git a/interface/web/sites/lib/lang/de_cron.lng b/interface/web/sites/lib/lang/de_cron.lng index e9fed6846dd810ed1c5404c64e462b27e0381634..864b5a59cc11c555407fe619d17c838dd3feb732 100644 --- a/interface/web/sites/lib/lang/de_cron.lng +++ b/interface/web/sites/lib/lang/de_cron.lng @@ -19,4 +19,6 @@ $wb['run_wday_error_format'] = 'Das Format für Wochentage ist nicht korrekt.'; $wb['command_error_format'] = 'Das Format für den Befehl ist nicht korrekt. Beachten Sie, dass bei einem URL Aufruf nur http und https erlaubt ist.'; $wb['unknown_fieldtype_error'] = 'Es wurde ein unbekanntes Feld verwendet.'; $wb['server_id_error_empty'] = 'Die Server-ID ist leer.'; +$wb['limit_cron_url_txt'] = 'Es sind nur URL cronjobs möglich. Der Cron-Befehl muss mit http:// beginnen.'; +$wb['command_error_empty'] = 'Befehl ist leer.'; ?> diff --git a/interface/web/sites/lib/lang/en_cron.lng b/interface/web/sites/lib/lang/en_cron.lng index e6ba8ad3dc1a4133cf728403d6d883c63767f978..fabb4645c45ded9a089165dfe61801cba6c10ed2 100644 --- a/interface/web/sites/lib/lang/en_cron.lng +++ b/interface/web/sites/lib/lang/en_cron.lng @@ -19,4 +19,6 @@ $wb['run_wday_error_format'] = 'Invalid format for days of the week.'; $wb['command_error_format'] = 'Invalid command format. Please note that in case of an url call only http/https is allowed.'; $wb['unknown_fieldtype_error'] = 'An unknown field type has been used.'; $wb['server_id_error_empty'] = 'The server ID is empty.'; +$wb['limit_cron_url_txt'] = 'URL cron only. Please enter a URL starting with http:// as cron command.'; +$wb['command_error_empty'] = 'Command is empty.'; ?> \ No newline at end of file