dolibarr 18.0.6
constall.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
25// Load Dolibarr environment
26require '../../main.inc.php';
27
28// Load translation files required by the page
29$langs->loadLangs(array("install", "user", "admin"));
30
31
32if (!$user->admin) {
34}
35
36
37/*
38 * View
39 */
40
41llxHeader();
42
43print load_fiche_titre($langs->trans("SummaryConst"), '', 'title_setup');
44
45
46print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')');
47// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
48$configfileparameters = array(
49 'dolibarr_main_url_root',
50 'dolibarr_main_url_root_alt',
51 'dolibarr_main_document_root',
52 'dolibarr_main_document_root_alt',
53 'dolibarr_main_data_root',
54 'separator',
55 'dolibarr_main_db_host',
56 'dolibarr_main_db_port',
57 'dolibarr_main_db_name',
58 'dolibarr_main_db_type',
59 'dolibarr_main_db_user',
60 'dolibarr_main_db_pass',
61 'dolibarr_main_db_character_set',
62 'dolibarr_main_db_collation',
63 '?dolibarr_main_db_prefix',
64 'separator',
65 'dolibarr_main_authentication',
66 'separator',
67 '?dolibarr_main_auth_ldap_login_attribute',
68 '?dolibarr_main_auth_ldap_host',
69 '?dolibarr_main_auth_ldap_port',
70 '?dolibarr_main_auth_ldap_version',
71 '?dolibarr_main_auth_ldap_dn',
72 '?dolibarr_main_auth_ldap_admin_login',
73 '?dolibarr_main_auth_ldap_admin_pass',
74 '?dolibarr_main_auth_ldap_debug',
75 'separator',
76 '?dolibarr_lib_FPDF_PATH',
77 '?dolibarr_lib_TCPDF_PATH',
78 '?dolibarr_lib_FPDI_PATH',
79 '?dolibarr_lib_TCPDI_PATH',
80 '?dolibarr_lib_NUSOAP_PATH',
81 '?dolibarr_lib_GEOIP_PATH',
82 '?dolibarr_lib_ODTPHP_PATH',
83 '?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
84 '?dolibarr_js_CKEDITOR',
85 '?dolibarr_js_JQUERY',
86 '?dolibarr_js_JQUERY_UI',
87 '?dolibarr_font_DOL_DEFAULT_TTF',
88 '?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
89 'separator',
90 '?dolibarr_mailing_limit_sendbyweb',
91 '?dolibarr_mailing_limit_sendbycli',
92 '?dolibarr_mailing_limit_sendbyday',
93 '?dolibarr_strict_mode'
94 );
95$configfilelib = array(
96// 'separator',
97 $langs->trans("URLRoot"),
98 $langs->trans("URLRoot").' (alt)',
99 $langs->trans("DocumentRootServer"),
100 $langs->trans("DocumentRootServer").' (alt)',
101 $langs->trans("DataRootServer"),
102 'separator',
103 $langs->trans("DatabaseServer"),
104 $langs->trans("DatabasePort"),
105 $langs->trans("DatabaseName"),
106 $langs->trans("DriverType"),
107 $langs->trans("DatabaseUser"),
108 $langs->trans("DatabasePassword"),
109 $langs->trans("DBStoringCharset"),
110 $langs->trans("DBSortingCharset"),
111 $langs->trans("Prefix"),
112 'separator',
113 $langs->trans("AuthenticationMode"),
114 'separator',
115 'dolibarr_main_auth_ldap_login_attribute',
116 'dolibarr_main_auth_ldap_host',
117 'dolibarr_main_auth_ldap_port',
118 'dolibarr_main_auth_ldap_version',
119 'dolibarr_main_auth_ldap_dn',
120 'dolibarr_main_auth_ldap_admin_login',
121 'dolibarr_main_auth_ldap_admin_pass',
122 'dolibarr_main_auth_ldap_debug',
123 'separator',
124 'dolibarr_lib_TCPDF_PATH',
125 'dolibarr_lib_FPDI_PATH',
126 'dolibarr_lib_NUSOAP_PATH',
127 'dolibarr_lib_GEOIP_PATH',
128 'dolibarr_lib_ODTPHP_PATH',
129 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
130 'dolibarr_js_CKEDITOR',
131 'dolibarr_js_JQUERY',
132 'dolibarr_js_JQUERY_UI',
133 'dolibarr_font_DOL_DEFAULT_TTF',
134 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
135 'separator',
136 'Limit nb of email sent by page',
137 'Strict mode is on/off'
138 );
139
140print '<table class="noborder centpercent">';
141print '<tr class="liste_titre"><td width="280">'.$langs->trans("Label").'</td>';
142print '<td>'.$langs->trans("Parameter").'</td>';
143print '<td>'.$langs->trans("Value").'</td>';
144print '</tr>'."\n";
145$i = 0;
146foreach ($configfileparameters as $key) {
147 $ignore = 0;
148
149 if ($key == 'dolibarr_main_url_root_alt' && empty(${$key})) {
150 $ignore = 1;
151 }
152 if ($key == 'dolibarr_main_document_root_alt' && empty(${$key})) {
153 $ignore = 1;
154 }
155
156 if (empty($ignore)) {
157 $newkey = preg_replace('/^\?/', '', $key);
158
159 if (preg_match('/^\?/', $key) && empty(${$newkey})) {
160 $i++;
161 continue; // We discard parametes starting with ?
162 }
163
164 if ($newkey == 'separator' && $lastkeyshown == 'separator') {
165 $i++;
166 continue;
167 }
168
169 print '<tr class="oddeven">';
170 if ($newkey == 'separator') {
171 print '<td colspan="3">&nbsp;</td>';
172 } else {
173 // Label
174 print "<td>".$configfilelib[$i].'</td>';
175 // Key
176 print '<td>'.$newkey.'</td>';
177 // Value
178 print "<td>";
179 if ($newkey == 'dolibarr_main_db_pass') {
180 print preg_replace('/./i', '*', ${$newkey});
181 } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
182 print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
183 } else {
184 print ${$newkey};
185 }
186 if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
187 print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
188 }
189 print "</td>";
190 }
191 print "</tr>\n";
192 $lastkeyshown = $newkey;
193 }
194 $i++;
195}
196print '</table>';
197print '<br>';
198
199
200
201// Parameters in database
202print load_fiche_titre($langs->trans("Database"));
203print '<table class="noborder">';
204print '<tr class="liste_titre">';
205print '<td>'.$langs->trans("Parameter").'</td>';
206print '<td>'.$langs->trans("Value").'</td>';
207if (!isModEnabled('multicompany') || !$user->entity) {
208 print '<td>'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
209}
210print "</tr>\n";
211
212$sql = "SELECT";
213$sql .= " rowid";
214$sql .= ", ".$db->decrypt('name')." as name";
215$sql .= ", ".$db->decrypt('value')." as value";
216$sql .= ", type";
217$sql .= ", note";
218$sql .= ", entity";
219$sql .= " FROM ".MAIN_DB_PREFIX."const";
220if (!isModEnabled('multicompany')) {
221 // If no multicompany mode, admins can see global and their constantes
222 $sql .= " WHERE entity IN (0,".$conf->entity.")";
223} else {
224 // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
225 if ($user->entity) {
226 $sql .= " WHERE entity IN (".$db->sanitize($user->entity.",".$conf->entity).")";
227 }
228}
229$sql .= " ORDER BY entity, name ASC";
230$resql = $db->query($sql);
231if ($resql) {
232 $num = $db->num_rows($resql);
233 $i = 0;
234
235 while ($i < $num) {
236 $obj = $db->fetch_object($resql);
237
238 print '<tr class="oddeven">';
239 print '<td>'.$obj->name.'</td>'."\n";
240 print '<td>'.$obj->value.'</td>'."\n";
241 if (!isModEnabled('multicompany') || !$user->entity) {
242 print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
243 }
244 print "</tr>\n";
245
246 $i++;
247 }
248}
249
250print '</table>';
251
252// End of page
253llxFooter();
254$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:56
llxFooter()
Empty footer.
Definition wrapper.php:70
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.