-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathadmin_modif.php
More file actions
executable file
·125 lines (119 loc) · 3.51 KB
/
admin_modif.php
File metadata and controls
executable file
·125 lines (119 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/*
* Factux le facturier libre
* Copyright (C) 2003-2005 Guy Hendrickx, 2017~ Thomas Ingles
*
* Licensed under the terms of the GNU General Public License:
* http://opensource.org/licenses/GPL-3.0
*
* For further information visit:
* http://factux.free.fr
*
* File Name: admin_modif.php
* Enregistrement des parametres: configav.php
*
* * * * Version: 8.0.0
* * * * Modified: 07/06/2025
*
* File Authors:
* Guy Hendrickx
*.
*/
require_once(__DIR__ . "/include/verif.php");
include_once(__DIR__ . "/include/config/common.php");
include_once(__DIR__ . "/include/config/var.php");
include_once(__DIR__ . sprintf('/include/language/%s.php', $lang));
if ($user_admin !='y') {
echo sprintf('<h1>%s</h1>', $lang_admin_droit);
exit;
}
if ($_POST === []) {#acces direct
include(__DIR__ . "/admin.php");
exit;
}
$choix_use_lot=isset($_POST['choix_use_lot'])?$_POST['choix_use_lot']:"";
$choix_use_liste_cli=isset($_POST['choix_use_liste_cli'])?$_POST['choix_use_liste_cli']:"";
$choix_use_cat=isset($_POST['choix_use_cat'])?$_POST['choix_use_cat']:"";
$choix_use_payement=isset($_POST['choix_use_payement'])?$_POST['choix_use_payement']:"";
$choix_theme=isset($_POST['choix_theme'])?$_POST['choix_theme']:"";
$choix_use_stock=isset($_POST['choix_use_stock'])?$_POST['choix_use_stock']:"";
$choix_impression=isset($_POST['choix_impression'])?$_POST['choix_impression']:"";
$nbr_impression=isset($_POST['nbr_impr'])?$_POST['nbr_impr']:"";
$choix_auth_cli_devis=isset($_POST['choix_auth_cli_devis'])?$_POST['choix_auth_cli_devis']:"";
$choix_auth_cli_bon=isset($_POST['choix_auth_cli_bon'])?$_POST['choix_auth_cli_bon']:"";
$choix_auth_cli_fact=isset($_POST['choix_auth_cli_fact'])?$_POST['choix_auth_cli_fact']:"";
$choix_first_art=isset($_POST['choix_first_art'])?$_POST['article']:0;
$choix_echeance_fact=isset($_POST['choix_echeance_fact'])?$_POST['choix_echeance_fact']:30;
$filename = __DIR__ . '/include/configav.php';
$texte='<?php';
$texte.="\n";
$texte.='$lot=\'';
$texte.=$choix_use_lot;
$texte.="';";
$texte.="\n";
$texte.='$liste_cli=\'';
$texte.=$choix_use_liste_cli;
$texte.="';";
$texte.="\n";
$texte.='$use_categorie =\'';
$texte.=$choix_use_cat;
$texte.="';";
$texte.="\n";
$texte.='$use_payement =\'';
$texte.=$choix_use_payement;
$texte.="';";
$texte.="\n";
$texte.='$theme=\'';
$texte.=$choix_theme;
$texte.="';";
$texte.="\n";
$texte.='$use_stock=\'';
$texte.=$choix_use_stock;
$texte.="';";
$texte.="\n";
$texte.='$autoprint=\'';
$texte.=$choix_impression;
$texte.="';";
$texte.="\n";
$texte.='$nbr_impr=\'';
$texte.=$nbr_impression;
$texte.="';";
$texte.="\n";
$texte.='$auth_cli_devis=\'';
$texte.=$choix_auth_cli_devis;
$texte.="';";
$texte.="\n";
$texte.='$auth_cli_bon=\'';
$texte.=$choix_auth_cli_bon;
$texte.="';";
$texte.="\n";
$texte.='$auth_cli_fact=\'';
$texte.=$choix_auth_cli_fact;
$texte.="';";
$texte.="\n";
$texte.='$first_art=\'';
$texte.=$choix_first_art;
$texte.="';";
$texte.="\n";
$texte.='$echeance_fact=\'';
$texte.=$choix_echeance_fact;
$texte.="';";
$texte.="\n";
if (is_writable($filename)){
if (!$handle = fopen($filename, 'w+')){
echo sprintf('%s (%s).', $lang_fi_innouvr, $filename);
include(__DIR__ . "/admin.php");
exit;
}
if (fwrite($handle, $texte) === FALSE){
$message= sprintf('<h1>%s (%s).</h1>', $lang_fi_inedita, $filename);
include(__DIR__ . "/admin.php");
exit;
}
fclose($handle);
$message=sprintf('<h2>%s</h2>', $lang_new_config_ok);
include(__DIR__ . "/admin.php");
}else{
$message= sprintf('<h1>%s (%s).</h1>', $lang_fi_lect_sl, $filename);
include(__DIR__ . "/admin.php");
}