shorten import path from OAuth to 6 hex characters long.
authorHarris Wong <hwong@ocad.ca>
Fri, 8 Oct 2010 20:39:49 +0000 (20:39 -0000)
committerHarris Wong <hwong@ocad.ca>
Fri, 8 Oct 2010 20:39:49 +0000 (20:39 -0000)
http://atutor.ca/atutor/mantis/view.php?id=4506

docs/home/editor/edit_content.php
docs/home/ims/ims_import.php

index d09f20f..e2bccc3 100644 (file)
@@ -72,7 +72,6 @@ if (isset($_POST['submit_file'])) {
        paste_from_file(body_text);
 } else if (isset($_POST['submit']) && ($_POST['submit'] != 'submit1')) {
        /* we're saving. redirects if successful. */
-       debug('here');exit;
        save_changes(true, $current_tab);
 }
 
@@ -85,7 +84,6 @@ if (isset($_POST['submit_file_alt'])) {
 
 if (isset($_POST['submit'])) {
        /* we're saving. redirects if successful. */
-       debug('here');
        save_changes(true, $current_tab);
 }
 
@@ -138,7 +136,7 @@ if ($cid) {
                $content_base_href = 'content/' . $_SESSION['course_id'] . '/';
        }
 }
-debug($content_base_href);exit;
+
 if (($current_tab == 0) || ($current_tab == 2)) {
     if ($_POST['formatting'] == null){ 
         // this is a fresh load from just logged in
index 1d2e444..4a031fc 100644 (file)
@@ -877,8 +877,9 @@ if (isset($_REQUEST['url']) && ($_REQUEST['url'] != 'http://') ) {
        $_FILES['file']['tmp_name'] = $full_filename;
        $_FILES['file']['size']     = strlen($content);
        unset($content);
-       $url_parts = pathinfo($_REQUEST['url']);
-       $package_base_name_url = $url_parts['basename'];
+//     $url_parts = pathinfo($_REQUEST['url']);
+//     $package_base_name_url = $url_parts['basename'];
+    $package_base_name_url = md5(time());
 }
 $ext = pathinfo($_FILES['file']['name']);
 $ext = $ext['extension'];
@@ -1129,7 +1130,7 @@ else $_course_id = $_POST['_course_id'];
 /* the 'content_path' field in the content table will be set to this path. */
 /* $package_base_name_url comes from the URL file name (NOT the file name of the actual file we open)*/
 if (!$package_base_name && $package_base_name_url) {
-       $package_base_name = substr($package_base_name_url, 0, -4);
+       $package_base_name = substr($package_base_name_url, -6);
 } else if (!$package_base_name) {
        $package_base_name = substr($_FILES['file']['name'], 0, -4);
 }