MDL-14679 fixed a lot more old style uses of insert_record()

This commit is contained in:
Petr Skoda
2010-09-03 17:47:41 +00:00
parent b44ff4e45b
commit a9637e7df4
15 changed files with 233 additions and 327 deletions
+2 -3
View File
@@ -365,15 +365,14 @@ class auth_plugin_db extends auth_plugin_base {
$DB->set_field('user', 'deleted', 0, array('username'=>$user->username));
echo "\t"; print_string('auth_dbreviveduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
} elseif ($id = $DB->insert_record ('user',$user)) { // it is truly a new user
} else {
$id = $DB->insert_record ('user',$user); // it is truly a new user
echo "\t"; print_string('auth_dbinsertuser','auth_db',array('name'=>$user->username, 'id'=>$id)); echo "\n";
// if relevant, tag for password generation
if ($this->config->passtype === 'internal') {
set_user_preference('auth_forcepasswordchange', 1, $id);
set_user_preference('create_password', 1, $id);
}
} else {
echo "\t"; print_string('auth_dbinsertusererror', 'auth_db', $user->username); echo "\n";
}
}
$transaction->allow_commit();