Skip to content

Commit

Permalink
MDL-28386 Authentication Fixing user id issue with logs when a new us…
Browse files Browse the repository at this point in the history
…er is added
  • Loading branch information
EVAN Irving-Pease authored and ankitagarwal committed Feb 20, 2012
1 parent 0dde394 commit 44ef537
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion user/editadvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
$userform->set_data($user);

if ($usernew = $userform->get_data()) {
add_to_log($course->id, 'user', 'update', "view.php?id=$user->id&course=$course->id", '');

if (empty($usernew->auth)) {
//user editing self
Expand All @@ -161,6 +160,7 @@
$usernew->password = hash_internal_user_password($usernew->newpassword);
$usernew->id = $DB->insert_record('user', $usernew);
$usercreated = true;
add_to_log($course->id, 'user', 'add', "view.php?id=$usernew->id&course=$course->id", '');

} else {
$usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, $usercontext, 'user', 'profile', 0);
Expand All @@ -171,6 +171,7 @@
$DB->update_record('user', $user);
print_error('cannotupdateuseronexauth', '', '', $user->auth);
}
add_to_log($course->id, 'user', 'update', "view.php?id=$user->id&course=$course->id", '');

//set new password if specified
if (!empty($usernew->newpassword)) {
Expand Down

0 comments on commit 44ef537

Please sign in to comment.