From: donal72 Date: Tue, 23 Jan 2007 22:03:48 +0000 (+0000) Subject: Mnet: Users mnethostid now defaults to the admin user's mnethostid: MDL-8253 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3a1edc56f4895aca14ba1006d537b88dcf8f0f0c;p=moodle.git Mnet: Users mnethostid now defaults to the admin user's mnethostid: MDL-8253 --- diff --git a/admin/uploaduser.php b/admin/uploaduser.php index a896e37f0b..34cbb77b9b 100755 --- a/admin/uploaduser.php +++ b/admin/uploaduser.php @@ -82,7 +82,8 @@ if ($um->preprocess_files() && confirm_sesskey()) { "firstname" => 1, "lastname" => 1, "email" => 1); - $optionalDefaults = array("institution" => 1, + $optionalDefaults = array("mnethostid" => 1, + "institution" => 1, "department" => 1, "city" => 1, "country" => 1, @@ -236,7 +237,7 @@ if ($um->preprocess_files() && confirm_sesskey()) { // an old record instead if ($allowrenames && !empty($user->oldusername) ) { $user->oldusername = moodle_strtolower($user->oldusername); - if ($olduser = get_record('user', 'username', $user->oldusername, 'mnethostid', $CFG->mnet_localhost_id)) { + if ($olduser = get_record('user', 'username', $user->oldusername, 'mnethostid', $user->mnethostid)) { if (set_field('user', 'username', $user->username, 'username', $user->oldusername)) { notify(get_string('userrenamed', 'admin') . " : $user->oldusername $user->username"); $renames++; @@ -252,7 +253,7 @@ if ($um->preprocess_files() && confirm_sesskey()) { } } - if ($olduser = get_record("user", "username", $username, "mnethostid", $CFG->mnet_localhost_id)) { + if ($olduser = get_record("user", "username", $username, "mnethostid", $user->mnethostid)) { if ($updateaccounts) { // Record is being updated $user->id = $olduser->id;