diff --git a/badges/classes/form/external_backpack.php b/badges/classes/form/external_backpack.php index f92febd6394e2..e5c495c0304e8 100644 --- a/badges/classes/form/external_backpack.php +++ b/badges/classes/form/external_backpack.php @@ -80,16 +80,16 @@ public function definition() { $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); }