Commit 4b5da4ef authored by Till Brehm's avatar Till Brehm

Fixed: FS#3423 - Clients with URL cron limit can also add chrooted cronjobs

parent 454fa04e
......@@ -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) {
......
......@@ -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.';
?>
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment