// Merge -> revision 8800
This commit is contained in:
+8
-8
@@ -621,7 +621,7 @@ if (Tools::isSubmit('saveHook'))
|
||||
foreach ($hookedModules as $module)
|
||||
{
|
||||
$ids = explode('_', $module);
|
||||
$value .= '('.$ids[1].', '.$id_shop.', (SELECT id_hook FROM '._DB_PREFIX_.'hook WHERE `name` = \''.pSQL($hook).'\' LIMIT 1), '.$i.'),';
|
||||
$value .= '('.(int)$ids[1].', '.$id_shop.', (SELECT id_hook FROM '._DB_PREFIX_.'hook WHERE `name` = \''.pSQL($hook).'\' LIMIT 1), '.(int)$i.'),';
|
||||
$i++;
|
||||
}
|
||||
$value = rtrim($value, ',');
|
||||
@@ -730,12 +730,12 @@ if (Tools::isSubmit('syncImapMail'))
|
||||
OR !$user = Configuration::get('PS_SAV_IMAP_USER')
|
||||
OR !$password = Configuration::get('PS_SAV_IMAP_PWD'))
|
||||
die('{"hasError" : true, "errors" : ["Configuration is not correct"]}');
|
||||
|
||||
|
||||
if (!function_exists('imap_open'))
|
||||
die('{"hasError" : true, "errors" : ["imap is not installed on this server"]}');
|
||||
|
||||
|
||||
$mbox = @imap_open('{'.$url.':'.$port.'}', $user, $password);
|
||||
|
||||
|
||||
//checks if there is no error when connecting imap server
|
||||
$errors = imap_errors();
|
||||
$str_errors = '';
|
||||
@@ -747,16 +747,16 @@ if (Tools::isSubmit('syncImapMail'))
|
||||
$str_errors .= '"'.$error.'",';
|
||||
$str_errors = rtrim($str_errors, ',').'';
|
||||
}
|
||||
|
||||
|
||||
//checks if imap connexion is active
|
||||
if (!$mbox)
|
||||
die('{"hasError" : true, "errors" : ["Cannot connect to the mailbox"]}');
|
||||
|
||||
|
||||
//Returns information about the current mailbox. Returns FALSE on failure.
|
||||
$check = imap_check($mbox);
|
||||
if ($check)
|
||||
die('{"hasError" : true, "errors" : ["Fail to get information about the current mailbox"]}');
|
||||
|
||||
|
||||
if ($check->Nmsgs == 0)
|
||||
die('{"hasError" : true, "errors" : ["NO message to sync"]}');
|
||||
|
||||
@@ -768,7 +768,7 @@ if (Tools::isSubmit('syncImapMail'))
|
||||
$subject = $overview->subject;
|
||||
else
|
||||
$subject = '';
|
||||
|
||||
|
||||
//Creating an md5 to check if message has been allready processed
|
||||
$md5 = md5($overview->date.$overview->from.$subject.$overview->msgno);
|
||||
$exist = Db::getInstance()->getValue(
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
@ob_start();
|
||||
displayArray($_POST);
|
||||
$safe_post = array();
|
||||
foreach ($_POST AS $key => $value)
|
||||
$safe_post[Tools::safeOutput($key)] = Tools::safeOutput($value);
|
||||
displayArray($safe_post);
|
||||
writeInfo(@ob_get_clean());
|
||||
echo "{";
|
||||
$error = "";
|
||||
@@ -72,4 +75,4 @@
|
||||
echo "error:'" . $error . "'";
|
||||
echo $info;
|
||||
echo "}";
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<fieldset id="modes">
|
||||
<legend>Modes</legend>
|
||||
<form name="formAction" id="formAction" method="post" action="<?php echo appendQueryString(CONFIG_URL_IMAGE_UNDO, makeQueryString(array('path'))); ?>">
|
||||
<input type="hidden" name="file_path" id="file_path" value="<?php echo $_GET['path']; ?>" />
|
||||
<input type="hidden" name="file_path" id="file_path" value="<?php echo Tools::safeOutput($_GET['path']); ?>" />
|
||||
|
||||
<p><label><?php echo IMG_MODE_RESIZE; ?></label> <input type="radio" name="mode" value="resize" class="input" checked="checked" onclick="return changeMode();"/>
|
||||
<label><?php echo IMG_MODE_CROP; ?></label> <input type="radio" name="mode" value="crop" class="input" onclick="return changeMode();" />
|
||||
@@ -131,7 +131,7 @@
|
||||
<p><input type="hidden" name="mode" id="image_mode" value="" />
|
||||
<input type="hidden" name="new_name" id="hidden_new_name" value="" />
|
||||
<input type="hidden" name="save_to" id="hidden_save_to" value="" />
|
||||
<input type="hidden" name="path" id="path" value="<?php echo $_GET['path']; ?>" />
|
||||
<input type="hidden" name="path" id="path" value="<?php echo Tools::safeOutput($_GET['path']); ?>" />
|
||||
<input type="hidden" name="flip_angle" id="flip_angle" value="" />
|
||||
<label><?php echo IMG_LBL_WIDTH; ?></label> <input type="text" name="width" id="width" value="" class="input imageInput" />
|
||||
<label><?php echo IMG_LBL_HEIGHT; ?></label> <input type="text" name="height" id="height" value="" class="input imageInput" />
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>-->
|
||||
<script type="text/javascript">
|
||||
var globalSettings = {'upload_init':false};
|
||||
var queryString = '<?php echo makeQueryString(array('path')); ?>';
|
||||
var queryString = '<?php echo Tools::safeOutput(makeQueryString(array('path'))); ?>';
|
||||
var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'};
|
||||
var parentFolder = {};
|
||||
var urls = {
|
||||
@@ -90,7 +90,7 @@
|
||||
'text_editor':'<?php echo CONFIG_URL_TEXT_EDITOR; ?>',
|
||||
'image_editor':'<?php echo CONFIG_URL_IMAGE_EDITOR; ?>',
|
||||
'download':'<?php echo CONFIG_URL_DOWNLOAD; ?>',
|
||||
'present':'<?php echo getCurrentUrl(); ?>',
|
||||
'present':'<?php echo Tools::safeOutput(getCurrentUrl()); ?>',
|
||||
'home':'<?php echo CONFIG_URL_HOME; ?>',
|
||||
'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>'
|
||||
};
|
||||
@@ -131,7 +131,7 @@
|
||||
var searchRequired = false;
|
||||
var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>';
|
||||
var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>'
|
||||
var elementId = <?php echo (!empty($_GET['elementId'])?"'" . $_GET['elementId'] . "'":'null'); ?>;
|
||||
var elementId = <?php echo (!empty($_GET['elementId'])?"'" . Tools::safeOutput($_GET['elementId']) . "'":'null'); ?>;
|
||||
var files = {};
|
||||
$(document).ready(
|
||||
function()
|
||||
@@ -464,9 +464,9 @@ $(document).ready(
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo LBL_SEARCH_MTIME; ?></b><br />
|
||||
<input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" />
|
||||
<input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?Tools::safeOutput($_GET['search_mtime_from']):''); ?>" />
|
||||
<span class="leftToRightArrow"> </span>
|
||||
<input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to'])?$_GET['search_mtime_to']:''); ?>" />
|
||||
<input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to'])?Tools::safeOutput($_GET['search_mtime_to']):''); ?>" />
|
||||
</td></tr>
|
||||
|
||||
<tr>
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ if ((empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')
|
||||
$errors[] = translate('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).').'<br/>';
|
||||
else
|
||||
$warningSslMessage = translate('SSL is activated. Please connect using the following url to log in in secure mode (https).')
|
||||
.'<br/><br/><a href="https://'.Tools::getServerName().$_SERVER['REQUEST_URI'].'">https://'.Tools::getServerName().$_SERVER['REQUEST_URI'].'</a>';
|
||||
.'<br/><br/><a href="https://'.Tools::getServerName().Tools::safeOutput($_SERVER['REQUEST_URI']).'">https://'.Tools::getServerName().Tools::safeOutput($_SERVER['REQUEST_URI']).'</a>';
|
||||
}
|
||||
|
||||
$iso = strtolower(Context::getContext()->language->iso_code);
|
||||
|
||||
@@ -215,7 +215,7 @@ class AdminAddresses extends AdminTab
|
||||
WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').(($this->deleted OR $this->table == 'currency') ? 'AND a.`deleted` = 0 ' : '').$this->_filter.'
|
||||
'.(isset($this->_group) ? $this->_group.' ' : '').'
|
||||
'.(isset($this->addressType) ? 'AND a.id_'.strval($this->addressType).' != 0' : '').'
|
||||
ORDER BY '.(($orderBy == 'id_'.$this->table) ? 'a.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).'
|
||||
ORDER BY '.(($orderBy == 'id_'.$this->table) ? 'a.' : '').'`'.bqSQL($orderBy).'` '.bqSQL($orderWay).'
|
||||
LIMIT '.(int)($start).','.(int)($limit));
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class AdminAttributes extends AdminTab
|
||||
<label>'.$this->l('Current texture:').' </label>
|
||||
<div class="margin-form">
|
||||
<p>'.(file_exists(_PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg')
|
||||
? '<img src="../img/'.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg" alt="" title="" /> <a href="'.$_SERVER['REQUEST_URI'].'&deleteImage=1"><img src="../img/admin/delete.gif" alt="'.$this->l('delete').'" title="" /></a>'
|
||||
? '<img src="../img/'.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg" alt="" title="" /> <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&deleteImage=1"><img src="../img/admin/delete.gif" alt="'.$this->l('delete').'" title="" /></a>'
|
||||
: $this->l('None')
|
||||
).'</p>
|
||||
</div>
|
||||
|
||||
@@ -114,7 +114,7 @@ class AdminDb extends AdminPreferences
|
||||
if ($engineType == $tables_engine[$table])
|
||||
$this->_errors[] = $table.' '.$this->l('is already in').' '.$engineType;
|
||||
else
|
||||
if (!Db::getInstance()->Execute('ALTER TABLE '.pSQL($table).' ENGINE='.pSQL($engineType)))
|
||||
if (!Db::getInstance()->Execute('ALTER TABLE `'.bqSQL($table).'` ENGINE=`'.bqSQL($engineType).'`'))
|
||||
$this->_errors[] = $this->l('Can\'t change engine for').' '.$table;
|
||||
else
|
||||
echo '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" />'.$this->l('Engine change of').' '.$table.' '.$this->l('to').' '.$engineType.'</div>';
|
||||
|
||||
@@ -891,7 +891,7 @@ class AdminOrders extends AdminTab
|
||||
$slips = OrderSlip::getOrdersSlip($order->id_customer, $order->id);
|
||||
echo '
|
||||
<div style="float: left">
|
||||
<form action="'.$_SERVER['REQUEST_URI'].'&token='.$this->token.'" method="post" onsubmit="if (getE(\'visibility\').checked == true) return confirm(\''.$this->l('Do you want to send this message to the customer?', __CLASS__, true, false).'\');">
|
||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&token='.$this->token.'" method="post" onsubmit="if (getE(\'visibility\').checked == true) return confirm(\''.$this->l('Do you want to send this message to the customer?', __CLASS__, true, false).'\');">
|
||||
<fieldset style="width: 400px;">
|
||||
<legend style="cursor: pointer;" onclick="$(\'#message\').slideToggle();$(\'#message_m\').slideToggle();return false"><img src="../img/admin/email_edit.gif" /> '.$this->l('New message').'</legend>
|
||||
<div id="message_m" style="display: '.(Tools::getValue('message') ? 'none' : 'block').'; overflow: auto; width: 400px;">
|
||||
@@ -926,7 +926,7 @@ class AdminOrders extends AdminTab
|
||||
{
|
||||
echo '<div style="overflow:auto; width:400px;" '.($message['is_new_for_me'] ?'class="new_message"':'').'>';
|
||||
if ($message['is_new_for_me'])
|
||||
echo '<a class="new_message" title="'.$this->l('Mark this message as \'viewed\'').'" href="'.$_SERVER['REQUEST_URI'].'&token='.$this->token.'&messageReaded='.(int)($message['id_message']).'"><img src="../img/admin/enabled.gif" alt="" /></a>';
|
||||
echo '<a class="new_message" title="'.$this->l('Mark this message as \'viewed\'').'" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&token='.$this->token.'&messageReaded='.(int)($message['id_message']).'"><img src="../img/admin/enabled.gif" alt="" /></a>';
|
||||
echo $this->l('At').' <i>'.Tools::displayDate($message['date_add'], $this->context->language->id, true);
|
||||
echo '</i> '.$this->l('from').' <b>'.(($message['elastname']) ? ($message['efirstname'].' '.$message['elastname']) : ($message['cfirstname'].' '.$message['clastname'])).'</b>';
|
||||
echo ((int)($message['private']) == 1 ? '<span style="color:red; font-weight:bold;">'.$this->l('Private:').'</span>' : '');
|
||||
|
||||
@@ -40,7 +40,7 @@ class AdminPreferences extends AdminTab
|
||||
$taxes[] = array('id' => 0, 'name' => $this->l('None'));
|
||||
foreach (Tax::getTaxes($this->context->language->id) as $tax)
|
||||
$taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']);
|
||||
|
||||
|
||||
$order_process_type = array(
|
||||
array(
|
||||
'value' => PS_ORDER_PROCESS_STANDARD,
|
||||
@@ -51,7 +51,7 @@ class AdminPreferences extends AdminTab
|
||||
'name' => $this->l('One page checkout')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$round_mode = array(
|
||||
array(
|
||||
'value' => PS_ROUND_UP,
|
||||
@@ -66,7 +66,7 @@ class AdminPreferences extends AdminTab
|
||||
'name' => $this->l('classical')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$cms_tab = array(0 =>
|
||||
array(
|
||||
'id' => 0,
|
||||
@@ -75,7 +75,7 @@ class AdminPreferences extends AdminTab
|
||||
);
|
||||
foreach (CMS::listCms($this->context->language->id) as $cms_file)
|
||||
$cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
|
||||
|
||||
|
||||
$fields = array(
|
||||
'PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''),
|
||||
@@ -103,17 +103,17 @@ class AdminPreferences extends AdminTab
|
||||
'PS_SHOW_NEW_CUSTOMERS' => array('title' => $this->l('Show notifications for new customers'), 'desc' => $this->l('This will display notifications when new customers will register on your shop'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_SHOW_NEW_MESSAGES' => array('title' => $this->l('Show notifications for new messages'), 'desc' => $this->l('This will display notifications when new messages will be posted on your shop'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
);
|
||||
|
||||
|
||||
if (function_exists('date_default_timezone_set'))
|
||||
$fields['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name', 'visibility' => Shop::CONTEXT_ALL);
|
||||
|
||||
|
||||
// No HTTPS activation if you haven't already.
|
||||
if (!Tools::usingSecureMode())
|
||||
{
|
||||
$fields['PS_SSL_ENABLED']['type'] = 'disabled';
|
||||
$fields['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools::getShopDomainSsl().$_SERVER['REQUEST_URI'].'">'.$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>';
|
||||
$fields['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools::getShopDomainSsl().Tools::safeOutput($_SERVER['REQUEST_URI']).'">'.$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>';
|
||||
}
|
||||
|
||||
|
||||
$this->optionsList = array(
|
||||
'general' => array(
|
||||
'title' => $this->l('General'),
|
||||
@@ -171,7 +171,7 @@ class AdminPreferences extends AdminTab
|
||||
$uploadMaxSize = (int)str_replace('M', '',ini_get('upload_max_filesize'));
|
||||
$postMaxSize = (int)str_replace('M', '', ini_get('post_max_size'));
|
||||
$maxSize = $uploadMaxSize < $postMaxSize ? $uploadMaxSize : $postMaxSize;
|
||||
|
||||
|
||||
Configuration::update('PS_ATTACHMENT_MAXIMUM_SIZE', ($maxSize < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE')) ? $maxSize : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE'));
|
||||
}
|
||||
|
||||
@@ -183,14 +183,14 @@ class AdminPreferences extends AdminTab
|
||||
echo '<script type="text/javascript">
|
||||
function addRemoteAddr()
|
||||
{
|
||||
var length = $(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\').length;
|
||||
var length = $(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\').length;
|
||||
if (length > 0)
|
||||
$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\') +\','.Tools::getRemoteAddr().'\');
|
||||
else
|
||||
$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',\''.Tools::getRemoteAddr().'\');
|
||||
}
|
||||
</script>';
|
||||
|
||||
|
||||
$this->displayOptionTypeText($key, $field, $value);
|
||||
echo (isset($field['next']) ? ' '.strval($field['next']) : '');
|
||||
echo '  <a href="#" class="button" onclick="addRemoteAddr(); return false;">'.$this->l('Add my IP').'</a>';
|
||||
|
||||
@@ -100,7 +100,7 @@ abstract class AdminStatsTab extends AdminPreferences
|
||||
$arrayGridEngines = ModuleGridEngine::getGridEngines();
|
||||
|
||||
echo '
|
||||
<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
|
||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
|
||||
<fieldset style="width: 200px;"><legend><img src="../img/admin/tab-preferences.gif" />'.$this->l('Settings', 'AdminStatsTab').'</legend>';
|
||||
echo '<p><strong>'.$this->l('Graph engine', 'AdminStatsTab').' </strong><br />';
|
||||
if (sizeof($arrayGraphEngines))
|
||||
@@ -153,7 +153,7 @@ abstract class AdminStatsTab extends AdminPreferences
|
||||
return '
|
||||
<fieldset style="width: 200px; font-size:13px;"><legend><img src="../img/admin/date.png" /> '.$translations['Calendar'].'</legend>
|
||||
<div>
|
||||
<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
|
||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
|
||||
<input type="submit" name="submitDateDay" class="button" value="'.$translations['Day'].'">
|
||||
<input type="submit" name="submitDateMonth" class="button" value="'.$translations['Month'].'">
|
||||
<input type="submit" name="submitDateYear" class="button" value="'.$translations['Year'].'"><br />
|
||||
|
||||
@@ -843,13 +843,13 @@ class AdminTranslations extends AdminTab
|
||||
<script type="text/javascript">';
|
||||
if (Tools::getValue('type') == 'mails')
|
||||
$str_output .= '$(document).ready(function(){
|
||||
openCloseAllDiv(\''.$_GET['type'].'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll);
|
||||
openCloseAllDiv(\''.Tools::safeOutput($_GET['type']).'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll);
|
||||
});';
|
||||
$str_output .= '
|
||||
var openAll = \''.html_entity_decode($this->l('Expand all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\';
|
||||
var closeAll = \''.html_entity_decode($this->l('Close all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\';
|
||||
</script>
|
||||
<input type="button" class="button" id="buttonall" onclick="openCloseAllDiv(\''.$_GET['type'].'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll);" />
|
||||
<input type="button" class="button" id="buttonall" onclick="openCloseAllDiv(\''.Tools::safeOutput($_GET['type']).'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll);" />
|
||||
<script type="text/javascript">toggleElemValue(\'buttonall\', '.($closed ? 'openAll' : 'closeAll').', '.($closed ? 'closeAll' : 'openAll').');</script>';
|
||||
return $str_output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user