Commit bcd8692f authored by David Mudrák's avatar David Mudrák
Browse files

MDL-67748 admin: Improve the display of tokens the user cannot see

parent 2c177ae4
......@@ -115,10 +115,6 @@ if ($action === 'delete') {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('managetokens', 'core_webservice'));
if (has_capability('moodle/webservice:managealltokens', context_system::instance())) {
echo html_writer::div(get_string('onlyseecreatedtokens', 'core_webservice'), 'alert alert-info');
$table = new \core_webservice\token_table('webservicetokens');
$table->attributes['class'] = 'admintable generaltable';
......@@ -130,7 +130,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'] = 'Any token can be deleted, though you can only view tokens that you created.';
$string['onlyseecreatedtokens'] = 'You can only view tokens that you created.';
$string['operation'] = 'Operation';
$string['optional'] = 'Optional';
$string['passwordisexpired'] = 'Password is expired.';
......@@ -165,7 +165,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 \html_writer::tag('small', get_string('onlyseecreatedtokens', 'core_webservice'), ['class' => 'text-muted']);
return $data->token;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment