Skip to content
Snippets Groups Projects
Commit 81d79a79 authored by Falko Timme's avatar Falko Timme
Browse files

- WebDAV Users: show only domains that run on Apache (because nginx does not...

- WebDAV Users: show only domains that run on Apache (because nginx does not have full WebDAV support).
parent f3b669eb
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,31 @@ class custom_datasource {
return $records_new;
}
function webdav_domains($field, $record) {
global $app, $conf;
$servers = $app->db->queryAllRecords("SELECT * FROM server WHERE active = 1 AND mirror_server_id = 0");
$server_ids = array();
$app->uses('getconf');
if(is_array($servers) && !empty($servers)){
foreach($servers as $server){
$web_config = $app->getconf->get_server_config($server['server_id'], 'web');
if($web_config['server_type'] != 'nginx') $server_ids[] = $server['server_id'];
}
}
$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_new = array();
if(is_array($records)) {
foreach($records as $rec) {
$key = $rec['domain_id'];
$records_new[$key] = $rec['domain'];
}
}
return $records_new;
}
function client_servers($field, $record) {
global $app, $conf;
......
......@@ -73,10 +73,9 @@ $form["tabs"]['webdav'] = array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'webdav_domains'
),
'value' => ''
),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment