diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index 32c8e71b0..521b49515 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -30,18 +30,18 @@ if(e_AJAX_REQUEST && isset($_GET['src'])) // Ajax
$localfile = md5($remotefile.time()).".zip";
$status = "Downloading...";
- e107::getFile()->getRemoteFile($remotefile,"temp/".$localfile);
+ e107::getFile()->getRemoteFile($remotefile,$localfile);
- if(!file_exists(e_UPLOAD.$localfile))
+ if(!file_exists(e_TEMP.$localfile))
{
echo 'There was a problem retrieving the file';
exit;
}
// chmod(e_PLUGIN,0777);
- chmod(e_UPLOAD.$localfile,0755);
+ chmod(e_TEMP.$localfile,0755);
require_once(e_HANDLER."pclzip.lib.php");
- $archive = new PclZip(e_UPLOAD.$localfile);
+ $archive = new PclZip(e_TEMP.$localfile);
$unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_PLUGIN, PCLZIP_OPT_SET_CHMOD, 0755));
// chmod(e_PLUGIN,0755);
$dir = basename($unarc[0]['filename']);
@@ -83,7 +83,7 @@ if(e_AJAX_REQUEST && isset($_GET['src'])) // Ajax
}
echo $status;
- @unlink(e_UPLOAD.$localfile);
+// @unlink(e_TEMP.$localfile);
// echo "file=".$file;
exit;
diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php
index 8e5033fbb..72fe70494 100644
--- a/e107_admin/update_routines.php
+++ b/e107_admin/update_routines.php
@@ -1052,7 +1052,10 @@ function update_706_to_800($type='')
{
mkdir(e_CACHE_URL,0755);
}
-
+ if(!is_dir(e_TEMP))
+ {
+ mkdir(e_TEMP,0755);
+ }
$root_media = str_replace(basename(e_MEDIA)."/","",e_MEDIA);
$user_media_dirs = array("images","avatars","files","temp","videos","icons");
diff --git a/e107_files/jslib/core/all.jquery.js b/e107_files/jslib/core/all.jquery.js
index ae36edc0c..be66d4b38 100644
--- a/e107_files/jslib/core/all.jquery.js
+++ b/e107_files/jslib/core/all.jquery.js
@@ -453,8 +453,8 @@ $(document).ready(function()
var target = $(this).attr("data-target"); // support for input buttons etc.
var loading = $(this).attr('data-loading'); // image to show loading.
var nav = $(this).attr('data-nav-inc');
-
- if(nav !== null)
+
+ if(nav != null)
{
eNav(this,'.e-ajax'); //modify data-src value for next/prev. 'from='
}
diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php
index 77f483a9e..ec99d092f 100644
--- a/e107_handlers/e107_class.php
+++ b/e107_handlers/e107_class.php
@@ -448,7 +448,7 @@ class e107
$ret['LOGS_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'logs/';
$ret['BACKUP_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'backup/';
-
+ $ret['TEMP_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'temp/';
//TODO create directories which don't exist.
return $ret;
@@ -2578,6 +2578,7 @@ class e107
define('e_LOG', $this->get_override_rel('LOGS'));
define('e_BACKUP', $this->get_override_rel('BACKUP'));
+ define('e_TEMP', $this->get_override_rel('TEMP'));
//
// HTTP absolute paths
diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php
index c7c2e8a9b..08a26d7dc 100644
--- a/e107_handlers/file_class.php
+++ b/e107_handlers/file_class.php
@@ -290,9 +290,11 @@ class e_file
}
// Grab a remote file and save it in the /temp directory. requires CURL
- function getRemoteFile($remote_url, $local_file)
+ function getRemoteFile($remote_url, $local_file, $type='temp')
{
- $fp = fopen(e_MEDIA.$local_file, 'w'); // media-directory is the root.
+ $path = ($type == 'media') ? e_MEDIA : e_TEMP;
+
+ $fp = fopen($path.$local_file, 'w'); // media-directory is the root.
$cp = curl_init($remote_url);
curl_setopt($cp, CURLOPT_FILE, $fp);
diff --git a/e107_plugins/import/admin_import.php b/e107_plugins/import/admin_import.php
index 38d72dae1..7f24971c6 100644
--- a/e107_plugins/import/admin_import.php
+++ b/e107_plugins/import/admin_import.php
@@ -319,7 +319,7 @@ function dbImport($mode='db')
}
else
{
- $mes->addError(LAN_CONVERT_42);
+ $mes->addError(LAN_CONVERT_42. "[".$current_db_type."]");
return false;
}
@@ -339,6 +339,13 @@ function dbImport($mode='db')
}
}
+ if(!is_array($db_import_blocks))
+ {
+ $mes->addError("No areas selected for import"); // db connect failed
+ return false;
+ }
+
+
foreach ($db_import_blocks as $k => $v)
{
@@ -408,6 +415,16 @@ function dbImport($mode='db')
array($loopCounter,$loopCounter-$errorCounter,$errorCounter, $k),LAN_CONVERT_47);
$mes->addSuccess($msg); // couldn't set query
}
+ else
+ {
+ $mes->addDebug("Error: _POST['import_block_{$k}'] = ".$_POST['import_block_{$k}']); // cou
+
+ }
+ }
+ else
+ {
+ $mes->addDebug("\$db_blocks_to_import doesn't contain key: ".$k); // cou
+
}
}
@@ -534,13 +551,17 @@ function showImportOptions($mode='csv')
{
$mes->addDebug("Class Available: ".$mode);
$proObj = new $mode;
+ if($proObj->init()===FALSE)
+ {
+ return;
+ }
}
$message = LAN_CONVERT_02."
".LAN_CONVERT_05."";
$emessage->add($message, E_MESSAGE_WARNING);
$text = "
-