Skip to content

Commit

Permalink
MDL-12886 fixed rest test cleint hard coded strings
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Oct 13, 2009
1 parent 95cf694 commit cad36f4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions webservice/rest/testclient/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,23 @@
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();
Expand Down

0 comments on commit cad36f4

Please sign in to comment.