diff --git a/lang/en/webservice.php b/lang/en/webservice.php index 0ae2dd3d1ec..0017e1d85dc 100644 --- a/lang/en/webservice.php +++ b/lang/en/webservice.php @@ -118,7 +118,7 @@ $string['loginrequired'] = 'Restricted to logged-in users'; $string['manageprotocols'] = 'Manage protocols'; $string['managetokens'] = 'Manage tokens'; $string['missingcaps'] = 'Missing capabilities'; -$string['missingcaps_help'] = 'List of required capabilities for the service which the selected user does not have. Missing capabilities must be added to the user\'s role in order to use the service.'; +$string['missingcaps_help'] = 'List of capabilities declared by the service which the user does not have. Some service functionality may not be available without these capabilities.'; $string['missingpassword'] = 'Missing password'; $string['missingrequiredcapability'] = 'The capability {$a} is required.'; $string['missingusername'] = 'Missing username'; diff --git a/webservice/classes/token_table.php b/webservice/classes/token_table.php index 2ffaebc8836..deb8a7a816f 100644 --- a/webservice/classes/token_table.php +++ b/webservice/classes/token_table.php @@ -84,7 +84,7 @@ class token_table extends \table_sql { $headers[] = get_string('user'); $columns[] = 'fullname'; $headers[] = get_string('service', 'webservice'); - $columns[] = 'name'; + $columns[] = 'servicename'; $headers[] = get_string('iprestriction', 'webservice'); $columns[] = 'iprestriction'; $headers[] = get_string('validuntil', 'webservice'); @@ -165,7 +165,8 @@ class token_table extends \table_sql { $webservicemanager = new \webservice(); $usermissingcaps = $webservicemanager->get_missing_capabilities_by_users([['id' => $data->userid]], $data->serviceid); - if (!is_siteadmin($data->userid) && array_key_exists($data->userid, $usermissingcaps)) { + if ($data->serviceshortname <> MOODLE_OFFICIAL_MOBILE_SERVICE && !is_siteadmin($data->userid) + && array_key_exists($data->userid, $usermissingcaps)) { $count = \html_writer::span(count($usermissingcaps[$data->userid]), 'badge badge-danger'); $links = array_map(function($capname) { return get_capability_docs_link((object)['name' => $capname]) . \html_writer::div($capname, 'text-muted'); @@ -216,6 +217,16 @@ class token_table extends \table_sql { return \html_writer::link($creatorprofileurl, fullname((object)$user, $this->hasviewfullnames)); } + /** + * Format the service name column. + * + * @param \stdClass $data + * @return string + */ + public function col_servicename($data) { + return \html_writer::div(s($data->servicename)) . \html_writer::div(s($data->serviceshortname), 'small text-muted'); + } + /** * This function is used for the extra user fields. * @@ -259,7 +270,7 @@ class token_table extends \table_sql { $selectfields = "SELECT t.id, t.token, t.iprestriction, t.validuntil, t.creatorid, u.id AS userid, $usernamefields, - s.id AS serviceid, s.name, + s.id AS serviceid, s.name AS servicename, s.shortname AS serviceshortname, $creatorfields "; $selectcount = "SELECT COUNT(t.id) ";