Skip to content

Commit

Permalink
Merge pull request #110 from catalyst/support-401
Browse files Browse the repository at this point in the history
Support 4.1
  • Loading branch information
brendanheywood authored Nov 11, 2024
2 parents 096608e + 2cb4b35 commit 43a4450
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ https://moodle.org/plugins/block_enrolkey
Branches
--------

| Moodle version | Branch | PHP |
| --------------------- | ----------- | ----- |
| Moodle 3.5 to 3.11 | master | 7.1+ |
| Moodle version | Branch | PHP |
|-------------------| ----------- | ----- |
| Moodle 3.5 to 4.5 | master | 7.1+ |

Installation
------------
Expand Down Expand Up @@ -66,7 +66,9 @@ Admin Usage

Enable a new Self enrolment method in the course required.

`Course administration > Users > Enrolment methods > Add method > Self enrolment`
Moodle 3.5 to 3.11, `Course administration > Users > Enrolment methods > Add method > Self enrolment`

Moodle 4.0+, `Participants > Enrolments > Enrolment methods > Add method > Self enrolment`

The Enrolment key field that is visible will be used for the automatic enrolment on signup.

Expand Down
4 changes: 2 additions & 2 deletions auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,18 @@ public function user_signup($user, $notify=true) {
// Access to course, but confirmation required before next login attempt.
$user->confirmed = 0;
}
$user->lastip = getremoteaddr();
$user->id = user_create_user($user, false, false);

// Save any custom profile field information.
profile_save_data($user);

// Trigger event.
\core\event\user_created::create_from_userid($user->id)->trigger();

if ($notify) {
if (!send_confirmation_email($user)) {
// TODO make this more resilient? Email shouldn't be critical here.
print_error('noemail', 'auth_enrolkey');
throw new \moodle_exception('noemail', 'auth_enrolkey');
}
}

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
$plugin->requires = 2014051200; // Requires this Moodle version (2.7+).
$plugin->component = 'auth_enrolkey'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
$plugin->supported = [35, 311]; // A range of branch numbers of supported moodle versions.
$plugin->supported = [35, 405]; // A range of branch numbers of supported moodle versions.

0 comments on commit 43a4450

Please sign in to comment.