]> git.mjollnir.org Git - moodle.git/commitdiff
Added compatibility in user->auth from 1.3 backups...$CFG->auth is used
authorstronk7 <stronk7>
Sat, 28 Aug 2004 17:30:34 +0000 (17:30 +0000)
committerstronk7 <stronk7>
Sat, 28 Aug 2004 17:30:34 +0000 (17:30 +0000)
backup/restorelib.php

index 7bb74a4b5ece966bd30b78c79f7b80fe90dac004..8b2d5ca8ed4912ea9039fe5ad3cd0572fcf3557b 100644 (file)
                     $user->description = restore_decode_absolute_links(addslashes($user->description));
 
                     //We need to analyse the AUTH field to recode it:
+                    //   - if the field isn't set, we are in a pre 1.4 backup and we'll 
+                    //     use $CFG->auth
                     //   - if the destination site has any kind of INTERNAL authentication, 
                     //     then apply it to the new user.
                     //   - if the destination site has any kind of EXTERNAL authentication, 
                     //     then leave the original authentication of the user.
 
-                    if (is_internal_auth($CFG->auth)) {
+                    if ((! isset($user->auth)) || is_internal_auth($CFG->auth)) {
                         $user->auth = $CFG->auth;
                     }