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