*/
public static function get_features_list() {
global $CFG;
+ require_once($CFG->libdir . '/authlib.php');
$general = new lang_string('general');
$mainmenu = new lang_string('mainmenu', 'tool_mobile');
$user = new lang_string('user');
$files = new lang_string('files');
$remoteaddons = new lang_string('remoteaddons', 'tool_mobile');
+ $identityproviders = new lang_string('oauth2identityproviders', 'tool_mobile');
$availablemods = core_plugin_manager::instance()->get_plugins_of_type('mod');
$coursemodules = array();
$features["$remoteaddons"] = $remoteaddonslist;
}
+ // Display OAuth 2 identity providers.
+ if (is_enabled_auth('oauth2')) {
+ $identityproviderslist = array();
+ $idps = \auth_plugin_base::get_identity_providers(['oauth2']);
+
+ foreach ($idps as $idp) {
+ // Only add identity providers that have an ID.
+ $id = isset($idp['url']) ? $idp['url']->get_param('id') : null;
+ if ($id != null) {
+ $identityproviderslist['NoDelegate_IdentityProvider_' . $id] = $idp['name'];
+ }
+ }
+
+ if (!empty($identityproviderslist)) {
+ $features["$identityproviders"] = array();
+
+ if (count($identityproviderslist) > 1) {
+ // Include an option to disable them all.
+ $features["$identityproviders"]['NoDelegate_IdentityProviders'] = new lang_string('all');
+ }
+
+ $features["$identityproviders"] = array_merge($features["$identityproviders"], $identityproviderslist);
+ }
+ }
+
return $features;
}
$string['mobilefeatures'] = 'Mobile features';
$string['mobilenotificationsdisabledwarning'] = 'Mobile notifications are not enabled. They should be enabled in Notification settings.';
$string['mobilesettings'] = 'Mobile settings';
+$string['oauth2identityproviders'] = 'OAuth 2 identity providers';
$string['offlineuse'] = 'Offline use';
$string['pluginname'] = 'Moodle app tools';
$string['pluginnotenabledorconfigured'] = 'Plugin not enabled or configured.';