community hub MDL-24097 change backup zip extension to mbz extension
authorjerome mouneyrac <jerome@moodle.com>
Thu, 9 Sep 2010 02:22:35 +0000 (02:22 +0000)
committerjerome mouneyrac <jerome@moodle.com>
Thu, 9 Sep 2010 02:22:35 +0000 (02:22 +0000)
blocks/community/communitycourse.php
blocks/community/locallib.php
blocks/community/renderer.php

index 4810bb2..4c318d1 100644 (file)
@@ -86,7 +86,7 @@ $cancelrestore = optional_param('cancelrestore', false, PARAM_INT);
 if ($usercandownload and $cancelrestore and confirm_sesskey()) {
     $filename = optional_param('filename', '', PARAM_ALPHANUMEXT);
     //delete temp file
-    unlink($CFG->dataroot . '/temp/backup/' . $filename . ".zip");
+    unlink($CFG->dataroot . '/temp/backup/' . $filename . ".mbz");
 }
 
 /// Download
index d2fce8b..c768bbb 100644 (file)
@@ -91,7 +91,7 @@ class block_community_manager {
         $filename = md5(time() . '-' . $course->id . '-'. $USER->id . '-'. random_string(20));
 
         $url  = new moodle_url($course->huburl.'/local/hub/webservice/download.php', $params);
-        $path = $CFG->dataroot.'/temp/backup/'.$filename.".zip";
+        $path = $CFG->dataroot.'/temp/backup/'.$filename.".mbz";
         $fp = fopen($path, 'w');
         $ch = curl_init($course->huburl.'/local/hub/webservice/download.php?filetype='
                 .HUB_BACKUP_FILE_TYPE.'&courseid='.$course->id);
@@ -105,12 +105,12 @@ class block_community_manager {
         $record->component = 'user';
         $record->filearea = 'private';
         $record->itemid = 0;
-        $record->filename = urlencode($course->fullname)."_".time().".zip";
+        $record->filename = urlencode($course->fullname)."_".time().".mbz";
         $record->filepath = '/downloaded_backup/';
         if (!$fs->file_exists($record->contextid, $record->component,
                 $record->filearea, 0, $record->filepath, $record->filename)) {
             $fs->create_file_from_pathname($record,
-                    $CFG->dataroot.'/temp/backup/'.$filename.".zip");
+                    $CFG->dataroot.'/temp/backup/'.$filename.".mbz");
         }
 
         $filenames = array();
index ae0650a..f159371 100644 (file)
@@ -32,7 +32,7 @@ class block_community_renderer extends plugin_renderer_base {
 
     public function restore_confirmation_box($filename, $context) {
         $restoreurl = new moodle_url('/backup/restore.php',
-                        array('filename' => $filename . ".zip", 'contextid' => $context->id));
+                        array('filename' => $filename . ".mbz", 'contextid' => $context->id));
         $searchurl = new moodle_url('/blocks/community/communitycourse.php',
                         array('add' => 1, 'courseid' => $context->instanceid,
                             'cancelrestore' => 1, 'sesskey' => sesskey(),