webservice MDL-21466 add few comments about test client

This commit is contained in:
jerome mouneyrac 2010-01-29 03:50:06 +00:00
parent 5f27814116
commit f54dfa54b7
3 changed files with 23 additions and 2 deletions

View File

@ -87,6 +87,10 @@ if (!$function or !$protocol) {
$mform = new webservice_test_client_form(null, array($functions, $protocols));
admin_externalpage_print_header();
echo $OUTPUT->heading(get_string('testclient', 'webservice'));
echo $OUTPUT->box_start();
echo get_string('testclientdescription', 'webservice');
echo $OUTPUT->box_end();
$mform->display();
echo $OUTPUT->footer();
die;

View File

@ -106,6 +106,10 @@ $string['serviceusers'] = 'Authorised users';
$string['serviceusersmatching'] = 'Authorised users matching';
$string['serviceuserssettings'] = 'Change settings for the authorised users';
$string['testclient'] = 'Web service test client';
$string['testclientdescription'] = 'The web service test client <strong>executes</strong> the functions for <strong>REAL</strong>. Do not test functions that you don\'t know.<br/>Notice: all existing web service functions are not yet implemented into the test client. Also note that in order to check that a user cannot access some functions, you can test some functions that you didn\'t allow.';
$string['testwithtestclient'] = 'Test the service';
$string['testauserwithtestclientdescription'] = 'Simulate external access to the service using the web service test client. Before going there, log on as a user set with the "moodle/webservice:createtoken" capability, and get his security key (token) from his "my moodle" block. You will use this token in the test client. In the test client, also choose an enabled protocol with the token authentication. <strong>Warning: the functions that you test WILL BE EXECUTED for this user, be carefull what you choose to test!!!</strong>';
$string['testwithtestclientdescription'] = 'Simulate external access to the service using the web service test client. Use an enabled protocol with token authentication. <strong>Warning: the functions that you test WILL BE EXECUTED, be carefull what you choose to test!!!</strong>';
$string['token'] = 'Token';
$string['tokenauthlog'] = 'Token authentication';
$string['validuntil'] = 'Valid until';

View File

@ -6420,6 +6420,14 @@ class admin_setting_webservicesoverview extends admin_setting {
$row[1] = $status;
$row[2] = get_string('enabledocumentationdescription', 'webservice');
$table->data[] = $row;
/// 10. Test the service
$row = array();
$url = new moodle_url("/admin/webservice/testclient.php");
$row[0] = "10. "."<a href=".$url.">".get_string('testwithtestclient', 'webservice')."</a>";
$row[1] = "";
$row[2] = get_string('testwithtestclientdescription', 'webservice');
$table->data[] = $row;
$return .= $OUTPUT->table($table);
@ -6489,8 +6497,13 @@ class admin_setting_webservicesoverview extends admin_setting {
$row[2] = get_string('addcapabilitytousersdescription', 'webservice');
$table->data[] = $row;
/// 6. Test the service
$row = array();
$url = new moodle_url("/admin/webservice/testclient.php");
$row[0] = "6. "."<a href=".$url.">".get_string('testwithtestclient', 'webservice')."</a>";
$row[1] = "";
$row[2] = get_string('testauserwithtestclientdescription', 'webservice');
$table->data[] = $row;
$return .= $OUTPUT->table($table);