Implemented: FS#3346 - Add a [web_root] placeholder to cronjob command
| | |
| | | $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['command_hint_txt'] = 'z. B. /var/www/clients/clientX/webY/myscript.sh oder http://www.mydomain.com/path/script.php. Der Platzhalter [web_root] wird durch /var/www/clients/clientX/webY/web ersetzt.'; |
| | | ?> |
| | |
| | | $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['command_hint_txt'] = 'e.g. /var/www/clients/clientX/webY/myscript.sh or http://www.mydomain.com/path/script.php, you can use [web_root] placeholder that is replaced by /var/www/clients/clientX/webY/web.'; |
| | | ?> |
| | |
| | | <div class="ctrlHolder"> |
| | | <label for="command">{tmpl_var name='command_txt'}</label> |
| | | <input name="command" id="command" value="{tmpl_var name='command'}" size="30" maxlength="255" type="text" class="textInput" /> |
| | | <p class="formHint">e.g. /var/www/clients/client1/myscript.sh or http://www.mydomain.com/path/script.php</p> |
| | | <p class="formHint">{tmpl_var name='command_hint_txt'}</p> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='active_txt'}</p> |
| | |
| | | if($job['type'] == 'url') { |
| | | $command .= "\t{$cron_config['wget']} -q -t 1 -T 7200 -O /dev/null " . escapeshellarg($job['command']) . " >/dev/null 2>&1"; |
| | | } else { |
| | | $web_root = ''; |
| | | if($job['type'] == 'chrooted') { |
| | | if(substr($job['command'], 0, strlen($this->parent_domain['document_root'])) == $this->parent_domain['document_root']) { |
| | | //* delete the unneeded path part |
| | | $job['command'] = substr($job['command'], strlen($this->parent_domain['document_root'])); |
| | | } |
| | | } else { |
| | | $web_root = $this->parent_domain['document_root']; |
| | | } |
| | | $web_root .= '/web'; |
| | | $job['command'] = str_replace('[web_root]', $web_root, $job['command']); |
| | | |
| | | $command .= "\t"; |
| | | if($job['type'] == 'chrooted' && substr($job['command'], 0, 1) != "/") $command .= $this->parent_domain['document_root'].'/'; |
| | | if($job['type'] != 'chrooted' && substr($job['command'], 0, 1) != "/") $command .= $this->parent_domain['document_root'].'/'; |
| | | $command .= $job['command']; |
| | | } |
| | | |