dolibarr 24.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-2025 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
42// Load translation files required by the page
43$langs->loadLangs(array("install", "user", "admin"));
44
45
46if (!$user->admin) {
48}
49
50$lastkeyshown = null;
51
52
53/*
54 * View
55 */
56
57llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-system_constall');
58
59print load_fiche_titre($langs->trans("SummaryConst"), '', 'title_setup');
60
61print load_fiche_titre($langs->trans("ConfigurationFile").' ('.basename($conffile).')');
62// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
63$configfileparameters = array(
64 'dolibarr_main_url_root',
65 'dolibarr_main_url_root_alt',
66 'dolibarr_main_document_root',
67 'dolibarr_main_document_root_alt',
68 'dolibarr_main_data_root',
69 'separator',
70 'dolibarr_main_db_host',
71 'dolibarr_main_db_port',
72 'dolibarr_main_db_name',
73 'dolibarr_main_db_type',
74 'dolibarr_main_db_user',
75 'dolibarr_main_db_pass',
76 'dolibarr_main_db_character_set',
77 'dolibarr_main_db_collation',
78 '?dolibarr_main_db_prefix',
79 'separator',
80 'dolibarr_main_authentication',
81 'separator',
82 '?dolibarr_main_auth_ldap_login_attribute',
83 '?dolibarr_main_auth_ldap_host',
84 '?dolibarr_main_auth_ldap_port',
85 '?dolibarr_main_auth_ldap_version',
86 '?dolibarr_main_auth_ldap_dn',
87 '?dolibarr_main_auth_ldap_admin_login',
88 '?dolibarr_main_auth_ldap_admin_pass',
89 '?dolibarr_main_auth_ldap_debug',
90 'separator',
91 '?dolibarr_lib_FPDF_PATH',
92 '?dolibarr_lib_TCPDF_PATH',
93 '?dolibarr_lib_FPDI_PATH',
94 '?dolibarr_lib_TCPDI_PATH',
95 '?dolibarr_lib_NUSOAP_PATH',
96 '?dolibarr_lib_GEOIP_PATH',
97 '?dolibarr_lib_ODTPHP_PATH',
98 '?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
99 '?dolibarr_js_CKEDITOR',
100 '?dolibarr_js_JQUERY',
101 '?dolibarr_js_JQUERY_UI',
102 '?dolibarr_font_DOL_DEFAULT_TTF',
103 '?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
104 'separator',
105 '?dolibarr_mailing_limit_sendbyweb',
106 '?dolibarr_mailing_limit_sendbycli',
107 '?dolibarr_mailing_limit_sendbyday',
108 '?dolibarr_strict_mode'
109 );
110$configfilelib = array(
111// 'separator',
112 $langs->trans("URLRoot"),
113 $langs->trans("URLRoot").' (alt)',
114 $langs->trans("DocumentRootServer"),
115 $langs->trans("DocumentRootServer").' (alt)',
116 $langs->trans("DataRootServer"),
117 'separator',
118 $langs->trans("DatabaseServer"),
119 $langs->trans("DatabasePort"),
120 $langs->trans("DatabaseName"),
121 $langs->trans("DriverType"),
122 $langs->trans("DatabaseUser"),
123 $langs->trans("DatabasePassword"),
124 $langs->trans("DBStoringCharset"),
125 $langs->trans("DBSortingCharset"),
126 $langs->trans("Prefix"),
127 'separator',
128 $langs->trans("AuthenticationMode"),
129 'separator',
130 'dolibarr_main_auth_ldap_login_attribute',
131 'dolibarr_main_auth_ldap_host',
132 'dolibarr_main_auth_ldap_port',
133 'dolibarr_main_auth_ldap_version',
134 'dolibarr_main_auth_ldap_dn',
135 'dolibarr_main_auth_ldap_admin_login',
136 'dolibarr_main_auth_ldap_admin_pass',
137 'dolibarr_main_auth_ldap_debug',
138 'separator',
139 'dolibarr_lib_TCPDF_PATH',
140 'dolibarr_lib_FPDI_PATH',
141 'dolibarr_lib_NUSOAP_PATH',
142 'dolibarr_lib_GEOIP_PATH',
143 'dolibarr_lib_ODTPHP_PATH',
144 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
145 'dolibarr_js_CKEDITOR',
146 'dolibarr_js_JQUERY',
147 'dolibarr_js_JQUERY_UI',
148 'dolibarr_font_DOL_DEFAULT_TTF',
149 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
150 'separator',
151 'Limit nb of email sent by page',
152 'Strict mode is on/off'
153 );
154
155print '<table class="noborder centpercent">';
156print '<tr class="liste_titre"><td width="280">'.$langs->trans("Label").'</td>';
157print '<td>'.$langs->trans("Parameter").'</td>';
158print '<td></td>';
159print '</tr>'."\n";
160$i = 0;
161foreach ($configfileparameters as $key) {
162 if ($key == 'dolibarr_main_url_root_alt' && empty($dolibarr_main_url_root_alt)) {
163 continue;
164 }
165 if ($key == 'dolibarr_main_document_root_alt' && empty($dolibarr_main_document_root_alt)) {
166 continue;
167 }
168
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();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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:73
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
$conffile
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.