mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-65518 badges: Require the issuercontact
For Badges V2 we can't use just any email address to issue badges, it needs to be a valid account on the backpack.
This commit is contained in:
parent
04a6cd7b44
commit
084a42f9f5
@ -91,7 +91,7 @@ class backpack_api {
|
||||
$this->backpackapiurl = $sitebackpack->backpackapiurl;
|
||||
$this->backpackapiversion = $sitebackpack->apiversion;
|
||||
$this->password = $sitebackpack->password;
|
||||
$this->email = !empty($CFG->badges_defaultissuercontact) ? $CFG->badges_defaultissuercontact : $admin->email;
|
||||
$this->email = !empty($CFG->badges_defaultissuercontact) ? $CFG->badges_defaultissuercontact : '';
|
||||
$this->isuserbackpack = false;
|
||||
$this->backpackid = $sitebackpack->id;
|
||||
if (!empty($userbackpack)) {
|
||||
|
@ -1195,7 +1195,7 @@ function badges_verify_site_backpack() {
|
||||
|
||||
// Now attempt a login with these credentials.
|
||||
$result = $backpackapi->authenticate();
|
||||
if ($result === false || !empty($result->error)) {
|
||||
if (empty($result) || !empty($result->error)) {
|
||||
$warning = $backpackapi->get_authentication_error();
|
||||
|
||||
$params = ['id' => $backpack->id, 'action' => 'edit'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user