From ffc16361f13c51fd7f43b8f7d1a82524d144489f Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Thu, 25 Jun 2015 23:27:34 -0400 Subject: [PATCH] Added pass-through support for am_set_host_info.php RPC (DBOINCP-184) --- .../boinc/modules/boinccore/boinccore.module | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drupal/sites/default/boinc/modules/boinccore/boinccore.module b/drupal/sites/default/boinc/modules/boinccore/boinccore.module index f5aa1f69ec..4c65048c38 100644 --- a/drupal/sites/default/boinc/modules/boinccore/boinccore.module +++ b/drupal/sites/default/boinc/modules/boinccore/boinccore.module @@ -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