Commit 57963434 authored by Marius Cramer's avatar Marius Cramer

Merge branch 'master' into 'master'

hide mirror-server from several lists / forms

See merge request !224
parents e10d34ab aff9acb4
......@@ -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);
$sql = "SELECT server_id,server_name FROM server WHERE server_id = ?";
} 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_new = array();
......@@ -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);
$sql = "SELECT server_id,server_name FROM server WHERE server_id = ?";
} 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_new = array();
......@@ -99,7 +99,7 @@ class custom_datasource {
}
if(count($server_ids) == 0) return array();
$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();
if(is_array($records)) {
......@@ -168,12 +168,12 @@ class custom_datasource {
} else {
//* 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);
$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);
}
} else {
//* 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);
}
......
......@@ -63,7 +63,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -51,7 +51,7 @@ $liste['item'][] = array( 'field' => 'server_id',
'prefix' => '',
'suffix' => '',
'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',
'valuefield'=> 'server_name'
),
......
......@@ -27,7 +27,7 @@ $liste['item'][] = array( 'field' => 'server_id',
'prefix' => '',
'suffix' => '',
'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',
'valuefield'=> 'server_name'
),
......
......@@ -51,7 +51,7 @@ $liste['item'][] = array( 'field' => 'server_id',
'prefix' => '',
'suffix' => '',
'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',
'valuefield'=> 'server_name'
),
......
......@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -66,7 +66,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -64,7 +64,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -101,13 +101,13 @@ if($_SESSION['s']['user']['typ'] == 'admin') {
}
$liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR",
'datatype' => "INTEGER",
'formtype' => "SELECT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -59,13 +59,13 @@ $liste["item"][] = array( 'field' => "active",
$liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR",
'datatype' => "INTEGER",
'formtype' => "SELECT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -59,13 +59,13 @@ $liste["item"][] = array( 'field' => "active",
$liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR",
'datatype' => "INTEGER",
'formtype' => "SELECT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -65,7 +65,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "%",
'suffix' => "%",
'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',
'valuefield'=> 'server_name'
),
......
......@@ -54,7 +54,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "",
'suffix' => "",
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 ORDER BY server_name',
'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
......
......@@ -82,7 +82,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "",
'suffix' => "",
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 ORDER BY server_name',
'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
......
......@@ -72,7 +72,7 @@ $liste["item"][] = array( 'field' => "server_id",
'prefix' => "",
'suffix' => "",
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 ORDER BY server_name',
'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
......
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