Added pass-through support for am_set_host_info.php RPC

(DBOINCP-184)
This commit is contained in:
Tristan Olive 2015-06-25 23:27:34 -04:00
parent 6a6c3a0515
commit ffc16361f1
1 changed files with 25 additions and 0 deletions

View File

@ -85,6 +85,13 @@ function boinccore_menu() {
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['am_set_host_info.php'] = array(
'title' => 'Account manager set host info RPC',
'description' => 'RPC for updating the venue for a given host.',
'page callback' => 'boinccore_am_set_host_info',
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
return $items;
}
@ -530,6 +537,24 @@ function boinccore_am_set_info() {
print save_configuration($xml);
}
/**
* Page callback for the set host info RPC (am_set_host_info.php).
* Update the venue for the given host
*/
function boinccore_am_set_host_info() {
// Remove q from the GET request or BOINC will panic
unset($_GET['q']);
// Capture the XML output of the RPC so we can override things
ob_start();
include_boinc('user/am_set_host_info.php');
$xml = ob_get_clean();
$xml = load_configuration($xml);
if (isset($xml['am_set_host_info_reply']['success'])) {
// Override anything that needs overriding
}
print save_configuration($xml);
}
/**
* Controller for handling direct linking to paginated content.
* Because pagination settings are user configurable, it is impossible to know