Skip to content

Commit

Permalink
Merge branch 'MDL-39166-m25' of https://github.com/jfilip/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jun 3, 2013
2 parents 9e3b5a4 + 9b8e495 commit 0288c5f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions auth/ldap/auth.php
Expand Up @@ -598,6 +598,8 @@ function user_confirm($username, $confirmsecret) {
if ($user->firstaccess == 0) {
$DB->set_field('user', 'firstaccess', time(), array('id'=>$user->id));
}
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
return AUTH_CONFIRM_OK;
}
} else {
Expand Down Expand Up @@ -770,6 +772,8 @@ function sync_users($do_updates=true) {
$updateuser->auth = 'nologin';
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbsuspenduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
}
} else {
Expand All @@ -795,6 +799,8 @@ function sync_users($do_updates=true) {
$updateuser->auth = $this->authtype;
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbreviveduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
} else {
print_string('nouserentriestorevive', 'auth_ldap');
Expand Down Expand Up @@ -908,6 +914,8 @@ function sync_users($do_updates=true) {

$id = $DB->insert_record('user', $user);
echo "\t"; print_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_created', $euser);
if (!empty($this->config->forcechangepassword)) {
set_user_preference('auth_forcepasswordchange', 1, $id);
}
Expand Down Expand Up @@ -978,6 +986,10 @@ function update_user_record($username, $updatekeys = false) {
}
}
}
if (!empty($updatekeys)) {
$euser = $DB->get_record('user', array('id' => $userid));
events_trigger('user_updated', $euser);
}
} else {
return false;
}
Expand Down

0 comments on commit 0288c5f

Please sign in to comment.