]> git.mjollnir.org Git - moodle.git/commitdiff
Changed to link with new files (backup_form.html, backup_check.html
authorstronk7 <stronk7>
Sun, 4 May 2003 21:32:11 +0000 (21:32 +0000)
committerstronk7 <stronk7>
Sun, 4 May 2003 21:32:11 +0000 (21:32 +0000)
and backup_execute.html)

backup/backup.php
backup/lib.php

index a14b71a7ae27cce781f249a3c1b7748da6e50f85..511775f7605296ed00ae0a513930278e83d13525 100644 (file)
     print_simple_box_start("center", "", "$THEME->cellheading");
     //Call the form, depending the step we are
     if (!$launch) {
-        include_once("backup.html");
+        include_once("backup_form.html");
     } else {
         if ($launch == "check") {
-            include_once("check.html");
+            include_once("backup_check.html");
         }
         if ($launch == "execute") {
-            include_once("check.html");
+            include_once("backup_execute.html");
         }
     }
     print_simple_box_end();
index ce9f3a43e250a6696a37266d6338b0b22d978355..16dd25842d9d1d3a08a59edf7f147cf7d1ff60a2 100644 (file)
 
         return $info; 
     }
-
-
+   
+    //Delete old data in backup tables (if exists)
+    //Two days seems to be apropiate
+    function backup_delete_old_data() {
+        //Change this if you want !!
+        $days = 2;
+        //End change this
+        $seconds = days * 24 * 60 * 60;
+        $delete_from = time()-$seconds;
+        //Now delete from tables
+        $status = execute_sql("DELETE FROM {$CFG->prefix}backup_ids b
+                               WHERE b.backup_code < '$delete_from'",false);
+        $status = execute_sql("DELETE FROM {$CFG->prefix}backup_files b
+                               WHERE b.backup_code < '$delete_from'",false);
+        return($status);
+    }
 ?>