Skip to content

Commit

Permalink
MDL-65518 badges: Require the issuercontact
Browse files Browse the repository at this point in the history
For Badges V2 we can't use just any email address to issue badges, it needs to be a valid
account on the backpack.
  • Loading branch information
Damyon Wiese committed May 10, 2019
1 parent 04a6cd7 commit 084a42f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion badges/classes/backpack_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function __construct($sitebackpack, $userbackpack = false) {
$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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/badgeslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit 084a42f

Please sign in to comment.