12895 - change all adm/filemanager from another prestashop 1.6 to fix auto sizing images issue

This commit is contained in:
Rodney Figaro 2017-04-03 10:49:12 +02:00
parent 0c386225e2
commit 95fc898e6a
49 changed files with 4251 additions and 3407 deletions

1
adm/filemanager/LICENSE Normal file
View File

@ -0,0 +1 @@
This work is licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

View File

@ -2,32 +2,35 @@
include('config/config.php');
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager')
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('forbiden');
}
include('include/utils.php');
if (isset($_GET['action']))
switch ($_GET['action'])
{
if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'view':
if (isset($_GET['type']))
if (isset($_GET['type'])) {
$_SESSION['view_type'] = $_GET['type'];
else
} else {
die('view type number missing');
}
break;
case 'sort':
if (isset($_GET['sort_by']))
if (isset($_GET['sort_by'])) {
$_SESSION['sort_by'] = $_GET['sort_by'];
if (isset($_GET['descending']))
}
if (isset($_GET['descending'])) {
$_SESSION['descending'] = $_GET['descending'] === 'true';
}
break;
case 'image_size':
if (realpath(dirname(_PS_ROOT_DIR_.$_POST['path'])) != realpath(_PS_ROOT_DIR_.$upload_dir))
if (realpath(dirname(_PS_ROOT_DIR_.$_POST['path'])) != realpath(_PS_ROOT_DIR_.$upload_dir)) {
die();
}
$pos = strpos($_POST['path'], $upload_dir);
if ($pos !== false)
{
if ($pos !== false) {
$info = getimagesize(substr_replace($_POST['path'], $current_path, $pos, strlen($upload_dir)));
echo json_encode($info);
}
@ -41,21 +44,23 @@ if (isset($_GET['action']))
|| strpos($_POST['url'], 'http://featherfiles.aviary.com/') !== 0
|| $_POST['name'] != fix_filename($_POST['name'], $transliteration)
|| !in_array(strtolower($info['extension']), array('jpg', 'jpeg', 'png'))
)
) {
die('wrong data');
}
$image_data = get_file_by_url($_POST['url']);
if ($image_data === false)
{
if ($image_data === false) {
die('file could not be loaded');
}
$put_contents_path = $current_path;
if (isset($_POST['path']))
if (isset($_POST['path'])) {
$put_contents_path .= str_replace("\0", "", $_POST['path']);
}
if (isset($_POST['name']))
if (isset($_POST['name'])) {
$put_contents_path .= str_replace("\0", "", $_POST['name']);
}
file_put_contents($put_contents_path, $image_data);
//new thumb creation
@ -67,46 +72,40 @@ if (isset($_GET['action']))
}*/
break;
case 'extract':
if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0)
if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0) {
die('wrong path');
}
$path = $current_path.$_POST['path'];
$info = pathinfo($path);
$base_folder = $current_path.fix_dirname($_POST['path']).'/';
switch ($info['extension'])
{
switch ($info['extension']) {
case 'zip':
$zip = new ZipArchive;
if ($zip->open($path) === true)
{
if ($zip->open($path) === true) {
//make all the folders
for ($i = 0; $i < $zip->numFiles; $i++)
{
for ($i = 0; $i < $zip->numFiles; $i++) {
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if ($FullFileName['name'][strlen($FullFileName['name']) - 1] == '/')
{
if ($FullFileName['name'][strlen($FullFileName['name']) - 1] == '/') {
create_folder($base_folder.$FullFileName['name']);
}
}
//unzip into the folders
for ($i = 0; $i < $zip->numFiles; $i++)
{
for ($i = 0; $i < $zip->numFiles; $i++) {
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if (!($FullFileName['name'][strlen($FullFileName['name']) - 1] == '/'))
{
if (!($FullFileName['name'][strlen($FullFileName['name']) - 1] == '/')) {
$fileinfo = pathinfo($OnlyFileName);
if (in_array(strtolower($fileinfo['extension']), $ext))
{
if (in_array(strtolower($fileinfo['extension']), $ext)) {
copy('zip://'.$path.'#'.$OnlyFileName, $base_folder.$FullFileName['name']);
}
}
}
$zip->close();
}
else
} else {
echo 'failed to open file';
}
break;
case 'gz':
$p = new PharData($path);
@ -179,13 +178,12 @@ if (isset($_GET['action']))
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your
<a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
<a href="http://get.adobe.com/flashplayer/" class="_blank">Flash plugin</a>.
</div>
</div>
</div>
<?php
if (in_array(strtolower($info['extension']), $ext_music))
{
if (in_array(strtolower($info['extension']), $ext_music)) {
?>
<script type="text/javascript">
@ -194,11 +192,16 @@ if (isset($_GET['action']))
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
title: "<?php Tools::safeOutput($_GET['title']); ?>",
mp3: "<?php echo Tools::safeOutput($preview_file); ?>",
m4a: "<?php echo Tools::safeOutput($preview_file); ?>",
oga: "<?php echo Tools::safeOutput($preview_file); ?>",
wav: "<?php echo Tools::safeOutput($preview_file); ?>"
title: "<?php Tools::safeOutput($_GET['title']);
?>",
mp3: "<?php echo Tools::safeOutput($preview_file);
?>",
m4a: "<?php echo Tools::safeOutput($preview_file);
?>",
oga: "<?php echo Tools::safeOutput($preview_file);
?>",
wav: "<?php echo Tools::safeOutput($preview_file);
?>"
});
},
swfPath: "js",
@ -211,8 +214,8 @@ if (isset($_GET['action']))
</script>
<?php
} elseif (in_array(strtolower($info['extension']), $ext_video))
{
} elseif (in_array(strtolower($info['extension']), $ext_video)) {
?>
<script type="text/javascript">
@ -221,9 +224,12 @@ if (isset($_GET['action']))
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
title: "<?php Tools::safeOutput($_GET['title']); ?>",
m4v: "<?php echo Tools::safeOutput($preview_file); ?>",
ogv: "<?php echo Tools::safeOutput($preview_file); ?>"
title: "<?php Tools::safeOutput($_GET['title']);
?>",
m4v: "<?php echo Tools::safeOutput($preview_file);
?>",
ogv: "<?php echo Tools::safeOutput($preview_file);
?>"
});
},
swfPath: "js",
@ -237,9 +243,11 @@ if (isset($_GET['action']))
</script>
<?php
}
break;
}
else
} else {
die('no action passed');
}
?>

