function drd_server_server_domains in Drupal Remote Dashboard Server 6
Same name and namespace in other branches
- 6.2 drd_server.server.inc \drd_server_server_domains()
- 7.2 drd_server.server.inc \drd_server_server_domains()
- 7 drd_server.server.inc \drd_server_server_domains()
1 string reference to 'drd_server_server_domains'
- drd_server_xmlrpc in ./
drd_server.module - Implementation of hook_xmlrpc().
File
- ./
drd_server.server.inc, line 3
Code
function drd_server_server_domains($sid) {
$user = drd_server_load_user($sid);
if (is_string($user)) {
return drd_server_error($user);
}
$sites = array();
if (file_exists(DRUPAL_ROOT . '/sites/sites.php')) {
try {
include DRUPAL_ROOT . '/sites/sites.php';
} catch (Exception $e) {
//Ignore
}
}
else {
foreach (scandir(DRUPAL_ROOT . '/sites') as $file) {
if (is_dir(DRUPAL_ROOT . '/sites/' . $file) && !in_array($file, array(
'.',
'..',
'default',
'all',
))) {
$sites[$file] = $file;
}
}
}
$output = array();
foreach ($sites as $url => $id) {
if (isset($output[$id])) {
$output[$id]['aliases'][] = $url;
}
else {
if (drd_server_server_check_host($url, $id)) {
$output[$id] = array(
'url' => $url,
'aliases' => array(),
);
}
}
}
return drd_server_result('server.domains', $output);
}