fix token CSRF check for getSupplierPrice ajax call
This commit is contained in:
parent
a96c193ab0
commit
0a9293c9c6
@ -667,7 +667,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
||||
$("#buying_price").val("").show();
|
||||
|
||||
/* Call post to load content of combo list fournprice_predef */
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', { 'idprod': $(this).val() }, function(data) {
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', { 'idprod': $(this).val(), 'token': '<?php echo $_SESSION['token']?>' }, function(data) {
|
||||
if (data && data.length > 0)
|
||||
{
|
||||
var options = ''; var defaultkey = ''; var defaultprice = ''; var bestpricefound = 0;
|
||||
|
||||
@ -430,7 +430,7 @@ jQuery(document).ready(function()
|
||||
});
|
||||
|
||||
/* Init field buying_price and fournprice */
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product ? $line->fk_product : 0; ?>}, function(data) {
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product ? $line->fk_product : 0; ?>, 'token': '<?php echo $_SESSION['token']?>'}, function(data) {
|
||||
if (data && data.length > 0) {
|
||||
var options = '';
|
||||
var trouve=false;
|
||||
|
||||
@ -26,6 +26,7 @@ if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token
|
||||
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
//if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
@ -48,6 +49,7 @@ top_httphead();
|
||||
|
||||
if ($idprod > 0)
|
||||
{
|
||||
|
||||
$producttmp = new ProductFournisseur($db);
|
||||
$producttmp->fetch($idprod);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user