Merge branch 'MDL-75650-master-simple' of https://github.com/snake/moodle

This commit is contained in:
Jun Pataleta 2023-03-16 12:28:02 +08:00 committed by Sara Arjona
commit 7d9c04e2e6
6 changed files with 973 additions and 1 deletions

View file

@ -179,7 +179,8 @@ class issuer extends persistent {
$mform->hideIf('acceptrisk', 'requireconfirmation', 'checked');
if ($this->type == 'imsobv2p1' || $issuer->get('servicetype') == 'imsobv2p1') {
if ($this->type == 'imsobv2p1' || $issuer->get('servicetype') == 'imsobv2p1'
|| $this->type == 'moodlenet' || $issuer->get('servicetype') == 'moodlenet') {
$mform->addRule('baseurl', null, 'required', null, 'client');
} else {
$mform->addRule('clientid', null, 'required', null, 'client');

View file

@ -228,6 +228,12 @@ if ($mform && $mform->is_cancelled()) {
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('clever_service', 'tool_oauth2'));
// MoodleNet template.
$docs = 'admin/tool/oauth2/issuers/moodlenet';
$params = ['action' => 'edittemplate', 'type' => 'moodlenet', 'sesskey' => sesskey(), 'docslink' => $docs];
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', $params);
echo $renderer->single_button($addurl, get_string('moodlenet_service', 'tool_oauth2'));
// Generic issuer.
$addurl = new moodle_url('/admin/tool/oauth2/issuers.php', ['action' => 'edit']);
echo $renderer->single_button($addurl, get_string('custom_service', 'tool_oauth2'));

View file

@ -103,6 +103,7 @@ $string['linkedin_service'] = 'LinkedIn';
$string['logindisplay'] = 'Display on login page as';
$string['loginissuer'] = 'Allow login';
$string['microsoft_service'] = 'Microsoft';
$string['moodlenet_service'] = 'MoodleNet';
$string['nextcloud_service'] = 'Nextcloud';
$string['notconfigured'] = 'Not configured';
$string['notdiscovered'] = 'Service discovery not successful';