MDL-12886 fixed rest test cleint hard coded strings

This commit is contained in:
skodak 2009-10-13 22:01:43 +00:00
parent 95cf694abe
commit cad36f4e50

View File

@ -59,15 +59,23 @@ if ($mform->is_cancelled()) {
redirect('index.php');
} else if ($data = $mform->get_data()) {
unset($data->submitbutton);
$serverurl = "$CFG->wwwroot/webservice/rest/simpleserver.php";
$serverurl .= '?wsusername='.urlencode($data->wsusername);
unset($data->wsusername);
$serverurl .= '&wspassword='.urlencode($data->wspassword);
unset($data->wspassword);
$serverurl .= '&wsfunction='.urlencode($data->function);
for ($i=0; $i<10; $i++) {
if (empty($data->groupids[$i])) {
continue;
unset($data->function);
if ($function === 'moodle_group_get_groups') {
//note: this could be placed into separate function lib file in the same dir
for ($i=0; $i<10; $i++) {
if (empty($data->groupids[$i])) {
continue;
}
$serverurl .= "&groupids[$i]=".urlencode($data->groupids[$i]);
}
$serverurl .= "&groupids[$i]=".urlencode($data->groupids[$i]);
}
echo $OUTPUT->header();