mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-69055 core_badges: display password/oauth fields properly
This commit is contained in:
parent
a0fc902eb1
commit
6a10b78e2e
@ -80,16 +80,16 @@ class external_backpack extends \moodleform {
|
||||
$issuercontact = $CFG->badges_defaultissuercontact;
|
||||
$mform->addElement('static', 'issuerinfo', get_string('defaultissuercontact', 'core_badges'), $issuercontact);
|
||||
|
||||
if ($backpack && $backpack->apiversion != OPEN_BADGES_V2P1) {
|
||||
$mform->addElement('passwordunmask', 'password', get_string('defaultissuerpassword', 'core_badges'));
|
||||
$mform->setType('password', PARAM_RAW);
|
||||
$mform->addHelpButton('password', 'defaultissuerpassword', 'badges');
|
||||
$mform->hideIf('password', 'apiversion', 'eq', 1);
|
||||
} else {
|
||||
$oauth2options = badges_get_oauth2_service_options();
|
||||
$mform->addElement('select', 'oauth2_issuerid', get_string('oauth2issuer', 'core_badges'), $oauth2options);
|
||||
$mform->setType('oauth2_issuerid', PARAM_INT);
|
||||
}
|
||||
$mform->addElement('passwordunmask', 'password', get_string('defaultissuerpassword', 'core_badges'));
|
||||
$mform->setType('password', PARAM_RAW);
|
||||
$mform->addHelpButton('password', 'defaultissuerpassword', 'badges');
|
||||
$mform->hideIf('password', 'apiversion', 'neq', 2);
|
||||
|
||||
$oauth2options = badges_get_oauth2_service_options();
|
||||
$mform->addElement('select', 'oauth2_issuerid', get_string('oauth2issuer', 'core_badges'), $oauth2options);
|
||||
$mform->setType('oauth2_issuerid', PARAM_INT);
|
||||
$mform->hideIf('oauth2_issuerid', 'apiversion', 'neq', '2.1');
|
||||
|
||||
if ($backpack) {
|
||||
$this->set_data($backpack);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user