From 4a2bc24b53b1f94e58a556ad812adf9bc968e8f0 Mon Sep 17 00:00:00 2001 From: Harris Wong Date: Fri, 8 Oct 2010 20:39:49 +0000 Subject: [PATCH] shorten import path from OAuth to 6 hex characters long. http://atutor.ca/atutor/mantis/view.php?id=4506 --- docs/home/editor/edit_content.php | 4 +--- docs/home/ims/ims_import.php | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/home/editor/edit_content.php b/docs/home/editor/edit_content.php index d09f20f..e2bccc3 100644 --- a/docs/home/editor/edit_content.php +++ b/docs/home/editor/edit_content.php @@ -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 diff --git a/docs/home/ims/ims_import.php b/docs/home/ims/ims_import.php index 1d2e444..4a031fc 100644 --- a/docs/home/ims/ims_import.php +++ b/docs/home/ims/ims_import.php @@ -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); } -- 2.17.1