Commit aff9acb4 authored by Florian Schaal's avatar Florian Schaal
Browse files

hide mirror-server from several lists / forms

parent ae9ca85a
...@@ -50,7 +50,7 @@ class custom_datasource { ...@@ -50,7 +50,7 @@ class custom_datasource {
$client = $app->db->queryOneRecord("SELECT default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); $client = $app->db->queryOneRecord("SELECT default_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 = ?"; $sql = "SELECT server_id,server_name FROM server WHERE server_id = ?";
} else { } else {
$sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name"; $sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name AND mirror_server_id = 0";
} }
$records = $app->db->queryAllRecords($sql, $client['default_dnsserver']); $records = $app->db->queryAllRecords($sql, $client['default_dnsserver']);
$records_new = array(); $records_new = array();
...@@ -72,7 +72,7 @@ class custom_datasource { ...@@ -72,7 +72,7 @@ class custom_datasource {
$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); $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 = ?"; $sql = "SELECT server_id,server_name FROM server WHERE server_id = ?";
} else { } else {
$sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name"; $sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name AND mirror_server_id = 0";
} }
$records = $app->db->queryAllRecords($sql, $client['default_slave_dnsserver']); $records = $app->db->queryAllRecords($sql, $client['default_slave_dnsserver']);
$records_new = array(); $records_new = array();
...@@ -99,7 +99,7 @@ class custom_datasource { ...@@ -99,7 +99,7 @@ class custom_datasource {
} }
if(count($server_ids) == 0) return array(); if(count($server_ids) == 0) return array();
$server_ids = implode(',', $server_ids); $server_ids = implode(',', $server_ids);
$records = $app->db->queryAllRecords("SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id IN ? AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain", $server_ids); $records = $app->db->queryAllRecords("SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id IN (?) AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain", $server_ids);
$records_new = array(); $records_new = array();
if(is_array($records)) { if(is_array($records)) {
...@@ -168,12 +168,12 @@ class custom_datasource { ...@@ -168,12 +168,12 @@ class custom_datasource {
} else { } else {
//* Not able to find the clients defaults, use this as fallback and add a warning message to the log //* Not able to find the clients defaults, use this as fallback and add a warning message to the log
$app->log('Unable to find default server for client in custom_datasource.inc.php', 1); $app->log('Unable to find default server for client in custom_datasource.inc.php', 1);
$sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 ORDER BY server_name"; $sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 AND mirror_server_id = 0 ORDER BY server_name";
$records = $app->db->queryAllRecords($sql, $field); $records = $app->db->queryAllRecords($sql, $field);
} }
} else { } else {
//* The logged in user is admin, so we show him all available servers of a specific type. //* The logged in user is admin, so we show him all available servers of a specific type.
$sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 ORDER BY server_name"; $sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 AND mirror_server_id = 0 ORDER BY server_name";
$records = $app->db->queryAllRecords($sql, $field); $records = $app->db->queryAllRecords($sql, $field);
} }
......
...@@ -63,7 +63,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -63,7 +63,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -51,7 +51,7 @@ $liste['item'][] = array( 'field' => 'server_id', ...@@ -51,7 +51,7 @@ $liste['item'][] = array( 'field' => 'server_id',
'prefix' => '', 'prefix' => '',
'suffix' => '', 'suffix' => '',
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -27,7 +27,7 @@ $liste['item'][] = array( 'field' => 'server_id', ...@@ -27,7 +27,7 @@ $liste['item'][] = array( 'field' => 'server_id',
'prefix' => '', 'prefix' => '',
'suffix' => '', 'suffix' => '',
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id <> 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -51,7 +51,7 @@ $liste['item'][] = array( 'field' => 'server_id', ...@@ -51,7 +51,7 @@ $liste['item'][] = array( 'field' => 'server_id',
'prefix' => '', 'prefix' => '',
'suffix' => '', 'suffix' => '',
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -66,7 +66,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -66,7 +66,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -101,13 +101,13 @@ if($_SESSION['s']['user']['typ'] == 'admin') { ...@@ -101,13 +101,13 @@ if($_SESSION['s']['user']['typ'] == 'admin') {
} }
$liste["item"][] = array( 'field' => "server_id", $liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR", 'datatype' => "INTEGER",
'formtype' => "SELECT", 'formtype' => "SELECT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND db_server = 1 ORDER BY server_name', 'querystring' => 'SELECT a.server_id, a.server_name FROM server a, web_database b WHERE (a.server_id = b.server_id) AND ({AUTHSQL-B}) ORDER BY a.server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -59,13 +59,13 @@ $liste["item"][] = array( 'field' => "active", ...@@ -59,13 +59,13 @@ $liste["item"][] = array( 'field' => "active",
$liste["item"][] = array( 'field' => "server_id", $liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR", 'datatype' => "INTEGER",
'formtype' => "SELECT", 'formtype' => "SELECT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT a.server_id, a.server_name FROM server a, ftp_user b WHERE (a.server_id = b.server_id) AND ({AUTHSQL-B}) ORDER BY a.server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id", ...@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
...@@ -59,13 +59,13 @@ $liste["item"][] = array( 'field' => "active", ...@@ -59,13 +59,13 @@ $liste["item"][] = array( 'field' => "active",
$liste["item"][] = array( 'field' => "server_id", $liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR", 'datatype' => "INTEGER",
'formtype' => "SELECT", 'formtype' => "SELECT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', 'querystring' => 'SELECT a.server_id, a.server_name FROM server a, web_domain b WHERE (a.server_id = b.server_id) AND ({AUTHSQL-B}) ORDER BY a.server_name',
'keyfield'=> 'server_id', 'keyfield'=> 'server_id',
'valuefield'=> 'server_name' 'valuefield'=> 'server_name'
), ),
......
Supports Markdown
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