View File

@ -1,17 +1,23 @@
<?php
session_start();
mb_internal_encoding('UTF-8');
if (!defined('_PS_ADMIN_DIR_'))
define('_PS_ADMIN_DIR_', getcwd().'/../');
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', dirname(__FILE__).'/../../');
}
require_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require_once(_PS_ADMIN_DIR_.'/init.php');
if (function_exists('mb_internal_encoding')) {
mb_internal_encoding('UTF-8');
}
$products_accesses = Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminProducts'));
$cms_accesses = Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminCmsContent'));
if (!$products_accesses['edit'] && !$cms_accesses['edit'])
if (!$products_accesses['edit'] && !$cms_accesses['edit']) {
die(Tools::displayError());
}
//------------------------------------------------------------------------------
// DON'T COPY THIS VARIABLES IN FOLDERS config.php FILES
//------------------------------------------------------------------------------
@ -30,12 +36,13 @@ if (!$products_accesses['edit'] && !$cms_accesses['edit'])
// | | | |- responsivefilemanager
// | | | | |- plugin.min.js
$base_url="http://".$_SERVER['HTTP_HOST']; // DON'T TOUCH (base url (only domain) of site (without final /)).
$upload_dir = __PS_BASE_URI__.'img/cms/'; // path from base_url to base of upload folder (with start and final /)
$base_url = Tools::getHttpHost(true); // DON'T TOUCH (base url (only domain) of site (without final /)).
$base_url = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE') ? $base_url : str_replace('https', 'http', $base_url);
$upload_dir = Context::getContext()->shop->getBaseURI().'img/cms/'; // path from base_url to base of upload folder (with start and final /)
$current_path = _PS_ROOT_DIR_.'/img/cms/'; // relative path from filemanager folder to upload folder (with final /)
//thumbs folder can't put inside upload folder
$thumbs_base_path = _PS_ROOT_DIR_.'/img/tmp/cms/'; // relative path from filemanager folder to thumbs folder (with final /)
$thumbs_base_path = _PS_ROOT_DIR_.'/img/cms/'; // relative path from filemanager folder to thumbs folder (with final /)
//--------------------------------------------------------------------------------------------------------
// YOU CAN COPY AND CHANGE THESE VARIABLES INTO FOLDERS config.php FILES TO CUSTOMIZE EACH FOLDER OPTIONS
@ -97,10 +104,10 @@ $duplicate_files=true;
//Allowed extensions (lowercase insert)
//**********************
$ext_img = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg'); //Images
$ext_file = array('doc', 'docx','rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv','html','xhtml','psd','sql','log','fla','xml','ade','adp','mdb','accdb','ppt','pptx','odt','ots','ott','odb','odg','otp','otg','odf','ods','odp','css','ai'); //Files
$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg','wma',"flv","webm"); //Video
$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid','ogg','wav'); //Audio
$ext_misc = array('zip', 'rar','gz','tar','iso','dmg'); //Archives
$ext_file = array('pdf'); // array('doc', 'docx','rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv','html','xhtml','psd','sql','log','fla','xml','ade','adp','mdb','accdb','ppt','pptx','odt','ots','ott','odb','odg','otp','otg','odf','ods','odp','css','ai'); //Files
$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg', 'wma', 'flv', 'webm'); //Video
$ext_music = array();//array('mp3', 'm4a', 'ac3', 'aiff', 'mid','ogg','wav'); //Audio
$ext_misc = array();// array('zip', 'rar','gz','tar','iso','dmg'); //Archives
$ext=array_merge($ext_img, $ext_file, $ext_misc, $ext_video, $ext_music); //allowed extensions
@ -164,5 +171,3 @@ $relative_image_creation_name_to_prepend= array('','test_'); //name to prepend o
$relative_image_creation_name_to_append = array('_test',''); //name to append on filename
$relative_image_creation_width = array(300,400); //width of image (you can leave empty if you set height)
$relative_image_creation_height = array(200,''); //height of image (you can leave empty if you set width)
?>

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +1,50 @@
<?php
include('config/config.php');
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') die('forbiden');
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('forbiden');
}
include('include/utils.php');
$_POST['path_thumb'] = $thumbs_base_path.$_POST['path_thumb'];
if (!isset($_POST['path_thumb']) && trim($_POST['path_thumb']) == '')
if (!isset($_POST['path_thumb']) && trim($_POST['path_thumb']) == '') {
die('wrong path');
}
$thumb_pos = strpos($_POST['path_thumb'], $thumbs_base_path);
if ($thumb_pos === false
|| preg_match('/\.{1,2}[\/|\\\]/', $_POST['path_thumb']) !== 0
|| preg_match('/\.{1,2}[\/|\\\]/', $_POST['path']) !== 0
)
) {
die('wrong path');
}
$language_file = 'lang/en.php';
if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang'] != '')
{
if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang'] != '') {
$path_parts = pathinfo($_GET['lang']);
if (is_readable('lang/'.$path_parts['basename'].'.php'))
if (is_readable('lang/'.$path_parts['basename'].'.php')) {
$language_file = 'lang/'.$path_parts['basename'].'.php';
}
}
require_once $language_file;
$base = $current_path;
if (isset($_POST['path']))
if (isset($_POST['path'])) {
$path = $current_path.str_replace("\0", "", $_POST['path']);
else
} else {
$path = $current_path;
}
$cycle = true;
$max_cycles = 50;
$i = 0;
while ($cycle && $i < $max_cycles)
{
while ($cycle && $i < $max_cycles) {
$i++;
if ($path == $base) $cycle = false;
if ($path == $base) {
$cycle = false;
}
if (file_exists($path.'config.php'))
{
if (file_exists($path.'config.php')) {
require_once($path.'config.php');
$cycle = false;
}
@ -49,157 +54,154 @@ while ($cycle && $i < $max_cycles)
$path = $current_path.str_replace("\0", "", $_POST['path']);
$path_thumb = $_POST['path_thumb'];
if (isset($_POST['name']))
{
if (isset($_POST['name'])) {
$name = $_POST['name'];
if (preg_match('/\.{1,2}[\/|\\\]/', $name) !== 0) die('wrong name');
if (preg_match('/\.{1,2}[\/|\\\]/', $name) !== 0) {
die('wrong name');
}
}
$info = pathinfo($path);
if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action'] == 'delete_folder') && !in_array(strtolower($info['extension']), $ext))
if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action'] == 'delete_folder') && !in_array(strtolower($info['extension']), $ext)) {
die('wrong extension');
}
if (isset($_GET['action']))
{
switch ($_GET['action'])
{
if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'delete_file':
if ($delete_files)
{
if ($delete_files) {
unlink($path);
if (file_exists($path_thumb))
if (file_exists($path_thumb)) {
unlink($path_thumb);
}
$info = pathinfo($path);
if ($relative_image_creation)
{
foreach ($relative_path_from_current_pos as $k => $path)
{
if ($path != '' && $path[strlen($path) - 1] != '/')
if ($relative_image_creation) {
foreach ($relative_path_from_current_pos as $k => $path) {
if ($path != '' && $path[strlen($path) - 1] != '/') {
$path .= '/';
if (file_exists($info['dirname'].'/'.$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].'.'.$info['extension']))
}
if (file_exists($info['dirname'].'/'.$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].'.'.$info['extension'])) {
unlink($info['dirname'].'/'.$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].'.'.$info['extension']);
}
}
}
if ($fixed_image_creation)
{
foreach ($fixed_path_from_filemanager as $k => $path)
{
if ($path != '' && $path[strlen($path) - 1] != '/')
if ($fixed_image_creation) {
foreach ($fixed_path_from_filemanager as $k => $path) {
if ($path != '' && $path[strlen($path) - 1] != '/') {
$path .= '/';
}
$base_dir = $path.substr_replace($info['dirname'].'/', '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension']))
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension'])) {
unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension']);
}
}
}
}
break;
case 'delete_folder':
if ($delete_folders)
{
if (is_dir($path_thumb))
if ($delete_folders) {
if (is_dir($path_thumb)) {
deleteDir($path_thumb);
if (is_dir($path))
{
}
if (is_dir($path)) {
deleteDir($path);
if ($fixed_image_creation)
{
foreach ($fixed_path_from_filemanager as $k => $paths)
{
if ($paths != '' && $paths[strlen($paths) - 1] != '/') $paths .= '/';
if ($fixed_image_creation) {
foreach ($fixed_path_from_filemanager as $k => $paths) {
if ($paths != '' && $paths[strlen($paths) - 1] != '/') {
$paths .= '/';
}
$base_dir = $paths.substr_replace($path, '', 0, strlen($current_path));
if (is_dir($base_dir))
if (is_dir($base_dir)) {
deleteDir($base_dir);
}
}
}
}
}
break;
case 'create_folder':
if ($create_folders)
if ($create_folders) {
create_folder(fix_path($path, $transliteration), fix_path($path_thumb, $transliteration));
}
break;
case 'rename_folder':
if ($rename_folders)
{
if ($rename_folders) {
$name = fix_filename($name, $transliteration);
$name = str_replace('.', '', $name);
if (!empty($name))
{
if (!rename_folder($path, $name, $transliteration))
if (!empty($name)) {
if (!rename_folder($path, $name, $transliteration)) {
die(lang_Rename_existing_folder);
}
rename_folder($path_thumb, $name, $transliteration);
if ($fixed_image_creation)
{
foreach ($fixed_path_from_filemanager as $k => $paths)
{
if ($paths != '' && $paths[strlen($paths) - 1] != '/') $paths .= '/';
if ($fixed_image_creation) {
foreach ($fixed_path_from_filemanager as $k => $paths) {
if ($paths != '' && $paths[strlen($paths) - 1] != '/') {
$paths .= '/';
}
$base_dir = $paths.substr_replace($path, '', 0, strlen($current_path));
rename_folder($base_dir, $name, $transliteration);
}
}
} else
} else {
die(lang_Empty_name);
}
}
break;
case 'rename_file':
if ($rename_files)
{
if ($rename_files) {
$name = fix_filename($name, $transliteration);
if (!empty($name))
{
if (!rename_file($path, $name, $transliteration))
if (!empty($name)) {
if (!rename_file($path, $name, $transliteration)) {
die(lang_Rename_existing_file);
}
rename_file($path_thumb, $name, $transliteration);
if ($fixed_image_creation)
{
if ($fixed_image_creation) {
$info = pathinfo($path);
foreach ($fixed_path_from_filemanager as $k => $paths)
{
if ($paths != '' && $paths[strlen($paths) - 1] != '/') $paths .= '/';
foreach ($fixed_path_from_filemanager as $k => $paths) {
if ($paths != '' && $paths[strlen($paths) - 1] != '/') {
$paths .= '/';
}
$base_dir = $paths.substr_replace($info['dirname'].'/', '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension']))
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension'])) {
rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension'], $fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k], $transliteration);
}
}
} else
}
} else {
die(lang_Empty_name);
}
}
break;
case 'duplicate_file':
if ($duplicate_files)
{
if ($duplicate_files) {
$name = fix_filename($name, $transliteration);
if (!empty($name))
{
if (!duplicate_file($path, $name))
if (!empty($name)) {
if (!duplicate_file($path, $name)) {
die(lang_Rename_existing_file);
}
duplicate_file($path_thumb, $name);
if ($fixed_image_creation)
{
if ($fixed_image_creation) {
$info = pathinfo($path);
foreach ($fixed_path_from_filemanager as $k => $paths)
{
if ($paths != '' && $paths[strlen($paths) - 1] != '/') $paths .= '/';
foreach ($fixed_path_from_filemanager as $k => $paths) {
if ($paths != '' && $paths[strlen($paths) - 1] != '/') {
$paths .= '/';
}
$base_dir = $paths.substr_replace($info['dirname'].'/', '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension']))
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension'])) {
duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].'.'.$info['extension'], $fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
}
}
} else
}
} else {
die(lang_Empty_name);
}
}
break;
default:
die('wrong action');
break;
}
}
?>

View File

@ -1,20 +1,25 @@
<?php
include('config/config.php');
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') die('forbiden');
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('forbiden');
}
include('include/utils.php');
if (preg_match('/\.{1,2}[\/|\\\]/', $_POST['path']) !== 0)
if (preg_match('/\.{1,2}[\/|\\\]/', $_POST['path']) !== 0) {
die('wrong path');
}
if (strpos($_POST['name'], '/') !== false || strpos($_POST['name'], '\\') !== false)
if (strpos($_POST['name'], '/') !== false || strpos($_POST['name'], '\\') !== false) {
die('wrong path');
}
$path = $current_path.$_POST['path'];
$name = $_POST['name'];
$info = pathinfo($name);
if (!in_array(fix_strtolower($info['extension']), $ext))
if (!in_array(fix_strtolower($info['extension']), $ext)) {
die('wrong extension');
}
header('Pragma: private');
header('Cache-control: private, must-revalidate');
@ -24,4 +29,3 @@ header('Content-Disposition: attachment; filename="'.($name).'"');
readfile($path.$name);
exit;
?>

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +1,67 @@
<?php
if($_SESSION["verify"] != "RESPONSIVEfilemanager") die('forbiden');
if ($_SESSION["verify"] != "RESPONSIVEfilemanager") {
die('forbiden');
}
function deleteDir($dir) {
if (!file_exists($dir)) return true;
if (!is_dir($dir)) return unlink($dir);
function deleteDir($dir)
{
if (!file_exists($dir)) {
return true;
}
if (!is_dir($dir)) {
return unlink($dir);
}
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') continue;
if (!deleteDir($dir.DIRECTORY_SEPARATOR.$item)) return false;
if ($item == '.' || $item == '..') {
continue;
}
if (!deleteDir($dir.DIRECTORY_SEPARATOR.$item)) {
return false;
}
}
return rmdir($dir);
}
function duplicate_file($old_path,$name){
function duplicate_file($old_path, $name)
{
if (file_exists($old_path)) {
$info=pathinfo($old_path);
$new_path=$info['dirname']."/".$name.".".$info['extension'];
if(file_exists($new_path)) return false;
if (file_exists($new_path)) {
return false;
}
return copy($old_path, $new_path);
}
}
function rename_file($old_path,$name,$transliteration){
function rename_file($old_path, $name, $transliteration)
{
$name=fix_filename($name, $transliteration);
if (file_exists($old_path)) {
$info=pathinfo($old_path);
$new_path=$info['dirname']."/".$name.".".$info['extension'];
if(file_exists($new_path)) return false;
if (file_exists($new_path)) {
return false;
}
return rename($old_path, $new_path);
}
}
function rename_folder($old_path,$name,$transliteration){
function rename_folder($old_path, $name, $transliteration)
{
$name=fix_filename($name, $transliteration);
if (file_exists($old_path)) {
$new_path=fix_dirname($old_path)."/".$name;
if(file_exists($new_path)) return false;
if (file_exists($new_path)) {
return false;
}
return rename($old_path, $new_path);
}
}
function create_img_gd($imgfile, $imgthumb, $newwidth, $newheight="") {
function create_img_gd($imgfile, $imgthumb, $newwidth, $newheight="")
{
if (image_check_memory_usage($imgfile, $newwidth, $newheight)) {
require_once('php_image_magician.php');
$magicianObj = new imageLib($imgfile);
@ -51,7 +72,8 @@ function create_img_gd($imgfile, $imgthumb, $newwidth, $newheight="") {
return false;
}
function create_img($imgfile, $imgthumb, $newwidth, $newheight="") {
function create_img($imgfile, $imgthumb, $newwidth, $newheight="")
{
if (image_check_memory_usage($imgfile, $newwidth, $newheight)) {
require_once('php_image_magician.php');
$magicianObj = new imageLib($imgfile);
@ -63,7 +85,8 @@ function create_img($imgfile, $imgthumb, $newwidth, $newheight="") {
}
}
function makeSize($size) {
function makeSize($size)
{
$units = array('B','KB','MB','GB','TB');
$u = 0;
while ((round($size / 1024) > 0) && ($u < 4)) {
@ -73,7 +96,8 @@ function makeSize($size) {
return (number_format($size, 0) . " " . $units[$u]);
}
function foldersize($path) {
function foldersize($path)
{
$total_size = 0;
$files = scandir($path);
$cleanPath = rtrim($path, '/'). '/';
@ -84,8 +108,7 @@ function foldersize($path) {
if (is_dir($currentFile)) {
$size = foldersize($currentFile);
$total_size += $size;
}
else {
} else {
$size = filesize($currentFile);
$total_size += $size;
}
@ -95,20 +118,29 @@ function foldersize($path) {
return $total_size;
}
function create_folder($path=false,$path_thumbs=false){
function create_folder($path=false, $path_thumbs=false)
{
$oldumask = umask(0);
if ($path && !file_exists($path))
mkdir($path, 0777, true); // or even 01777 so you get the sticky bit set
if($path_thumbs && !file_exists($path_thumbs))
mkdir($path_thumbs, 0777, true) or die("$path_thumbs cannot be found"); // or even 01777 so you get the sticky bit set
if ($path && !file_exists($path)) {
mkdir($path, 0777, true);
} // or even 01777 so you get the sticky bit set
if ($path_thumbs && !file_exists($path_thumbs)) {
mkdir($path_thumbs, 0777, true) or die("$path_thumbs cannot be found");
} // or even 01777 so you get the sticky bit set
umask($oldumask);
}
function check_files_extensions_on_path($path,$ext){
function check_files_extensions_on_path($path, $ext)
{
if (!is_dir($path)) {
$fileinfo = pathinfo($path);
if(!in_array(mb_strtolower($fileinfo['extension']),$ext))
if (function_exists('mb_strtolower')) {
if (!in_array(mb_strtolower($fileinfo['extension']), $ext)) {
unlink($path);
} elseif (!in_array(Tools::strtolower($fileinfo['extension']), $ext)) {
unlink($path);
}
}
} else {
$files = scandir($path);
foreach ($files as $file) {
@ -117,32 +149,30 @@ function check_files_extensions_on_path($path,$ext){
}
}
function check_files_extensions_on_phar( $phar, &$files, $basepath, $ext ) {
foreach( $phar as $file )
{
if( $file->isFile() )
{
if(in_array(mb_strtolower($file->getExtension()),$ext))
function check_files_extensions_on_phar($phar, &$files, $basepath, $ext)
{
foreach ($phar as $file) {
if ($file->isFile()) {
if (function_exists('mb_strtolower')) {
if (in_array(mb_strtolower($file->getExtension()), $ext)) {
$files[] = $basepath.$file->getFileName();
} elseif (in_array(Tools::strtolower($file->getExtension()), $ext)) {
$files[] = $basepath.$file->getFileName();
}
}
else if( $file->isDir() )
{
} elseif ($file->isDir()) {
$iterator = new DirectoryIterator($file);
check_files_extensions_on_phar($iterator, $files, $basepath.$file->getFileName().'/', $ext);
}
}
}
function fix_filename($str,$transliteration){
function fix_filename($str, $transliteration)
{
if ($transliteration) {
if( function_exists( 'transliterator_transliterate' ) )
{
if (function_exists('transliterator_transliterate')) {
$str = transliterator_transliterate('Accents-Any', $str);
}
else
{
} else {
$str = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
}
@ -155,51 +185,59 @@ function fix_filename($str,$transliteration){
// Empty or incorrectly transliterated filename.
// Here is a point: a good file UNKNOWN_LANGUAGE.jpg could become .jpg in previous code.
// So we add that default 'file' name to fix that issue.
if( strpos( $str, '.' ) === 0 )
{
if (strpos($str, '.') === 0) {
$str = 'file'.$str;
}
return trim($str);
}
function fix_dirname($str){
function fix_dirname($str)
{
return str_replace('~', ' ', dirname(str_replace(' ', '~', $str)));
}
function fix_strtoupper($str){
if( function_exists( 'mb_strtoupper' ) )
function fix_strtoupper($str)
{
if (function_exists('mb_strtoupper')) {
return mb_strtoupper($str);
else
} else {
return strtoupper($str);
}
function fix_strtolower($str){
if( function_exists( 'mb_strtoupper' ) )
return mb_strtolower($str);
else
return strtolower($str);
}
function fix_path($path,$transliteration){
$info=pathinfo($path);
if (($s = strrpos($path, '/')) !== false) $s++;
if (($e = strrpos($path, '.') - $s) !== strlen($info['filename']))
function fix_strtolower($str)
{
if (function_exists('mb_strtoupper')) {
return mb_strtolower($str);
} else {
return strtolower($str);
}
}
function fix_path($path, $transliteration)
{
$info=pathinfo($path);
if (($s = strrpos($path, '/')) !== false) {
$s++;
}
if (($e = strrpos($path, '.') - $s) !== strlen($info['filename'])) {
$info['filename'] = substr($path, $s, $e);
$info['basename'] = substr($path, $s);
}
$tmp_path = $info['dirname'].DIRECTORY_SEPARATOR.$info['basename'];
$str=fix_filename($info['filename'], $transliteration);
if($tmp_path!="")
if ($tmp_path!="") {
return $tmp_path.DIRECTORY_SEPARATOR.$str;
else
} else {
return $str;
}
}
function base_url(){
function base_url()
{
return sprintf(
"%s://%s",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
@ -207,7 +245,8 @@ function base_url(){
);
}
function config_loading($current_path,$fld){
function config_loading($current_path, $fld)
{
if (file_exists($current_path.$fld.".config")) {
require_once($current_path.$fld.".config");
return true;
@ -221,7 +260,8 @@ function config_loading($current_path,$fld){
}
function image_check_memory_usage($img, $max_breedte, $max_hoogte){
function image_check_memory_usage($img, $max_breedte, $max_hoogte)
{
if (file_exists($img)) {
$K64 = 65536; // number of bytes in 64K
$memory_usage = memory_get_usage();
@ -254,37 +294,50 @@ function endsWith($haystack, $needle)
return $needle === "" || substr($haystack, -strlen($needle)) === $needle;
}
function new_thumbnails_creation($targetPath,$targetFile,$name,$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height){
function new_thumbnails_creation($targetPath, $targetFile, $name, $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height)
{
//create relative thumbs
$all_ok=true;
if ($relative_image_creation) {
foreach ($relative_path_from_current_pos as $k=>$path) {
if($path!="" && $path[strlen($path)-1]!="/") $path.="/";
if (!file_exists($targetPath.$path)) create_folder($targetPath.$path,false);
if ($path!="" && $path[strlen($path)-1]!="/") {
$path.="/";
}
if (!file_exists($targetPath.$path)) {
create_folder($targetPath.$path, false);
}
$info=pathinfo($name);
if(!endsWith($targetPath,$path))
if(!create_img($targetFile, $targetPath.$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'], $relative_image_creation_width[$k], $relative_image_creation_height[$k]))
if (!endsWith($targetPath, $path)) {
if (!create_img($targetFile, $targetPath.$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'], $relative_image_creation_width[$k], $relative_image_creation_height[$k])) {
$all_ok=false;
}
}
}
}
//create fixed thumbs
if ($fixed_image_creation) {
foreach ($fixed_path_from_filemanager as $k=>$path) {
if($path!="" && $path[strlen($path)-1]!="/") $path.="/";
if ($path!="" && $path[strlen($path)-1]!="/") {
$path.="/";
}
$base_dir=$path.substr_replace($targetPath, '', 0, strlen($current_path));
if (!file_exists($base_dir)) create_folder($base_dir,false);
if (!file_exists($base_dir)) {
create_folder($base_dir, false);
}
$info=pathinfo($name);
if(!create_img($targetFile, $base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'], $fixed_image_creation_width[$k], $fixed_image_creation_height[$k]))
if (!create_img($targetFile, $base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'], $fixed_image_creation_width[$k], $fixed_image_creation_height[$k])) {
$all_ok=false;
}
}
}
return $all_ok;
}
// Get a remote file, using whichever mechanism is enabled
function get_file_by_url($url) {
function get_file_by_url($url)
{
if (ini_get('allow_url_fopen')) {
return file_get_contents($url);
}
@ -303,5 +356,3 @@ function get_file_by_url($url) {
return $data;
}
?>

35
adm/filemanager/index.php Normal file
View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -55,4 +55,3 @@ define('lang_Extract','bura çıxart');
define('lang_File_info', 'fayl məlumatı');
define('lang_Edit_image', 'şəkli redaktə et');
define('lang_Duplicate', 'Dublikat');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'file info');
define('lang_Edit_image', 'edit image');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'file info');
define('lang_Edit_image', 'edit image');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -51,4 +51,3 @@ define('lang_OK','OK');
define('lang_Cancel', 'Zrušit');
define('lang_Sorting', 'řazení');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'file info');
define('lang_Edit_image', 'edit image');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,5 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'file info');
define('lang_Edit_image', 'edit image');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','Extraer aquí');
define('lang_File_info', 'Información');
define('lang_Edit_image', 'Editar imagen');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','استخراج در اینجا');
define('lang_File_info', 'اطلاعات فایل');
define('lang_Edit_image', 'ویرایش تصویر');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -34,11 +34,11 @@ define('lang_Rename_existing_file','Ce fichier existe déjà');
define('lang_Rename_existing_folder', 'Ce dossier existe déjà');
define('lang_Empty_name', 'Le nom est vide');
define('lang_Text_filter', 'texte de filtrage');
define('lang_Swipe_help','Swipe the name of file/folder to show options');
define('lang_Upload_base','Base upload');
define('lang_Upload_java','JAVA upload (big size files)');
define('lang_Upload_java_help',"If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall");
define('lang_Upload_base_help',"Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button.");
define('lang_Swipe_help', 'Glissez le nom du fichier/dossier pour afficher les options');
define('lang_Upload_base', 'Upload classique');
define('lang_Upload_java', 'JAVA upload (fichiers de grandes tailles)');
define('lang_Upload_java_help', "Si l'applet Java Applet ne charge pas 1. Assurez-vous que vous avez bien installé Java <a href='http://java.com/en/download/'>[download link]</a> 2. Assurez-vous que votre pare-feu ne bloque pas la connexion.");
define('lang_Upload_base_help', "Glisser & Déposer le(s) fichier(s) à l'intérieur de la zone ou cliquez dessus (pour les derniers navigateurs), sinon sélectionnez le fichier. Lorsque l'upload est terminé, cliquez sur le bouton revenir.");
define('lang_Type_dir', 'dir');
define('lang_Type', 'Type');
define('lang_Dimension', 'Dimension');
@ -55,4 +55,3 @@ define('lang_Extract','Extraire ici');
define('lang_File_info', 'Information');
define('lang_Edit_image', 'Editer l\'image');
define('lang_Duplicate', 'Dupliquer');
?>

View File

@ -55,5 +55,3 @@ define('lang_Extract','raspakiraj ovdje');
define('lang_File_info', 'informacije');
define('lang_Edit_image', 'uredi sliku');
define('lang_Duplicate', 'kopiraj');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','kibontás ide');
define('lang_File_info', 'fájl info');
define('lang_Edit_image', 'kép szerkesztése');
define('lang_Duplicate', 'Klónozás');
?>

View File

@ -55,5 +55,3 @@ define('lang_Extract','extract disini');
define('lang_File_info', 'info berkas');
define('lang_Edit_image', 'edit gambar');
define('lang_Duplicate', 'Duplikat');
?>

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -55,4 +55,3 @@ define('lang_Extract','estrai qui');
define('lang_File_info', 'informazioni file');
define('lang_Edit_image', 'modifica immagine');
define('lang_Duplicate', 'Duplica');
?>

View File

@ -55,5 +55,3 @@ define('lang_Extract','энд задла');
define('lang_File_info', 'файлын мэдээлэл');
define('lang_Edit_image', 'зураг засварлах');
define('lang_Duplicate', 'Давхардуулах');
?>

View File

@ -55,5 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'Fil-info');
define('lang_Edit_image', 'Rediger bilde');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','hier uitpakken');
define('lang_File_info', 'bestands-info');
define('lang_Edit_image', 'afbeelding bewerken');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'file info');
define('lang_Edit_image', 'edit image');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'file info');
define('lang_Edit_image', 'edit image');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','Распаковать здесь');
define('lang_File_info', 'Свойства файла');
define('lang_Edit_image', 'Редактировать');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -55,5 +55,3 @@ define('lang_Extract','packa upp här'); // extract here
define('lang_File_info', 'fil information'); // file info
define('lang_Edit_image', 'editera bild'); // edit image
define('lang_Duplicate', 'Duplicera'); // Duplicate
?>

View File

@ -13,14 +13,14 @@ define('lang_Upload_file','Súbor');
define('lang_Filters', 'Filtrovať');
define('lang_Videos', 'Videá');
define('lang_Music', 'Hudba');
define('lang_New_Folder','Adresár');
define('lang_Folder_Created','Adresár bol vytvorený');
define('lang_Existing_Folder','Adresár už existuje');
define('lang_Confirm_Folder_del','Naozaj chcete vymazať adresár a odstrániť tak všetky súbory v ňom?');
define('lang_New_Folder', 'Priečinok');
define('lang_Folder_Created', 'Priečinok bol vytvorený');
define('lang_Existing_Folder', 'Priečinok už existuje');
define('lang_Confirm_Folder_del', 'Naozaj chcete vymazať priečinok a odstrániť tak všetky súbory v ňom?');
define('lang_Return_Files_List', 'Späť na zoznam súborov');
define('lang_Preview', 'Náhľad');
define('lang_Download','Stiahnuť');
define('lang_Insert_Folder_Name','Názov adresára:');
define('lang_Download', 'Prevziať');
define('lang_Insert_Folder_Name', 'Názov priečinku:');
define('lang_Root', 'root');
define('lang_Rename', 'Premenovať');
define('lang_Back', 'späť');
@ -31,13 +31,13 @@ define('lang_View_boxes','Ikony');
define('lang_Toolbar', 'Nástroje');
define('lang_Actions', 'Pridať');
define('lang_Rename_existing_file', 'Súbor už existuje');
define('lang_Rename_existing_folder','Adresár už existuje');
define('lang_Rename_existing_folder', 'Priečinok už existuje');
define('lang_Empty_name', 'Názov je prázdny');
define('lang_Text_filter', 'Vyhľadať');
define('lang_Swipe_help','Pre viac možností prejdite myšou na súboru/adresár');
define('lang_Swipe_help', 'Pre viac možností prejdite myšou na súboru/priečinok');
define('lang_Upload_base', 'Klasické nahratie súborov');
define('lang_Upload_java', 'Nahrať súbory cez JAVA (veľké súbory)');
define('lang_Upload_java_help',"Ak sa vám nezobrazí Java Applet, 1. uistite sa, že máte nainštalovanú Java, (<a href='http://java.com/en/download/'>[stiahnuť]</a>) 2. uistite sa, že nie je zablokovaná cez Firewall");
define('lang_Upload_java_help', "Ak sa vám nezobrazí Java Applet, 1. uistite sa, že máte nainštalovanú Javu, (<a href='http://java.com/en/download/'>[prevziať]</a>) 2. uistite sa, že nie je zablokovaná cez Firewall");
define('lang_Upload_base_help', "Myšou presuňte súbory alebo kliknite na určenú plochu a vyberte súbory. Keď je nahrávanie dokončené, kliknite na tlačidlo 'Späť na zoznam súborov'.");
define('lang_Type_dir', 'dir');
define('lang_Type', 'Typ');
@ -50,10 +50,8 @@ define('lang_Date_type','d.m.Y');
define('lang_OK', 'OK');
define('lang_Cancel', 'Zrušiť');
define('lang_Sorting', 'Zoradiť');
define('lang_Show_url','Zobratiť URL');
define('lang_Show_url', 'Zobraziť URL');
define('lang_Extract', 'Rozbaliť sem');
define('lang_File_info', 'Informácie o súbore');
define('lang_Edit_image', 'Upraviť obrázok');
define('lang_Duplicate','Duplicate');
?>
define('lang_Duplicate', 'Duplikovať');

View File

@ -55,4 +55,3 @@ define('lang_Extract','buraya çıkart');
define('lang_File_info', 'dosya bilgisi');
define('lang_Edit_image', 'resmi düzenle');
define('lang_Duplicate', 'Çoğalt');
?>

View File

@ -55,4 +55,3 @@ define('lang_Extract','extract here');
define('lang_File_info', 'file info');
define('lang_Edit_image', 'edit image');
define('lang_Duplicate', 'Duplicate');
?>

View File

@ -6,4 +6,4 @@
*
* Contributing: https://github.com/trippo/ResponsiveFilemanager
*/
tinymce.PluginManager.add("filemanager",function(e){function t(t,n,r,i){urltype=2;if(r=="image"){urltype=1}if(r=="media"){urltype=3}var s="RESPONSIVE FileManager";if(typeof e.settings.filemanager_title!=="undefined"&&e.settings.filemanager_title)s=e.settings.filemanager_title;var o="";var u="false";if(typeof e.settings.filemanager_sort_by!=="undefined"&&e.settings.filemanager_sort_by)o=e.settings.filemanager_sort_by;if(typeof e.settings.filemanager_descending!=="undefined"&&e.settings.filemanager_descending)u=e.settings.filemanager_descending;tinymce.activeEditor.windowManager.open({title:s,file:e.settings.external_filemanager_path+"dialog.php?type="+urltype+"&descending="+u+"&sort_by="+o+"&lang="+e.settings.language,width:860,height:570,resizable:true,maximizable:true,inline:1},{setUrl:function(n){var r=i.document.getElementById(t);r.value=e.convertURL(n);if("fireEvent"in r){r.fireEvent("onchange")}else{var s=document.createEvent("HTMLEvents");s.initEvent("change",false,true);r.dispatchEvent(s)}}})}tinymce.activeEditor.settings.file_browser_callback=t;return false})
tinymce.PluginManager.add("filemanager",function(e){function t(t,n,r,i){urltype=2;if(r=="image"){urltype=1}if(r=="media"){urltype=3}var s="RESPONSIVE FileManager";if(typeof e.settings.filemanager_title!=="undefined"&&e.settings.filemanager_title)s=e.settings.filemanager_title;var o="";var u="false";if(typeof e.settings.filemanager_sort_by!=="undefined"&&e.settings.filemanager_sort_by)o=e.settings.filemanager_sort_by;if(typeof e.settings.filemanager_descending!=="undefined"&&e.settings.filemanager_descending)u=e.settings.filemanager_descending;tinymce.activeEditor.windowManager.open({title:s,file:e.settings.external_filemanager_path.replace(/\/\/filemanager/, '\/filemanager')+"dialog.php?type="+urltype+"&descending="+u+"&sort_by="+o+"&lang="+e.settings.language,width:860,height:570,resizable:true,maximizable:true,inline:1},{setUrl:function(n){var r=i.document.getElementById(t);r.value=e.convertURL(n);if("fireEvent"in r){r.fireEvent("onchange")}else{var s=document.createEvent("HTMLEvents");s.initEvent("change",false,true);r.dispatchEvent(s)}}})}tinymce.activeEditor.settings.file_browser_callback=t;return false})

View File

@ -1,10 +1,12 @@
<?php
include('config/config.php');
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') die('forbiden');
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('forbiden');
}
include('include/utils.php');
$_POST['path'] = $current_path.$_POST['path'];
$_POST['path_thumb'] = $thumbs_base_path.$_POST['path_thumb'];
$_POST['path'] = $current_path.str_replace('\0', '', $_POST['path']);
$_POST['path_thumb'] = $thumbs_base_path.str_replace("\0", '', $_POST['path_thumb']);
$storeFolder = $_POST['path'];
$storeFolderThumb = $_POST['path_thumb'];
@ -14,30 +16,29 @@ $thumb_pos = strpos($_POST['path_thumb'], $thumbs_base_path);
if ($path_pos === false || $thumb_pos === false
|| preg_match('/\.{1,2}[\/|\\\]/', $_POST['path_thumb']) !== 0
|| preg_match('/\.{1,2}[\/|\\\]/', $_POST['path']) !== 0)
|| preg_match('/\.{1,2}[\/|\\\]/', $_POST['path']) !== 0) {
die('wrong path');
}
$path = $storeFolder;
$cycle = true;
$max_cycles = 50;
$i = 0;
while ($cycle && $i < $max_cycles)
{
while ($cycle && $i < $max_cycles) {
$i++;
if ($path == $current_path) $cycle = false;
if (file_exists($path.'config.php'))
{
if ($path == $current_path) {
$cycle = false;
}
if (file_exists($path.'config.php')) {
require_once($path.'config.php');
$cycle = false;
}
$path = fix_dirname($path).'/';
}
if (!empty($_FILES))
{
if (!empty($_FILES)) {
$info = pathinfo($_FILES['file']['name']);
if (isset($info['extension']) && in_array(fix_strtolower($info['extension']), $ext))
{
if (isset($info['extension']) && in_array(fix_strtolower($info['extension']), $ext)) {
$tempFile = $_FILES['file']['tmp_name'];
$targetPath = $storeFolder;
@ -48,12 +49,10 @@ if (!empty($_FILES))
array_pop($file_name_splitted);
$_FILES['file']['name'] = implode('-', $file_name_splitted).'.'.$info['extension'];
if (file_exists($targetPath.$_FILES['file']['name']))
{
if (file_exists($targetPath.$_FILES['file']['name'])) {
$i = 1;
$info = pathinfo($_FILES['file']['name']);
while (file_exists($targetPath.$info['filename'].'_'.$i.'.'.$info['extension']))
{
while (file_exists($targetPath.$info['filename'].'_'.$i.'.'.$info['extension'])) {
$i++;
}
$_FILES['file']['name'] = $info['filename'].'_'.$i.'.'.$info['extension'];
@ -61,98 +60,78 @@ if (!empty($_FILES))
$targetFile = $targetPath.$_FILES['file']['name'];
$targetFileThumb = $targetPathThumb.$_FILES['file']['name'];
/************ FIX UPLOAD NO-IMAGE FILES **************/
if (in_array(fix_strtolower($info['extension']), $ext_img) && @getimagesize($tempFile) != false)
if (in_array(fix_strtolower($info['extension']), $ext_img) && @getimagesize($tempFile) != false) {
$is_img = true;
elseif (in_array(fix_strtolower($info['extension']), $ext_file))
{
} else {
$is_img = false;
$is_file = true;
}
else
{
$is_img = false;
$is_file = false;
}
if ($is_file) {
move_uploaded_file($tempFile, $targetFile);
chmod($targetFile, 0755);
$memory_error = false;
}
elseif ($is_img)
/******************* END FIX **********************/
{
if ($is_img) {
move_uploaded_file($tempFile, $targetFile);
chmod($targetFile, 0755);
$memory_error = false;
if (!create_img_gd($targetFile, $targetFileThumb, 122, 91))
if (!create_img_gd($targetFile, $targetFileThumb, 122, 91)) {
$memory_error = false;
else
{
if (!new_thumbnails_creation($targetPath, $targetFile, $_FILES['file']['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height))
} else {
if (!new_thumbnails_creation($targetPath, $targetFile, $_FILES['file']['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height)) {
$memory_error = false;
else
{
} else {
$imginfo = getimagesize($targetFile);
$srcWidth = $imginfo[0];
$srcHeight = $imginfo[1];
if ($image_resizing)
{
if ($image_resizing_width == 0)
{
if ($image_resizing_height == 0)
{
if ($image_resizing) {
if ($image_resizing_width == 0) {
if ($image_resizing_height == 0) {
$image_resizing_width = $srcWidth;
$image_resizing_height = $srcHeight;
} else
} else {
$image_resizing_width = $image_resizing_height * $srcWidth / $srcHeight;
} elseif ($image_resizing_height == 0)
}
} elseif ($image_resizing_height == 0) {
$image_resizing_height = $image_resizing_width * $srcHeight / $srcWidth;
}
$srcWidth = $image_resizing_width;
$srcHeight = $image_resizing_height;
create_img_gd($targetFile, $targetFile, $image_resizing_width, $image_resizing_height);
}
//max resizing limit control
$resize = false;
if ($image_max_width != 0 && $srcWidth > $image_max_width)
{
if ($image_max_width != 0 && $srcWidth > $image_max_width) {
$resize = true;
$srcHeight = $image_max_width * $srcHeight / $srcWidth;
$srcWidth = $image_max_width;
}
if ($image_max_height != 0 && $srcHeight > $image_max_height)
{
if ($image_max_height != 0 && $srcHeight > $image_max_height) {
$resize = true;
$srcWidth = $image_max_height * $srcWidth / $srcHeight;
$srcHeight = $image_max_height;
}
if ($resize)
if ($resize) {
create_img_gd($targetFile, $targetFile, $srcWidth, $srcHeight);
}
}
if ($memory_error)
{
}
if ($memory_error) {
//error
unlink($targetFile);
header('HTTP/1.1 406 Not enought Memory', true, 406);
exit();
}
} else {
move_uploaded_file($tempFile, $targetFile);
chmod($targetFile, 0755);
}
} else
{
} else {
header('HTTP/1.1 406 file not permitted', true, 406);
exit();
}
} else
{
} else {
header('HTTP/1.1 405 Bad Request', true, 405);
exit();
}
if (isset($_POST['submit']))
{
if (isset($_POST['submit'])) {
$query = http_build_query(
array(
'type' => $_POST['type'],
@ -164,5 +143,3 @@ if (isset($_POST['submit']))
);
header('location: dialog.php?'.$query);
}
?>

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;