From 3ff717094679d1b3280398825671a3ce439769bc Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Mon, 12 Nov 2012 21:46:10 +0000 Subject: [PATCH] default upload path moved to e107_system/temp - requires testing. --- e107_admin/image.php | 18 ++++++++++++------ e107_handlers/e107_class.php | 2 +- e107_handlers/upload_handler.php | 3 ++- .../languages/English/admin_download.php | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/e107_admin/image.php b/e107_admin/image.php index 5af9d303a..1838cb5ca 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -1337,7 +1337,8 @@ class media_admin_ui extends e_admin_ui $pref['upload_storagetype'] = "1"; require_once(e_HANDLER."upload_handler.php"); //TODO - still not a class! - $uploaded = process_uploaded_files(e_MEDIA.'temp/'); //FIXME doesn't handle xxx.JPG (uppercase) + // $uploaded = process_uploaded_files(e_MEDIA.'temp/'); //FIXME doesn't handle xxx.JPG (uppercase) + $uploaded = process_uploaded_files(e_TEMP); //FIXME doesn't handle xxx.JPG (uppercase) $upload = array_shift($uploaded); if(vartrue($upload['error'])) { @@ -1352,7 +1353,8 @@ class media_admin_ui extends e_admin_ui } $mes->addDebug(print_a($upload,TRUE)); - $oldpath = e_MEDIA."temp/".$upload['name']; + // $oldpath = e_MEDIA."temp/".$upload['name']; + $oldpath = e_TEMP.$upload['name']; $newpath = $this->checkDupe($oldpath,$typePath.'/'.$upload['name']); if(!rename($oldpath, e_MEDIA.$newpath)) @@ -1395,7 +1397,8 @@ class media_admin_ui extends e_admin_ui $fname = basename($new_data['media_url']); // move to the required place - if(strpos($new_data['media_url'], '{e_MEDIA}temp/') !== FALSE) + if(strpos($new_data['media_url'], '{e_TEMP}') !== FALSE) + // if(strpos($new_data['media_url'], '{e_MEDIA}temp/') !== FALSE) { $tp = e107::getParser(); $oldpath = $tp->replaceConstants($new_data['media_url']); @@ -1486,7 +1489,8 @@ class media_admin_ui extends e_admin_ui $fl->setFileInfo('all'); $rejectArray = array('^\.ftpquota$','^index\.html$','^null\.txt$','\.bak$','^.tmp','.*\.xml$','^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','^\.htaccess$','index\.html','null\.txt'); $fl->setFileFilter($rejectArray); - $files = $fl->get_files(e_MEDIA."temp/"); + // $files = $fl->get_files(e_MEDIA."temp/"); + $files = $fl->get_files(e_TEMP); e107::js('core','core/admin.js','prototype'); @@ -1676,7 +1680,8 @@ class media_admin_ui extends e_admin_ui continue; } - $oldpath = e_MEDIA."temp/".$file; + // $oldpath = e_MEDIA."temp/".$file; + $oldpath = e_TEMP.$file; if(file_exists($oldpath)) { unlink($oldpath); @@ -1724,7 +1729,8 @@ class media_admin_ui extends e_admin_ui foreach($_POST['batch_selected'] as $key=>$file) { - $oldpath = e_MEDIA."temp/".$file; + // $oldpath = e_MEDIA."temp/".$file; + $oldpath = e_TEMP.$file; // Resize on Import Routine ------------------------ if(vartrue($img_import_w) && vartrue($img_import_h)) diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 1db56613c..924cbbb46 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -427,7 +427,7 @@ class e107 $ret['MEDIA_AVATARS_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'avatars/'; $ret['MEDIA_VIDEOS_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'videos/'; $ret['MEDIA_FILES_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'files/'; - $ret['MEDIA_UPLOAD_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'temp/'; + $ret['MEDIA_UPLOAD_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'temp/'; // security measure. Media is public, system is private. // $ret['WEB_JS_DIRECTORY'] = $ret['WEB_DIRECTORY'].'js/'; $ret['WEB_JS_DIRECTORY'] = $ret['FILES_DIRECTORY'].'jslib/'; diff --git a/e107_handlers/upload_handler.php b/e107_handlers/upload_handler.php index 4aa15cbcc..773139de6 100644 --- a/e107_handlers/upload_handler.php +++ b/e107_handlers/upload_handler.php @@ -36,7 +36,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_upload_handler.php'); define("UH_DEBUG", FALSE); //FIXME need another name -define('e_UPLOAD_TEMP_DIR', e_MEDIA.'temp/'); // Temporary directory - used if PHP's OPEN_BASEDIR active +// define('e_UPLOAD_TEMP_DIR', e_MEDIA.'temp/'); +define('e_UPLOAD_TEMP_DIR', e_TEMP); // Temporary directory - used if PHP's OPEN_BASEDIR active define('e_READ_FILETYPES', 'filetypes.xml'); // Upload permissions define('e_SAVE_FILETYPES', 'filetypes_.xml'); diff --git a/e107_plugins/download/languages/English/admin_download.php b/e107_plugins/download/languages/English/admin_download.php index ac8922301..4727fdca2 100644 --- a/e107_plugins/download/languages/English/admin_download.php +++ b/e107_plugins/download/languages/English/admin_download.php @@ -91,7 +91,7 @@ define("DOWLAN_67", "ID"); define("DOWLAN_68", "File Missing!"); define("DOWLAN_69", "Downloads handled by PHP"); define("DOWLAN_70", "Checking this will send all download requests through PHP."); -define("DOWLAN_71", "This page helps you create a file for managing file upload permissions. The file is saved as ../e107_files/temp/filetypes_.xml, and must be copied to ../e107_admin/filetypes.xml before it takes effect."); +// define("DOWLAN_71", "This page helps you create a file for managing file upload permissions. The file is saved as ../e107_files/temp/filetypes_.xml, and must be copied to ../e107_admin/filetypes.xml before it takes effect."); define("DOWLAN_72", "Source for values: "); define("DOWLAN_73", "Userclass"); define("DOWLAN_74", "File extensions");