]> git.mjollnir.org Git - moodle.git/commitdiff
mnet: backup_general_info() now indicates whether it includes MNET_REMOTEUSERS
authormartinlanghoff <martinlanghoff>
Tue, 16 Jan 2007 02:52:51 +0000 (02:52 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 16 Jan 2007 02:52:51 +0000 (02:52 +0000)
backup/backuplib.php

index 4bec15b82aed03ebe13692f2ad3d5239ca87ebf8..03bb9454b57dab967d4fda1017c03102e7f49011 100644 (file)
         } else {
             $zipmethod = 'internal';
         }
+        //Indicate if it includes external MNET users
+        $sql = "SELECT b.old_id
+                   FROM   {$CFG->prefix}backup_ids b
+                     JOIN {$CFG->prefix}user       u ON b.old_id=u.id
+                   WHERE b.backup_code = '$preferences->backup_unique_code' 
+                         AND b.table_name = 'user' AND u.mnethostid != '{$CFG->mnet_localhost_id}'";
+        if (record_exists_sql($sql)) {
+            fwrite ($bf,full_tag("MNET_REMOTEUSERS",2,false,'true'));
+        }
         fwrite ($bf,full_tag("ZIP_METHOD",2,false,$zipmethod));
         //Te includes tag
         fwrite ($bf,start_tag("DETAILS",2,true));