1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 09:29:45 +01:00

default upload path moved to e107_system/temp - requires testing.

This commit is contained in:
CaMer0n 2012-11-12 21:46:10 +00:00
parent 193e9df452
commit 3ff7170946
4 changed files with 16 additions and 9 deletions

View File

@ -1337,7 +1337,8 @@ class media_admin_ui extends e_admin_ui
$pref['upload_storagetype'] = "1"; $pref['upload_storagetype'] = "1";
require_once(e_HANDLER."upload_handler.php"); //TODO - still not a class! 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); $upload = array_shift($uploaded);
if(vartrue($upload['error'])) if(vartrue($upload['error']))
{ {
@ -1352,7 +1353,8 @@ class media_admin_ui extends e_admin_ui
} }
$mes->addDebug(print_a($upload,TRUE)); $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']); $newpath = $this->checkDupe($oldpath,$typePath.'/'.$upload['name']);
if(!rename($oldpath, e_MEDIA.$newpath)) if(!rename($oldpath, e_MEDIA.$newpath))
@ -1395,7 +1397,8 @@ class media_admin_ui extends e_admin_ui
$fname = basename($new_data['media_url']); $fname = basename($new_data['media_url']);
// move to the required place // 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(); $tp = e107::getParser();
$oldpath = $tp->replaceConstants($new_data['media_url']); $oldpath = $tp->replaceConstants($new_data['media_url']);
@ -1486,7 +1489,8 @@ class media_admin_ui extends e_admin_ui
$fl->setFileInfo('all'); $fl->setFileInfo('all');
$rejectArray = array('^\.ftpquota$','^index\.html$','^null\.txt$','\.bak$','^.tmp','.*\.xml$','^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','^\.htaccess$','index\.html','null\.txt'); $rejectArray = array('^\.ftpquota$','^index\.html$','^null\.txt$','\.bak$','^.tmp','.*\.xml$','^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','^\.htaccess$','index\.html','null\.txt');
$fl->setFileFilter($rejectArray); $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'); e107::js('core','core/admin.js','prototype');
@ -1676,7 +1680,8 @@ class media_admin_ui extends e_admin_ui
continue; continue;
} }
$oldpath = e_MEDIA."temp/".$file; // $oldpath = e_MEDIA."temp/".$file;
$oldpath = e_TEMP.$file;
if(file_exists($oldpath)) if(file_exists($oldpath))
{ {
unlink($oldpath); unlink($oldpath);
@ -1724,7 +1729,8 @@ class media_admin_ui extends e_admin_ui
foreach($_POST['batch_selected'] as $key=>$file) 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 ------------------------ // Resize on Import Routine ------------------------
if(vartrue($img_import_w) && vartrue($img_import_h)) if(vartrue($img_import_w) && vartrue($img_import_h))

View File

@ -427,7 +427,7 @@ class e107
$ret['MEDIA_AVATARS_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'avatars/'; $ret['MEDIA_AVATARS_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'avatars/';
$ret['MEDIA_VIDEOS_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'videos/'; $ret['MEDIA_VIDEOS_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'videos/';
$ret['MEDIA_FILES_DIRECTORY'] = $ret['MEDIA_DIRECTORY'].'files/'; $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['WEB_DIRECTORY'].'js/';
$ret['WEB_JS_DIRECTORY'] = $ret['FILES_DIRECTORY'].'jslib/'; $ret['WEB_JS_DIRECTORY'] = $ret['FILES_DIRECTORY'].'jslib/';

View File

@ -36,7 +36,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_upload_handler.php');
define("UH_DEBUG", FALSE); define("UH_DEBUG", FALSE);
//FIXME need another name //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_READ_FILETYPES', 'filetypes.xml'); // Upload permissions
define('e_SAVE_FILETYPES', 'filetypes_.xml'); define('e_SAVE_FILETYPES', 'filetypes_.xml');

View File

@ -91,7 +91,7 @@ define("DOWLAN_67", "ID");
define("DOWLAN_68", "File Missing!"); define("DOWLAN_68", "File Missing!");
define("DOWLAN_69", "Downloads handled by PHP"); define("DOWLAN_69", "Downloads handled by PHP");
define("DOWLAN_70", "Checking this will send all download requests through 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_72", "Source for values: ");
define("DOWLAN_73", "Userclass"); define("DOWLAN_73", "Userclass");
define("DOWLAN_74", "File extensions"); define("DOWLAN_74", "File extensions");