Skip to content

Commit d2b8a4e

Browse files
committed
Update of branch:
- Use alternatives for jailed shell accounts in Debian/Ubuntu systems instead of an alias - Made the file /etc/bash.bashrc obsolete - command_format updated so that the domain placeholder can be used for wget commands - Introduction of the .bashrc.d directory for shell users so that they can extend their Bash environment more flexibly and easily via resource files - Minor refactoring and other changes
1 parent b78a8eb commit d2b8a4e

37 files changed

+395
-232
lines changed

interface/lib/classes/validate_cron.inc.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,25 @@ function command_format($field_name, $field_value, $validator) {
4848
global $app, $page;
4949

5050
if(preg_match("'^(\w+):\/\/'", $field_value, $matches)) {
51-
if(preg_match("/\{DOMAIN\}/", $field_value)) {
51+
//* Add the {DOMAIN} placeholder to the validation process
52+
if(preg_match("/{DOMAIN}/", $field_value)) {
53+
5254
if(isset($app->remoting_lib->primary_id)) {
53-
$domain = $app->remoting_lib->dataRecord;
55+
$cronjob = $app->remoting_lib->dataRecord;
5456
} else {
55-
$domain = $page->dataRecord;
57+
$cronjob = $page->dataRecord;
5658
}
5759

58-
if($domain['parent_domain_id'] > 0){
59-
$parent_domain = $app->db->queryOneRecord("SELECT `domain` FROM `web_domain` WHERE `domain_id` = ?", $domain['parent_domain_id']);
60+
if($cronjob['parent_domain_id'] > 0) {
61+
$parent_domain = $app->db->queryOneRecord("SELECT `domain` FROM `web_domain` WHERE `domain_id` = ?", $cronjob['parent_domain_id']);
6062
}
6163

6264
$trans = array(
6365
'{DOMAIN}' => $parent_domain['domain']
6466
);
6567

6668
$field_value = strtr($field_value, $trans);
69+
6770
}
6871

6972
$parsed = parse_url($field_value);

interface/web/sites/ajax_get_json.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,15 @@
264264

265265
$domain_owner = $app->db->queryOneRecord("SELECT limit_cron_type FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $web["sys_groupid"]);
266266

267-
//* True when the site is assigned to a client
267+
//* True if the site is assigned to a client
268268
if(isset($domain_owner["limit_cron_type"])) {
269269
if($domain_owner["limit_cron_type"] == 'full') {
270270
$cron_type = 'full';
271271
} else {
272272
$cron_type = 'chrooted';
273273
}
274274
} else {
275-
//* True when the site is assigned to the admin
275+
//* True if the site is assigned to the admin
276276
$cron_type = 'full';
277277
}
278278

interface/web/sites/cron_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function onShowEnd() {
8080

8181
$parent_domain = $app->db->queryOneRecord("SELECT `domain_id`, `system_user`, `system_group`, `domain`, `document_root`, `hd_quota`, `php_cli_binary`
8282
FROM `web_domain`
83-
LEFT JOIN server_php ON web_domain.server_php_id = server_php.server_php_id
83+
LEFT JOIN server_php ON web_domain.server_php_id = server_php.server_php_id
8484
WHERE `domain_id` = ?", $this->dataRecord["parent_domain_id"]);
8585

8686
$php_cli_binary = $parent_domain['php_cli_binary'];

interface/web/sites/lib/lang/ar_cron.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ $wb['limit_cron_url_txt'] = 'URL cron only. Please enter a URL starting with htt
2323
$wb['command_error_empty'] = 'Command is empty.';
2424
$wb['command_hint_txt'] = 'e.g. /var/www/clients/clientX/webY/myscript.sh or https://www.mydomain.com/path/script.php, you can use [web_root] placeholder that is replaced by /var/www/clients/clientX/webY/web.';
2525
$wb['log_output_txt'] = 'Log output';
26-
$wb['domain_not_selected_placeholder_txt'] = 'No Domain selected';
26+
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';
2727
?>

interface/web/sites/lib/lang/bg_cron.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ $wb['limit_cron_url_txt'] = 'URL cron only. Please enter a URL starting with htt
2323
$wb['command_error_empty'] = 'Command is empty.';
2424
$wb['command_hint_txt'] = 'e.g. /var/www/clients/clientX/webY/myscript.sh or https://www.mydomain.com/path/script.php, you can use [web_root] placeholder that is replaced by /var/www/clients/clientX/webY/web.';
2525
$wb['log_output_txt'] = 'Log output';
26-
$wb['domain_not_selected_placeholder_txt'] = 'No Domain selected';
26+
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';
2727
?>

interface/web/sites/lib/lang/br_cron.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ $wb['log_output_txt'] = 'Gravar saída do log';
2424
$wb['limit_cron_url_txt'] = 'Somente URL no Cron. Por favor insira uma URL iniciando com https:// como um comando no Cron.';
2525
$wb['command_error_empty'] = 'Comando a executar está vazio.';
2626
$wb['Cron Job'] = 'Tarefas no Cron';
27-
$wb['domain_not_selected_placeholder_txt'] = 'No Domain selected';
27+
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';

interface/web/sites/lib/lang/ca_cron.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ $wb['limit_cron_url_txt'] = 'Cron de type URL seulement. Merci d\'introduire une
2323
$wb['command_error_empty'] = 'Le champ Commande à exécuter est vide.';
2424
$wb['command_hint_txt'] = 'par exemple /var/www/clients/clientX/webY/monscript.sh ou https://www.mondomaine.com/chemin/script.php, vous pouvez utiliser la constante [web_root] qui sera remplacée par /var/www/clients/clientX/webY/web.';
2525
$wb['log_output_txt'] = 'Journaliser la sortie du cron';
26-
$wb['domain_not_selected_placeholder_txt'] = 'No Domain selected';
26+
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';
2727
?>

interface/web/sites/lib/lang/cn_cron.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ $wb['command_hint_txt'] = '例如,/var/www/clients/clientX/webY/myscript.sh
2323
$wb['log_output_txt'] = '记录输出';
2424
$wb['limit_cron_url_txt'] = '仅限 URL 计划任务。请将以 https:// 开头的 URL 作为计划任务命令输入。';
2525
$wb['command_error_empty'] = '命令为空。';
26-
$wb['domain_not_selected_placeholder_txt'] = 'No Domain selected';
26+
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';
2727
?>

interface/web/sites/lib/lang/cz_cron.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ $wb['limit_cron_url_txt'] = 'URL cron only. Please enter a URL starting with htt
2323
$wb['command_error_empty'] = 'Command is empty.';
2424
$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.';
2525
$wb['log_output_txt'] = 'Log output';
26-
$wb['domain_not_selected_placeholder_txt'] = 'No Domain selected';
26+
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';

interface/web/sites/lib/lang/dk_cron.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ $wb['limit_cron_url_txt'] = 'URL cron only. Please enter a URL starting with htt
2323
$wb['command_error_empty'] = 'Command er tom.';
2424
$wb['command_hint_txt'] = 'e.g. /var/www/clients/clientX/webY/myscript.sh or https://www.mydomain.com/path/script.php, you can use [web_root] placeholder that is replaced by /var/www/clients/clientX/webY/web.';
2525
$wb['log_output_txt'] = 'Log output';
26-
$wb['domain_not_selected_placeholder_txt'] = 'No Domain selected';
26+
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';

0 commit comments

Comments
 (0)