Protection de l'accès à la config par la fonction accessforbidden.
Utilisation de la fonction dolibarr_set_const au lieu du code en dur.
This commit is contained in:
parent
411fe42634
commit
611267d242
@ -25,16 +25,11 @@ if (!$user->admin)
|
|||||||
accessforbidden();
|
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";
|
dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$value);
|
||||||
|
|
||||||
if ($db->query($sql))
|
Header("Location: $PHP_SELF");
|
||||||
{
|
|
||||||
// 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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
@ -42,6 +37,7 @@ llxHeader();
|
|||||||
|
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
@ -65,9 +61,7 @@ $propale_addon_var_pdf = PROPALE_ADDON_PDF;
|
|||||||
|
|
||||||
if ($action == 'setpdf')
|
if ($action == 'setpdf')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_ADDON_PDF', value='".$value."', visible=0";
|
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value))
|
||||||
|
|
||||||
if ($db->query($sql))
|
|
||||||
{
|
{
|
||||||
// la constante qui a été lue en avant du nouveau set
|
// la constante qui a été lue en avant du nouveau set
|
||||||
// on passe donc par une variable pour avoir un affichage cohérent
|
// on passe donc par une variable pour avoir un affichage cohérent
|
||||||
@ -88,9 +82,7 @@ $propale_addon_var = PROPALE_ADDON;
|
|||||||
|
|
||||||
if ($action == 'setmod')
|
if ($action == 'setmod')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_ADDON', value='".$value."', visible=0";
|
if (dolibarr_set_const($db, "PROPALE_ADDON",$value))
|
||||||
|
|
||||||
if ($db->query($sql))
|
|
||||||
{
|
{
|
||||||
// la constante qui a été lue en avant du nouveau set
|
// la constante qui a été lue en avant du nouveau set
|
||||||
// on passe donc par une variable pour avoir un affichage cohérent
|
// on passe donc par une variable pour avoir un affichage cohérent
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user