Skip to content

Commit

Permalink
Add fields for creating users
Browse files Browse the repository at this point in the history
  • Loading branch information
Laur0r authored Oct 21, 2024
1 parent 649baa5 commit d5f2d86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,17 @@ function local_bulkenrol_get_exception_info($e) {
}

function create_users(&$localbulkenroldata) {
global $CFG;
$userstocreate = $localbulkenroldata->users_to_be_created;
$emailsuffix = get_config('local_bulkenrol', 'email_suffix');
if (count($userstocreate) > 0 && empty($emailsuffix)) {
throw new \Exception("Emailsuffix may not be empty");
}
foreach($userstocreate as $username) {
$user = new \stdClass();
$user->auth = 'ldap';
$user->confirmed = true;
$user->mnethostid = $CFG->mnet_localhost_id;
$user->username = $username;
$user->firstname = "NOCH NICHT";
$user->lastname = "EINGELOGGT";
Expand Down

0 comments on commit d5f2d86

Please sign in to comment.