From fc995ea829c05a1ad0e9564ee65ca4fb0ea57e35 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 20 Jun 2016 09:32:26 -0700 Subject: [PATCH] result_status web RPC: accept names as well as IDs --- doc/projects.inc | 2 +- html/user/result_status.php | 34 +++++++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/doc/projects.inc b/doc/projects.inc index 07daa542c9..89c7926ffc 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -20,7 +20,7 @@ $sensing = array( array( array( "Quake Catcher Network", - "http://qcn.caltech.edu/sensor", + "http://quakecatcher.net", tra("Caltech"), tra("Seismology"), tra("Quake-Catcher Network uses sensors attached to computers and smartphones to detect seismic waves."), diff --git a/html/user/result_status.php b/html/user/result_status.php index 4077b7df97..1384a7b119 100644 --- a/html/user/result_status.php +++ b/html/user/result_status.php @@ -17,13 +17,14 @@ // along with BOINC. If not, see . // RPC handler for getting the status of one or more results +// args: +// ids=id1,id2... +// or +// names = name1,name2,... require_once("../inc/util.inc"); require_once("../inc/xml.inc"); -$ids = get_str("ids"); -$ids = explode(",", $ids); - function result_xml($r) { echo " @@ -58,12 +59,27 @@ function result_xml($r) { xml_header(); echo "\n"; -foreach ($ids as $id) { - $result = BoincResult::lookup_id($id); - if ($result) { - result_xml($result); - } else { - echo "ID $id unknown\n"; +$ids = get_str("ids", true); +if ($ids) { + $ids = explode(",", $ids); + foreach ($ids as $id) { + $result = BoincResult::lookup_id($id); + if ($result) { + result_xml($result); + } else { + echo "ID $id unknown\n"; + } + } +} else { + $names = get_str("names", true); + $names = explode(",", $names); + foreach ($names as $name) { + $result = BoincResult::lookup_name($name); + if ($result) { + result_xml($result); + } else { + echo "name $name unknown\n"; + } } } echo "\n";