]> git.mjollnir.org Git - moodle.git/commitdiff
mnet: restore support - XML parser knows about MNET_EXTERNALUSERS, restore_check...
authormartinlanghoff <martinlanghoff>
Tue, 16 Jan 2007 03:28:57 +0000 (03:28 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 16 Jan 2007 03:28:57 +0000 (03:28 +0000)
This may need to be reworked to move the warning to an earlier stage. In the
meantime, we have

 - at INFO parsing time we read MNET_EXTERNALUSERS into the backup info obj
 - at restore_check time, we warn the user that external users are in the
   package. If the situation looks dodgy, we say so. But don't block the
   user, as it may be a valid situation.

backup/restore_check.html
backup/restorelib.php
lang/en_utf8/admin.php

index 56c56bd7c0f4ead3f36adf40dcf3a7be69c058db..e8d55b38b5112976b5847fc03abd4e17279be13b 100644 (file)
             $hidden["file"]               =  $file;
             $hidden["id"]                 =  $id;
             print_string('longtimewarning','admin');
+
+            if ($restore->users && !empty($info->mnet_externalusers) 
+                && $info->mnet_externalusers === 'true') {
+                if ($info->original_wwwroot === $CFG->wwwroot) {
+                    print '<p>'.get_string('mnetrestore_extusers','admin').'</p>';
+                } else {
+                    print '<p>'. get_string('mnetrestore_extusers_mismatch','admin').'</p>';
+                }
+            }
             print_single_button("restore.php", $hidden, get_string("restorecoursenow"),"post");
             echo "</center>";
         } else {
index 6bedea31d1c12b669a34d02051ac889110f7a8d3..4740f0039910c2d771275f06777df972b3e22e13 100644 (file)
                         case "ORIGINAL_WWWROOT":
                             $this->info->original_wwwroot = $this->getContents();
                             break;
+                        case "MNET_EXTERNALUSERS":
+                            $this->info->mnet_externalusers = $this->getContents();
+                            break;
                     }
                 }
                 if ($this->tree[3] == "DETAILS") {
index 630190131618178256b1c7d51b472afe8f1c29d2..898bc73242a12b2a5f0271f7625b36a9b1b83863 100644 (file)
@@ -356,6 +356,8 @@ $string['memcachedhosts'] = 'memcached hosts';
 $string['memcachedpconn'] = 'memcached use persistent connections';
 $string['messaging'] = 'Enable messaging system';
 $string['misc'] = 'Miscellaneous';
+$string['mnetrestore_extusers'] = '<strong>Note:</strong> This backup file contains remote Moodle Network user accounts which will be restored as part of the process.';
+$string['mnetrestore_extusers_mismatch'] = '<strong>Note:</strong> This backup file apparently originates from a different Moodle installation and contains remote Moodle Network user accounts that may fail to restore. This operation is unsupported. If you are certain that it was created on this Moodle installation, or you can ensure that all the needed Moodle Network Hosts are configured, you may want to still try the restore.';
 $string['modulesecurity'] = 'Module security';
 $string['multilangforceold'] = 'Force old multilang syntax: &lt;span&gt; without the class=\"multilang\" and &lt;lang&gt;';
 $string['multilangupgrade'] = 'Multilang upgrade';