Commit 15e77077 authored by tbrehm's avatar tbrehm
Browse files

Updates in DNS manager

parent f1418832
......@@ -49,10 +49,14 @@ class plugin_listview extends plugin_base {
$limit_sql = $app->listform->getPagingSQL($sql_where);
$listTpl->setVar("paging",$app->listform->pagingHTML);
$sql_order_by = '';
if(isset($this->options["sql_order_by"])) {
$sql_order_by = $this->options["sql_order_by"];
}
// Get the data
$records = $app->db->queryAllRecords("SELECT * FROM ".$app->listform->listDef["table"]." WHERE $sql_where $limit_sql");
$records = $app->db->queryAllRecords("SELECT * FROM ".$app->listform->listDef["table"]." WHERE $sql_where $sql_order_by $limit_sql");
$bgcolor = "#FFFFFF";
if(is_array($records)) {
......@@ -71,6 +75,8 @@ class plugin_listview extends plugin_base {
if($field['formtype'] == "SELECT") {
$rec[$key] = $field['value'][$rec[$key]];
}
// Create a lowercase version of every item
$rec[$key.'_lowercase'] = strtolower($rec[$key]);
}
// The variable "id" contains always the index field
......
......@@ -539,7 +539,11 @@ class tform {
$validator['regex'] .= 's';
if(!preg_match($validator['regex'], $field_value)) {
$errmsg = $validator['errmsg'];
$this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
} else {
$this->errorMessage .= $errmsg."<br>\r\n";
}
}
break;
case 'UNIQUE':
......
......@@ -285,7 +285,8 @@ class tform_actions {
$app->tform->datalogSave('DELETE',$this->id,$this->dataRecord,array());
}
$app->db->query("DELETE FROM ".$liste["table"]." WHERE ".$liste["table_idx"]." = ".$this->id." LIMIT 0,1");
$app->db->query("DELETE FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id." LIMIT 1");
// loading plugins
$next_tab = $app->tform->getCurrentTab();
......
......@@ -51,7 +51,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['dns'] = array (
'title' => "DNS A",
'title' => "DNS ALIAS",
'width' => 100,
'template' => "templates/dns_alias_edit.htm",
'fields' => array (
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'ALIAS',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -102,7 +102,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'regex' => '/^[\w\.\-]{1,64}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
......
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'CNAME',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -102,7 +102,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'regex' => '/^[\w\.\-]{1,64}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
......
......@@ -51,7 +51,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['dns'] = array (
'title' => "DNS hinfo",
'title' => "DNS HINFO",
'width' => 100,
'template' => "templates/dns_hinfo_edit.htm",
'fields' => array (
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'HINFO',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -101,9 +101,6 @@ $form["tabs"]['dns'] = array (
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
'value' => '',
......
......@@ -80,7 +80,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'name_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{1,64}$/',
'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'MX',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -102,7 +102,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
......@@ -110,16 +110,16 @@ $form["tabs"]['dns'] = array (
'width' => '30',
'maxlength' => '255'
),
/*
'aux' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'default' => '0',
'default' => '10',
'value' => '',
'width' => '10',
'maxlength' => '10'
),
*/
'ttl' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......
......@@ -51,7 +51,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['dns'] = array (
'title' => "DNS ns",
'title' => "DNS NS",
'width' => 100,
'template' => "templates/dns_ns_edit.htm",
'fields' => array (
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'NS',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -102,7 +102,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'regex' => '/^[\w\.\-]{1,64}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
......
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'PTR',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -102,7 +102,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'regex' => '/^[\w\.\-]{1,64}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
......
......@@ -51,7 +51,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['dns'] = array (
'title' => "DNS rp",
'title' => "DNS RP",
'width' => 100,
'template' => "templates/dns_rp_edit.htm",
'fields' => array (
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'RP',
'value' => '',
'width' => '5',
'maxlength' => '5'
......
......@@ -201,7 +201,8 @@ $form["tabs"]['dns_records'] = array (
'class' => 'plugin_listview',
'options' => array(
'listdef' => 'list/dns_a.list.php',
'sqlextwhere' => "zone = ".intval($_REQUEST['id'])
'sqlextwhere' => "zone = ".intval($_REQUEST['id']),
'sql_order_by' => "ORDER BY type, name"
)
)
)
......
......@@ -33,7 +33,7 @@
*/
$form["title"] = "DNS srv";
$form["title"] = "DNS SRV";
$form["description"] = "";
$form["name"] = "dns_srv";
$form["action"] = "dns_srv_edit.php";
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'SRV',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -101,9 +101,6 @@ $form["tabs"]['dns'] = array (
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
'value' => '',
......
......@@ -51,7 +51,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['dns'] = array (
'title' => "DNS txt",
'title' => "DNS TXT",
'width' => 100,
'template' => "templates/dns_txt_edit.htm",
'fields' => array (
......@@ -91,7 +91,7 @@ $form["tabs"]['dns'] = array (
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'default' => 'TXT',
'value' => '',
'width' => '5',
'maxlength' => '5'
......@@ -101,9 +101,6 @@ $form["tabs"]['dns'] = array (
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{10,15}$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
'value' => '',
......
......@@ -3,7 +3,7 @@ $wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IP-Address';
$wb["data_txt"] = 'Target Hostname';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
......
......@@ -3,7 +3,7 @@ $wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IP-Address';
$wb["data_txt"] = 'Target Hostname';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
......
......@@ -3,7 +3,7 @@ $wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IP-Address';
$wb["data_txt"] = 'Host Information';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
......
......@@ -3,7 +3,8 @@ $wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IP-Address';
$wb["data_txt"] = 'Mailserver hostname';
$wb["aux_txt"] = 'Priority';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
......
<?php
$wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["name_txt"] = 'Zone';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IP-Address';
$wb["data_txt"] = 'Nameserver Hostname';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
......
<?php
$wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["name_txt"] = 'Name';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IP-Address';
$wb["data_txt"] = 'Canonical Hostname';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
......
......@@ -3,7 +3,7 @@ $wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IP-Address';
$wb["data_txt"] = 'Responsible Person';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment