mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-18293 $DB->something is using exceptions, no need for ifs there, removing useless strings
This commit is contained in:
parent
7826abc79f
commit
2a7eff41ad
8 changed files with 30 additions and 59 deletions
|
@ -97,15 +97,11 @@
|
|||
$usernew->mnethostid = $CFG->mnet_localhost_id; // always local user
|
||||
$usernew->confirmed = 1;
|
||||
$usernew->password = hash_internal_user_password($usernew->newpassword);
|
||||
if (!$usernew->id = $DB->insert_record('user', $usernew)) {
|
||||
print_error('cannotcreateuser');
|
||||
}
|
||||
$usernew->id = $DB->insert_record('user', $usernew);
|
||||
$usercreated = true;
|
||||
|
||||
} else {
|
||||
if (!$DB->update_record('user', $usernew)) {
|
||||
print_error('cannotupdateuser', 'message');
|
||||
}
|
||||
$DB->update_record('user', $usernew);
|
||||
// pass a true $userold here
|
||||
if (! $authplugin->user_update($user, $userform->get_data())) {
|
||||
// auth update failed, rollback for moodle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue