]> git.mjollnir.org Git - moodle.git/commitdiff
Only save to backup_ids restoreable modules.
authorstronk7 <stronk7>
Fri, 30 May 2003 21:56:08 +0000 (21:56 +0000)
committerstronk7 <stronk7>
Fri, 30 May 2003 21:56:08 +0000 (21:56 +0000)
backup/restorelib.php

index c256a7b9b3592dfc1ea12920503f3d8844ef501b..78564f13940b9d5b1fbc495df971a7bbe85c08cc 100644 (file)
                     //Get id and modtype from data
                     $mod_id = $data["MOD"]["#"]["ID"]["0"]["#"];
                     $mod_type = $data["MOD"]["#"]["MODTYPE"]["0"]["#"];
-                    //Serialize it
-                    $mod_temp = serialize($data);
-                    //Now add slashes
-                    $sla_mod_temp = addslashes($mod_temp);
-                    //Save to db
-                    backup_putid($this->preferences->backup_unique_code,$mod_type,$mod_id,
-                                 null,$sla_mod_temp);
+                    //Only if we've selected to restore it
+                    if  ($this->preferences->mods[$mod_type]->restore) {
+                        //Serialize it
+                        $mod_temp = serialize($data);
+                        //Now add slashes
+                        $sla_mod_temp = addslashes($mod_temp);
+                        //Save to db
+                        backup_putid($this->preferences->backup_unique_code,$mod_type,$mod_id,
+                                     null,$sla_mod_temp);
+                    }
                     //Reset info to empty
                     $this->info = "";
                 }