Commit 1fef4a59 authored by Falko Timme's avatar Falko Timme
Browse files

- Fixed FS#3203 - Choice of "Default Secondary DNS Server" broken.

parent 2c0812a6
......@@ -63,6 +63,28 @@ class custom_datasource {
return $records_new;
}
function slave_dns_servers($field, $record) {
global $app, $conf;
if($_SESSION["s"]["user"]["typ"] == 'user') {
// Get the limits of the client
$client_group_id = $_SESSION["s"]["user"]["default_group"];
$client = $app->db->queryOneRecord("SELECT default_slave_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
$sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$client['default_slave_dnsserver'];
} else {
$sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name";
}
$records = $app->db->queryAllRecords($sql);
$records_new = array();
if(is_array($records)) {
foreach($records as $rec) {
$key = $rec['server_id'];
$records_new[$key] = $rec['server_name'];
}
}
return $records_new;
}
function webdav_domains($field, $record) {
global $app, $conf;
......
......@@ -64,9 +64,9 @@ $liste["item"][] = array( 'field' => "server_id",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'datasource'=> array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'dns_servers'
'datasource'=> array ( 'type' => 'CUSTOM',
'class' => 'custom_datasource',
'function' => 'slave_dns_servers'
),
'width' => "",
'value' => "");
......
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