Skip to content

Commit 15e7707

Browse files
committed
Updates in DNS manager
1 parent f141883 commit 15e7707

34 files changed

+93
-83
lines changed

interface/lib/classes/plugin_listview.inc.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ function onShow() {
4949
$limit_sql = $app->listform->getPagingSQL($sql_where);
5050
$listTpl->setVar("paging",$app->listform->pagingHTML);
5151

52+
$sql_order_by = '';
53+
if(isset($this->options["sql_order_by"])) {
54+
$sql_order_by = $this->options["sql_order_by"];
55+
}
5256

5357

5458
// Get the data
55-
$records = $app->db->queryAllRecords("SELECT * FROM ".$app->listform->listDef["table"]." WHERE $sql_where $limit_sql");
59+
$records = $app->db->queryAllRecords("SELECT * FROM ".$app->listform->listDef["table"]." WHERE $sql_where $sql_order_by $limit_sql");
5660

5761
$bgcolor = "#FFFFFF";
5862
if(is_array($records)) {
@@ -71,6 +75,8 @@ function onShow() {
7175
if($field['formtype'] == "SELECT") {
7276
$rec[$key] = $field['value'][$rec[$key]];
7377
}
78+
// Create a lowercase version of every item
79+
$rec[$key.'_lowercase'] = strtolower($rec[$key]);
7480
}
7581

7682
// The variable "id" contains always the index field

interface/lib/classes/tform.inc.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,11 @@ function validateField($field_name, $field_value, $validators) {
539539
$validator['regex'] .= 's';
540540
if(!preg_match($validator['regex'], $field_value)) {
541541
$errmsg = $validator['errmsg'];
542-
$this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
542+
if(isset($this->wordbook[$errmsg])) {
543+
$this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
544+
} else {
545+
$this->errorMessage .= $errmsg."<br>\r\n";
546+
}
543547
}
544548
break;
545549
case 'UNIQUE':

interface/lib/classes/tform_actions.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ function onDelete() {
285285
$app->tform->datalogSave('DELETE',$this->id,$this->dataRecord,array());
286286
}
287287

288-
$app->db->query("DELETE FROM ".$liste["table"]." WHERE ".$liste["table_idx"]." = ".$this->id." LIMIT 0,1");
288+
$app->db->query("DELETE FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id." LIMIT 1");
289+
289290

290291
// loading plugins
291292
$next_tab = $app->tform->getCurrentTab();

interface/web/dns/form/dns_alias.tform.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
5252

5353
$form["tabs"]['dns'] = array (
54-
'title' => "DNS A",
54+
'title' => "DNS ALIAS",
5555
'width' => 100,
5656
'template' => "templates/dns_alias_edit.htm",
5757
'fields' => array (
@@ -91,7 +91,7 @@
9191
'type' => array (
9292
'datatype' => 'VARCHAR',
9393
'formtype' => 'TEXT',
94-
'default' => 'A',
94+
'default' => 'ALIAS',
9595
'value' => '',
9696
'width' => '5',
9797
'maxlength' => '5'
@@ -102,7 +102,7 @@
102102
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
103103
'errmsg'=> 'data_error_empty'),
104104
1 => array ( 'type' => 'REGEX',
105-
'regex' => '/^[0-9\.]{10,15}$/',
105+
'regex' => '/^[\w\.\-]{1,64}$/',
106106
'errmsg'=> 'data_error_regex'),
107107
),
108108
'default' => '',

interface/web/dns/form/dns_cname.tform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
'type' => array (
9292
'datatype' => 'VARCHAR',
9393
'formtype' => 'TEXT',
94-
'default' => 'A',
94+
'default' => 'CNAME',
9595
'value' => '',
9696
'width' => '5',
9797
'maxlength' => '5'
@@ -102,7 +102,7 @@
102102
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
103103
'errmsg'=> 'data_error_empty'),
104104
1 => array ( 'type' => 'REGEX',
105-
'regex' => '/^[0-9\.]{10,15}$/',
105+
'regex' => '/^[\w\.\-]{1,64}$/',
106106
'errmsg'=> 'data_error_regex'),
107107
),
108108
'default' => '',

interface/web/dns/form/dns_hinfo.tform.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
5252

5353
$form["tabs"]['dns'] = array (
54-
'title' => "DNS hinfo",
54+
'title' => "DNS HINFO",
5555
'width' => 100,
5656
'template' => "templates/dns_hinfo_edit.htm",
5757
'fields' => array (
@@ -91,7 +91,7 @@
9191
'type' => array (
9292
'datatype' => 'VARCHAR',
9393
'formtype' => 'TEXT',
94-
'default' => 'A',
94+
'default' => 'HINFO',
9595
'value' => '',
9696
'width' => '5',
9797
'maxlength' => '5'
@@ -101,9 +101,6 @@
101101
'formtype' => 'TEXT',
102102
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
103103
'errmsg'=> 'data_error_empty'),
104-
1 => array ( 'type' => 'REGEX',
105-
'regex' => '/^[0-9\.]{10,15}$/',
106-
'errmsg'=> 'data_error_regex'),
107104
),
108105
'default' => '',
109106
'value' => '',

interface/web/dns/form/dns_mx.tform.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
8181
'errmsg'=> 'name_error_empty'),
8282
1 => array ( 'type' => 'REGEX',
83-
'regex' => '/^[\w\.\-]{1,64}$/',
83+
'regex' => '/^[\w\.\-]{1,255}$/',
8484
'errmsg'=> 'name_error_regex'),
8585
),
8686
'default' => '',
@@ -91,7 +91,7 @@
9191
'type' => array (
9292
'datatype' => 'VARCHAR',
9393
'formtype' => 'TEXT',
94-
'default' => 'A',
94+
'default' => 'MX',
9595
'value' => '',
9696
'width' => '5',
9797
'maxlength' => '5'
@@ -102,24 +102,24 @@
102102
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
103103
'errmsg'=> 'data_error_empty'),
104104
1 => array ( 'type' => 'REGEX',
105-
'regex' => '/^[0-9\.]{10,15}$/',
105+
'regex' => '/^[\w\.\-]{1,255}$/',
106106
'errmsg'=> 'data_error_regex'),
107107
),
108108
'default' => '',
109109
'value' => '',
110110
'width' => '30',
111111
'maxlength' => '255'
112112
),
113-
/*
113+
114114
'aux' => array (
115115
'datatype' => 'INTEGER',
116116
'formtype' => 'TEXT',
117-
'default' => '0',
117+
'default' => '10',
118118
'value' => '',
119119
'width' => '10',
120120
'maxlength' => '10'
121121
),
122-
*/
122+
123123
'ttl' => array (
124124
'datatype' => 'INTEGER',
125125
'formtype' => 'TEXT',

interface/web/dns/form/dns_ns.tform.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
5252

5353
$form["tabs"]['dns'] = array (
54-
'title' => "DNS ns",
54+
'title' => "DNS NS",
5555
'width' => 100,
5656
'template' => "templates/dns_ns_edit.htm",
5757
'fields' => array (
@@ -91,7 +91,7 @@
9191
'type' => array (
9292
'datatype' => 'VARCHAR',
9393
'formtype' => 'TEXT',
94-
'default' => 'A',
94+
'default' => 'NS',
9595
'value' => '',
9696
'width' => '5',
9797
'maxlength' => '5'
@@ -102,7 +102,7 @@
102102
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
103103
'errmsg'=> 'data_error_empty'),
104104
1 => array ( 'type' => 'REGEX',
105-
'regex' => '/^[0-9\.]{10,15}$/',
105+
'regex' => '/^[\w\.\-]{1,64}$/',
106106
'errmsg'=> 'data_error_regex'),
107107
),
108108
'default' => '',

interface/web/dns/form/dns_ptr.tform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
'type' => array (
9292
'datatype' => 'VARCHAR',
9393
'formtype' => 'TEXT',
94-
'default' => 'A',
94+
'default' => 'PTR',
9595
'value' => '',
9696
'width' => '5',
9797
'maxlength' => '5'
@@ -102,7 +102,7 @@
102102
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
103103
'errmsg'=> 'data_error_empty'),
104104
1 => array ( 'type' => 'REGEX',
105-
'regex' => '/^[0-9\.]{10,15}$/',
105+
'regex' => '/^[\w\.\-]{1,64}$/',
106106
'errmsg'=> 'data_error_regex'),
107107
),
108108
'default' => '',

interface/web/dns/form/dns_rp.tform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
5252

5353
$form["tabs"]['dns'] = array (
54-
'title' => "DNS rp",
54+
'title' => "DNS RP",
5555
'width' => 100,
5656
'template' => "templates/dns_rp_edit.htm",
5757
'fields' => array (
@@ -91,7 +91,7 @@
9191
'type' => array (
9292
'datatype' => 'VARCHAR',
9393
'formtype' => 'TEXT',
94-
'default' => 'A',
94+
'default' => 'RP',
9595
'value' => '',
9696
'width' => '5',
9797
'maxlength' => '5'

0 commit comments

Comments
 (0)