Till Brehm
2014-04-04 4b5da4efdf0ebb1ee01ccfa66ba8b8ac71c592c0
Fixed: FS#3423 - Clients with URL cron limit can also add chrooted cronjobs
3 files modified
18 ■■■■ changed files
interface/web/sites/cron_edit.php 14 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_cron.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_cron.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/cron_edit.php
@@ -140,13 +140,18 @@
        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"]) {
                    $app->error($app->tform->wordbook["limit_cron_frequency_txt"]);
                    $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;
            }
        }
@@ -165,7 +170,7 @@
        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 @@
                    $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) {
interface/web/sites/lib/lang/de_cron.lng
@@ -19,4 +19,6 @@
$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.';
?>
interface/web/sites/lib/lang/en_cron.lng
@@ -19,4 +19,6 @@
$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.';
?>