MDL-28574 webservices: Explain tokens you can edit but can't see

This commit is contained in:
John Okely 2017-07-31 15:31:35 +08:00
parent 11df55c0dd
commit 72e688d7ff
3 changed files with 6 additions and 1 deletions

View File

@ -131,6 +131,7 @@ $string['norequiredcapability'] = 'No required capability';
$string['notoken'] = 'The token list is empty.';
$string['onesystemcontrolling'] = 'Allow an external system to control Moodle';
$string['onesystemcontrollingdescription'] = 'The following steps help you to set up the Moodle web services to allow an external system to interact with Moodle. This includes setting up a token (security key) authentication method.';
$string['onlyseecreatedtokens'] = 'Only tokens you own or created can be seen. You can still delete other tokens.';
$string['operation'] = 'Operation';
$string['optional'] = 'Optional';
$string['passwordisexpired'] = 'Password is expired.';

View File

@ -9531,6 +9531,10 @@ class admin_setting_managewebservicetokens extends admin_setting {
$return = $OUTPUT->box_start('generalbox webservicestokenui');
if (has_capability('moodle/webservice:managealltokens', context_system::instance())) {
$return .= \html_writer::div(get_string('onlyseecreatedtokens', 'webservice'));
}
$table = new \webservice\token_table('webservicetokens');
$table->define_baseurl($baseurl);
$table->attributes['class'] = 'admintable generaltable'; // Any need changing?

View File

@ -159,7 +159,7 @@ class token_table extends \table_sql {
global $USER;
// Hide the token if it wasn't created by the current user.
if ($data->creatorid != $USER->id) {
return '';
return '-';
}
return $data->token;