Skip to content

Commit f6dcdcc

Browse files
committed
Merge branch 'develop' into 6501-php-ssh-cron
2 parents 0a212b1 + bc13403 commit f6dcdcc

File tree

4 files changed

+42
-39
lines changed

4 files changed

+42
-39
lines changed

interface/web/client/client_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,13 @@ function onAfterUpdate() {
468468
}
469469

470470
// lock and cancel
471-
if(!isset($this->dataRecord['locked'])) $this->dataRecord['locked'] = 'n';
471+
if(!isset($this->dataRecord['locked']) && isset($this->dataRecord['username'])) $this->dataRecord['locked'] = 'n';
472472
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && $this->dataRecord["locked"] != $this->oldDataRecord['locked'])
473473
{
474474
$lock = $app->functions->func_client_lock($this->id,$this->dataRecord["locked"]);
475475
}
476476

477-
if(!isset($this->dataRecord['canceled'])) $this->dataRecord['canceled'] = 'n';
477+
if(!isset($this->dataRecord['canceled']) && isset($this->dataRecord['username'])) $this->dataRecord['canceled'] = 'n';
478478
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && $this->dataRecord["canceled"] != $this->oldDataRecord['canceled']) {
479479
$cancel = $app->functions->func_client_cancel($this->id,$this->dataRecord["canceled"]);
480480
}

interface/web/mail/mail_user_edit.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,15 @@ function onAfterInsert() {
344344

345345

346346
// Set the fields for dovecot
347-
$disableimap = ($this->dataRecord["disableimap"])?'y':'n';
348-
$disablepop3 = ($this->dataRecord["disablepop3"])?'y':'n';
349-
$disablesmtp = ($this->dataRecord["disablesmtp"])?'y':'n';
350-
$disabledeliver = ($this->dataRecord["disabledeliver"])?'y':'n';
351-
352-
$sql = "UPDATE mail_user SET disableimap = ?, disablesieve = ?, disablepop3 = ?, disablesmtp = ?, disabledeliver = ?, disablelda = ?, disablelmtp = ? WHERE mailuser_id = ?";
353-
$app->db->query($sql, $disableimap, $disableimap, $disablepop3, $disablesmtp, $disabledeliver, $disabledeliver, $disabledeliver, $this->id);
347+
if(isset($this->dataRecord["email"])) {
348+
$disableimap = ($this->dataRecord["disableimap"]) ? 'y' : 'n';
349+
$disablepop3 = ($this->dataRecord["disablepop3"]) ? 'y' : 'n';
350+
$disablesmtp = ($this->dataRecord["disablesmtp"]) ? 'y' : 'n';
351+
$disabledeliver = ($this->dataRecord["disabledeliver"]) ? 'y' : 'n';
352+
353+
$sql = "UPDATE mail_user SET disableimap = ?, disablesieve = ?, disablepop3 = ?, disablesmtp = ?, disabledeliver = ?, disablelda = ?, disablelmtp = ? WHERE mailuser_id = ?";
354+
$app->db->query($sql, $disableimap, $disableimap, $disablepop3, $disablesmtp, $disabledeliver, $disabledeliver, $disabledeliver, $this->id);
355+
}
354356
}
355357

