-
Notifications
You must be signed in to change notification settings - Fork 3
/
admin_modif.php
executable file
·122 lines (119 loc) · 3.33 KB
/
admin_modif.php
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
<?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: 5.0.0
* * * * Modified: 07/10/2016
*
* File Authors:
* Guy Hendrickx
*.
*/
require_once("include/verif.php");
include_once("include/config/common.php");
include_once("include/config/var.php");
include_once("include/language/$lang.php");
if ($user_admin !='y') {
echo "<h1>$lang_admin_droit</h1>";
exit;
}
if (empty($_POST)) {#acces direct
include("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 = '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 "$lang_fi_innouvr ($filename).";
include("admin.php");
exit;
}
if (fwrite($handle, $texte) === FALSE){
$message= "<h1>$lang_fi_inedita ($filename).</h1>";
include("admin.php");
exit;
}
fclose($handle);
$message="<h2>$lang_new_config_ok</h2>";
include("admin.php");
}else{
$message= "<h1>$lang_fi_lect_sl ($filename).</h1>";
include("admin.php");
}