Skip to content

Commit dee987b

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
Master See merge request !140
2 parents 9ca1e3b + d48a08c commit dee987b

File tree

86 files changed

+3066
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3066
-363
lines changed

interface/web/admin/form/server_config.tform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@
320320
'dkim_strength' => array(
321321
'datatype' => 'INTEGER',
322322
'formtype' => 'SELECT',
323-
'default' => '1024',
324-
'value' => array('1024' => 'normal (1024)', '2048' => 'strong (2048)', '4096' => 'very strong (4096)')
323+
'default' => '2048',
324+
'value' => array('1024' => 'week (1024)', '2048' => 'normal (2048)', '4096' => 'strong (4096)')
325325
),
326326
'relayhost_password' => array(
327327
'datatype' => 'VARCHAR',

interface/web/dns/dns_dkim_edit.php

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,20 @@ function onShowNew() {
7070
}
7171

7272
parent::onShowNew();
73+
74+
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?'", $_GET['zone'], $app->tform->getAuthSQL('r'));
75+
$sql=$app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ?", substr_replace($soa['origin'],'',-1), $app->tform->getAuthSQL('r'));
76+
$public_key=str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"),'',$sql['dkim_public']);
77+
$app->tpl->setVar('public_key', $public_key);
78+
$app->tpl->setVar('selector', $sql['dkim_selector']);
79+
$app->tpl->setVar('name', $soa['origin']);
80+
7381
}
7482

7583
function onSubmit() {
7684
global $app, $conf;
7785
// Get the parent soa record of the domain
78-
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->intval($_POST["zone"]));
86+
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?", $_POST["zone"], $app->tform->getAuthSQL('r'));
7987
// Check if Domain belongs to user
8088
if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
8189

@@ -101,24 +109,23 @@ function onSubmit() {
101109
$this->dataRecord['data']='v=DKIM1; t=s; p='.$this->dataRecord['data'];
102110
$this->dataRecord['name']=$this->dataRecord['selector'].'._domainkey.'.$this->dataRecord['name'];
103111
}
104-
// Update the serial number and timestamp of the RR record
105-
$soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ?", $this->id);
106-
$this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
107-
$this->dataRecord["stamp"] = date('Y-m-d H:i:s');
108-
109-
// check for duplicate entry
110-
$check=$app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND type = ? AND data = ? AND name = ?", $this->dataRecord['zone'], $this->dataRecord['type'], $this->dataRecord['data'], $this->dataRecord['name']);
111-
if ($check!='') $app->tform->errorMessage .= $app->tform->wordbook["record_exists_txt"];
112-
if (empty($this->dataRecord['data'])) $app->tform->errorMessage .= $app->tform->wordbook["dkim_disabled_txt"];
113-
112+
// Update the serial number and timestamp of the RR record
113+
$soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ?", $this->id);
114+
$this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
115+
$this->dataRecord["stamp"] = date('Y-m-d H:i:s');
116+
117+
// check for duplicate entry
118+
$check=$app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND type = ? AND data = ? AND name = ?", $this->dataRecord["zone"], $this->dataRecord["type"], $this->dataRecord["data"], $this->dataRecord['name']);
119+
if ($check!='') $app->tform->errorMessage .= $app->tform->wordbook["record_exists_txt"];
120+
if (empty($this->dataRecord['data'])) $app->tform->errorMessage .= $app->tform->wordbook["dkim_disabled_txt"];
114121
parent::onSubmit();
115122
}
116123

117124
function onAfterInsert() {
118125
global $app, $conf;
119126

120127
//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
121-
$soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord['zone']));
128+
$soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND ?", $this->dataRecord["zone"], $app->tform->getAuthSQL('r'));
122129
$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
123130

124131
//* Update the serial number of the SOA record
@@ -131,7 +138,7 @@ function onAfterUpdate() {
131138
global $app, $conf;
132139

133140
//* Update the serial number of the SOA record
134-
$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"]));
141+
$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND ?", $this->dataRecord["zone"], $app->tform->getAuthSQL('r'));
135142
$soa_id = $app->functions->intval($_POST["zone"]);
136143
$serial = $app->validate_dns->increase_serial($soa["serial"]);
137144
$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);

interface/web/dns/dns_dkim_get.php

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)