Commit d5473bea authored by Falko Timme's avatar Falko Timme
Browse files

- Display server name in all web domains select fields so that you know which...

- Display server name in all web domains select fields so that you know which domain from which server you select.
parent acdd7a74
......@@ -77,13 +77,13 @@ class custom_datasource {
}
if(count($server_ids) == 0) return array();
$server_ids = implode(',', $server_ids);
$records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND server_id IN (".$server_ids.") AND ".$app->tform->getAuthSQL('r')." ORDER BY domain");
$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 (".$server_ids.") AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain");
$records_new = array();
if(is_array($records)) {
foreach($records as $rec) {
$key = $rec['domain_id'];
$records_new[$key] = $rec['domain'];
$records_new[$key] = $rec['parent_domain'];
}
}
return $records_new;
......
......@@ -251,6 +251,7 @@ class tform {
unset($tmp_recordid);
$querystring = str_replace("{AUTHSQL}",$this->getAuthSQL('r'),$querystring);
$querystring = preg_replace_callback('@{AUTHSQL::(.+?)}@', "self::table_auth_sql", $querystring);
// Getting the records
$tmp_records = $app->db->queryAllRecords($querystring);
......@@ -292,6 +293,10 @@ class tform {
}
function table_auth_sql($matches){
return $this->getAuthSQL('r', $matches[1]);
}
//* If the parameter 'valuelimit' is set
function applyValueLimit($limit,$values) {
......
......@@ -79,9 +79,9 @@ $form["tabs"]['cron'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "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 = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => ''
),
......
......@@ -79,9 +79,9 @@ $form["tabs"]['database'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "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 = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => array('0' => 'select_site_txt')
),
......
......@@ -79,9 +79,9 @@ $form["tabs"]['ftp'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "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 = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => ''
),
......
......@@ -79,9 +79,9 @@ $form["tabs"]['shell'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "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 = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => ''
),
......
......@@ -106,9 +106,9 @@ $form["tabs"]['domain'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "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 = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => ''
),
......
......@@ -74,9 +74,9 @@ $form["tabs"]['folder'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE (type = 'vhost' OR type = 'vhostsubdomain') AND {AUTHSQL} ORDER BY domain",
'querystring' => "SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE (web_domain.type = 'vhost' OR web_domain.type = 'vhostsubdomain') AND web_domain.server_id = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => ''
),
......
......@@ -50,8 +50,6 @@ $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$auth_sql = (isset($app->tform) ? $app->tform->getAuthSQL('r', 'web_domain') : '1');
$form["tabs"]['user'] = array (
'title' => "Folder",
'width' => 100,
......@@ -76,7 +74,7 @@ $form["tabs"]['user'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "Select concat(web_domain.domain,' ',web_folder.path) as name, web_folder.web_folder_id from web_domain, web_folder WHERE web_domain.domain_id = web_folder.parent_domain_id AND ".$auth_sql." ORDER BY web_domain.domain",
'querystring' => "Select concat(web_domain.domain,' ',web_folder.path, ' :: ', server.server_name) as name, web_folder.web_folder_id from web_domain, web_folder, server WHERE web_domain.domain_id = web_folder.parent_domain_id AND web_domain.server_id = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'web_folder_id',
'valuefield'=> 'name'
),
......
......@@ -106,9 +106,9 @@ $form["tabs"]['domain'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "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 = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => '',
'searchable' => 2
......
......@@ -140,9 +140,9 @@ $form["tabs"]['domain'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "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 = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'valuefield'=> 'parent_domain'
),
'value' => ''
),
......
......@@ -18,4 +18,5 @@ $wb['run_month_error_format'] = 'Das Format für Monate ist nicht korrekt.';
$wb['run_wday_error_format'] = 'Das Format für Wochentage ist nicht korrekt.';
$wb['command_error_format'] = 'Das Format für den Befehl ist nicht korrekt. Beachten Sie, dass bei einem URL Aufruf nur http und https erlaubt ist.';
$wb['unknown_fieldtype_error'] = 'Es wurde ein unbekanntes Feld verwendet.';
$wb['server_id_error_empty'] = 'Die Server-ID ist leer.';
?>
\ No newline at end of file
......@@ -18,4 +18,5 @@ $wb['run_month_error_format'] = 'Invalid format for months.';
$wb['run_wday_error_format'] = 'Invalid format for days of the week.';
$wb['command_error_format'] = 'Invalid command format. Please note that in case of an url call only http/https is allowed.';
$wb['unknown_fieldtype_error'] = 'An unknown field type has been used.';
$wb['server_id_error_empty'] = 'The server ID is empty.';
?>
\ No newline at end of file
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