Skip to content

Commit e2e9036

Browse files
author
Marius Burkard
committed
- fixed letsencrypt inactivated by client accidently if checkbox is hidden
1 parent 525108a commit e2e9036

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

interface/lib/classes/tform_actions.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function onUpdate() {
110110
$app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'].':'.'on_before_update', $this);
111111

112112
$ext_where = '';
113+
// pre-fill dataRecord array with elements from database to avoid overwriting fields set by admin but hidden for client
113114
$tmp_old_record = $app->tform->getDataRecord($this->id);
114115
if($tmp_old_record && is_array($tmp_old_record)) $this->dataRecord = array_merge($tmp_old_record, $this->dataRecord);
115116
$sql = $app->tform->getSQL($this->dataRecord, $app->tform->getCurrentTab(), 'UPDATE', $this->id, $ext_where);

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ function onSubmit() {
11271127
// When the record is updated
11281128
if($this->id > 0) {
11291129
// restore the server ID if the user is not admin and record is edited
1130-
$tmp = $app->db->queryOneRecord("SELECT server_id, `system_user`, `system_group`, `web_folder`, `cgi`, `ssi`, `perl`, `ruby`, `python`, `suexec`, `errordocs`, `subdomain`, `ssl` FROM web_domain WHERE domain_id = ?", $this->id);
1130+
$tmp = $app->db->queryOneRecord("SELECT server_id, `system_user`, `system_group`, `web_folder`, `cgi`, `ssi`, `perl`, `ruby`, `python`, `suexec`, `errordocs`, `subdomain`, `ssl`, `ssl_letsencrypt`, `directive_snippets_id` FROM web_domain WHERE domain_id = ?", $this->id);
11311131
$this->dataRecord["server_id"] = $tmp["server_id"];
11321132
if($this->_vhostdomain_type != 'domain') $this->dataRecord['web_folder'] = $tmp['web_folder']; // cannot be changed!
11331133
$this->dataRecord['system_user'] = $tmp['system_user'];
@@ -1143,7 +1143,9 @@ function onSubmit() {
11431143
if($this->dataRecord['errordocs'] == 'n') $this->dataRecord['errordocs'] = $tmp['errordocs'];
11441144
if($this->dataRecord['subdomain'] == 'n') $this->dataRecord['subdomain'] = $tmp['subdomain'];
11451145
if($this->dataRecord['ssl'] == 'n') $this->dataRecord['ssl'] = $tmp['ssl'];
1146-
1146+
if($this->dataRecord['ssl_letsencrypt'] == 'n') $this->dataRecord['ssl_letsencrypt'] = $tmp['ssl_letsencrypt'];
1147+
if($this->dataRecord['directive_snippets_id'] == 0) $this->dataRecord['directive_snippets_id'] = $tmp['directive_snippets_id'];
1148+
11471149
unset($tmp);
11481150
// When the record is inserted
11491151
} else {

0 commit comments

Comments
 (0)