From 611267d2427d797128629a80760e9624182729cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Feb 2004 17:40:15 +0000 Subject: [PATCH] =?UTF-8?q?Protection=20de=20l'acc=E8s=20=E0=20la=20config?= =?UTF-8?q?=20par=20la=20fonction=20accessforbidden.=20Utilisation=20de=20?= =?UTF-8?q?la=20fonction=20dolibarr=5Fset=5Fconst=20au=20lieu=20du=20code?= =?UTF-8?q?=20en=20dur.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/propale.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index b4692c70e9f..fc769f25953 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -25,16 +25,11 @@ if (!$user->admin) accessforbidden(); -if ($action == 'nbprod' && $user->admin) +if ($HTTP_POST_VARS["action"] == 'nbprod') { - $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_NEW_FORM_NB_PRODUCT', value='".$value."', visible=0"; - - if ($db->query($sql)) - { - // la constante qui a été lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage cohérent - Header("Location: propale.php"); - } + dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$value); + + Header("Location: $PHP_SELF"); } llxHeader(); @@ -42,6 +37,7 @@ llxHeader(); if ($action == 'set') { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')"; if ($db->query($sql)) @@ -65,9 +61,7 @@ $propale_addon_var_pdf = PROPALE_ADDON_PDF; if ($action == 'setpdf') { - $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_ADDON_PDF', value='".$value."', visible=0"; - - if ($db->query($sql)) + if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value)) { // la constante qui a été lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage cohérent @@ -88,9 +82,7 @@ $propale_addon_var = PROPALE_ADDON; if ($action == 'setmod') { - $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_ADDON', value='".$value."', visible=0"; - - if ($db->query($sql)) + if (dolibarr_set_const($db, "PROPALE_ADDON",$value)) { // la constante qui a été lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage cohérent