Skip to content

Commit

Permalink
MDL-19390 user: fixed typo during integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jun 30, 2013
1 parent 483b680 commit 4d6f35c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions user/editadvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@
}

$usernew->timemodified = time();
$cratepassword = false;
$createpassword = false;

if ($usernew->id == -1) {
//TODO check out if it makes sense to create account with this auth plugin and what to do with the password
unset($usernew->id);
$cratepassword = !empty($usernew->createpassword);
$createpassword = !empty($usernew->createpassword);
unset($usernew->createpassword);
$usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, null, 'user', 'profile', null);
$usernew->mnethostid = $CFG->mnet_localhost_id; // always local user
$usernew->confirmed = 1;
$usernew->timecreated = time();
if ($cratepassword) {
if ($createpassword) {
$usernew->password = '';
} else {
$usernew->password = hash_internal_user_password($usernew->newpassword);
Expand Down Expand Up @@ -244,7 +244,7 @@
events_trigger('user_updated', $usernew);
}

if ($cratepassword) {
if ($createpassword) {
setnew_password_and_mail($usernew);
unset_user_preference('create_password', $usernew);
set_user_preference('auth_forcepasswordchange', 1, $usernew);
Expand Down

0 comments on commit 4d6f35c

Please sign in to comment.