fix for MDL-8480 external db user lang sync problem

This commit is contained in:
toyomoyo 2007-02-13 03:08:27 +00:00
parent 6155150c02
commit e51917eb12

View File

@ -2433,7 +2433,14 @@ function create_user_record($username, $password, $auth='') {
$newuser->auth = (empty($auth)) ? $CFG->auth : $auth;
$newuser->username = $username;
update_internal_user_password($newuser, $password, false);
$newuser->lang = $CFG->lang;
// fix for MDL-8480
// user CFG lang for user if $newuser->lang is empty
// or $user->lang is not an installed language
$sitelangs = array_keys(get_list_of_languages());
if (empty($newuser->lang) || !in_array($newuser->lang, $sitelangs)) {
$newuser -> lang = $CFG->lang;
}
$newuser->confirmed = 1;
$newuser->lastip = getremoteaddr();
$newuser->timemodified = time();