356358
function onAfterUpdate() {
@@ -363,13 +365,15 @@ function onAfterUpdate() {
363365
}
364366

365367
// Set the fields for dovecot
366-
$disableimap = (isset($this->dataRecord["disableimap"]) && $this->dataRecord["disableimap"])?'y':'n';
367-
$disablepop3 = (isset($this->dataRecord["disablepop3"]) && $this->dataRecord["disablepop3"])?'y':'n';
368-
$disablesmtp = (isset($this->dataRecord["disablesmtp"]) && $this->dataRecord["disablesmtp"])?'y':'n';
369-
$disabledeliver = (isset($this->dataRecord["disabledeliver"]) && $this->dataRecord["disabledeliver"])?'y':'n';
370-
371-
$sql = "UPDATE mail_user SET disableimap = ?, disablesieve = ?, `disablesieve-filter` = ?, disablepop3 = ?, disablesmtp = ?, disabledeliver = ?, disablelda = ?, disablelmtp = ? WHERE mailuser_id = ?";
372-
$app->db->query($sql, $disableimap, $disableimap, $disableimap, $disablepop3, $disablesmtp, $disabledeliver, $disabledeliver, $disabledeliver, $this->id);
368+
if(isset($this->dataRecord["email"])) {
369+
$disableimap = (isset($this->dataRecord["disableimap"]) && $this->dataRecord["disableimap"]) ? 'y' : 'n';
370+
$disablepop3 = (isset($this->dataRecord["disablepop3"]) && $this->dataRecord["disablepop3"]) ? 'y' : 'n';
371+
$disablesmtp = (isset($this->dataRecord["disablesmtp"]) && $this->dataRecord["disablesmtp"]) ? 'y' : 'n';
372+
$disabledeliver = (isset($this->dataRecord["disabledeliver"]) && $this->dataRecord["disabledeliver"]) ? 'y' : 'n';
373+
374+
$sql = "UPDATE mail_user SET disableimap = ?, disablesieve = ?, `disablesieve-filter` = ?, disablepop3 = ?, disablesmtp = ?, disabledeliver = ?, disablelda = ?, disablelmtp = ? WHERE mailuser_id = ?";
375+
$app->db->query($sql, $disableimap, $disableimap, $disableimap, $disablepop3, $disablesmtp, $disabledeliver, $disabledeliver, $disabledeliver, $this->id);
376+
}
373377

374378
// Spamfilter policy
375379
$policy_id = $app->functions->intval($this->dataRecord["policy"]);
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
<?php
22
$wb['server_id_txt'] = 'Server';
3-
$wb['parent_domain_id_txt'] = 'Rodi?ovsk� webstr�nka';
4-
$wb['active_txt'] = 'Akt�vne';
3+
$wb['parent_domain_id_txt'] = 'Rodičovská webstránka';
4+
$wb['active_txt'] = 'Aktívne';
55
$wb['client_txt'] = 'Klient';
6-
$wb['run_min_txt'] = 'Min�ty';
6+
$wb['run_min_txt'] = 'Minúty';
77
$wb['run_hour_txt'] = 'Hodiny';
88
$wb['run_mday_txt'] = 'Dni v mesiaci';
99
$wb['run_month_txt'] = 'Mesiace';
10-
$wb['run_wday_txt'] = 'Dni v t��dni';
11-
$wb['command_txt'] = 'Pr�kaz na spustenie (pr�kazy s� vykon�van� pomocou sh, urls cez wget)';
12-
$wb['limit_cron_txt'] = 'Maxim�lny po?et povolen�ch cron pracovn�ch miest bolo dosiahnut�.';
13-
$wb['limit_cron_frequency_txt'] = 'Cron frekvencia prekra?uje povolen� limit.';
14-
$wb['run_min_error_format'] = 'Neplatn� form�t min�t.';
15-
$wb['run_hour_error_format'] = 'Neplatn� form�t hod�n.';
16-
$wb['run_mday_error_format'] = 'Neplatn� form�t pre dni v mesiaci.';
17-
$wb['run_month_error_format'] = 'Neplatn� form�t mesiaca.';
18-
$wb['run_wday_error_format'] = 'Neplatn� form�t pre dni v t��dni.';
19-
$wb['command_error_format'] = 'Neplatn� form�t pr�kazu. Upozor?ujeme, �e v pr�pade url volania iba http / https, s� povolen�.';
20-
$wb['unknown_fieldtype_error'] = 'Nezn�my druh pola bol pou�it�.';
21-
$wb['server_id_error_empty'] = 'The server ID is empty.';
22-
$wb['limit_cron_url_txt'] = 'URL cron only. Please enter a URL starting with https:// as cron command.';
23-
$wb['command_error_empty'] = 'Command is empty.';
24-
$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.';
25-
$wb['log_output_txt'] = 'Log output';
26-
$wb['domain_not_selected_placeholder_txt'] = 'No domain selected';
27-
$wb['is_jailed_txt'] = 'Jailkit secured cronjob';
10+
$wb['run_wday_txt'] = 'Dni v týždni';
11+
$wb['command_txt'] = 'Príkaz na spustenie (príkazy sú vykonávané pomocou sh, urls cez wget)';
12+
$wb['limit_cron_txt'] = 'Bol dosiahnutý maximálny počet povolených cron úloh.';
13+
$wb['limit_cron_frequency_txt'] = 'Frekvencia spustenia úlohy prekračuje povolený limit.';
14+
$wb['run_min_error_format'] = 'Neplatný formát minút.';
15+
$wb['run_hour_error_format'] = 'Neplatný formát hodín.';
16+
$wb['run_mday_error_format'] = 'Neplatný formát pre dni v mesiaci.';
17+
$wb['run_month_error_format'] = 'Neplatný formát mesiaca.';
18+
$wb['run_wday_error_format'] = 'Neplatný formát pre dni v týždni.';
19+
$wb['command_error_format'] = 'Neplatný formát príkazu. Upozorňujeme, že v prípade url volania sú povolené iba http / https.';
20+
$wb['unknown_fieldtype_error'] = 'Neznámy druh poľa v dotaze';
21+
$wb['server_id_error_empty'] = 'Nieje vyplnené ID servera.';
22+
$wb['limit_cron_url_txt'] = 'Vyžaduje sa úloha s URL. Prosím zadajte URL začínajúce s https:// ako cron príkaz.';
23+
$wb['command_error_empty'] = 'Nezadaný príkaz.';
24+
$wb['command_hint_txt'] = 'e.g. /var/www/clients/clientX/webY/myscript.sh alebo https://www.mydomain.com/path/script.php, môžete použiť [web_root] makro, ktoré bude nahradené s hodnotou /var/www/clients/clientX/webY/web.';
25+
$wb['log_output_txt'] = 'Zaznamenaj výstup do log súboru';
26+
?>

server/lib/classes/cron.d/100-monitor_sys_usage.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ public function onRunJob() {
142142
// Calculate network bandwidth in kilobytes per second
143143
if(isset($data['rx']) && isset($data['tx'])) {
144144
$data['net'][] = [
145-
'rx' => ($rx - $data['rx']) / $interval_seconds / 1024,
146-
'tx' => ($tx - $data['tx']) / $interval_seconds / 1024
145+
'rx' => abs($rx - $data['rx']) / $interval_seconds / 1024,
146+
'tx' => abs($tx - $data['tx']) / $interval_seconds / 1024
147147
];
148148

149149
}

0 commit comments

Comments
 (0)