dolibarr  16.0.5
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 require '../../main.inc.php';
26 
27 // Load translation files required by the page
28 $langs->loadLangs(array("install", "user", "admin"));
29 
30 
31 if (!$user->admin) {
33 }
34 
35 
36 /*
37  * View
38  */
39 
40 llxHeader();
41 
42 print load_fiche_titre($langs->trans("SummaryConst"), '', 'title_setup');
43 
44 
45 print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')');
46 // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
47 $configfileparameters = array(
48  'dolibarr_main_url_root',
49  'dolibarr_main_url_root_alt',
50  'dolibarr_main_document_root',
51  'dolibarr_main_document_root_alt',
52  'dolibarr_main_data_root',
53  'separator',
54  'dolibarr_main_db_host',
55  'dolibarr_main_db_port',
56  'dolibarr_main_db_name',
57  'dolibarr_main_db_type',
58  'dolibarr_main_db_user',
59  'dolibarr_main_db_pass',
60  'dolibarr_main_db_character_set',
61  'dolibarr_main_db_collation',
62  '?dolibarr_main_db_prefix',
63  'separator',
64  'dolibarr_main_authentication',
65  'separator',
66  '?dolibarr_main_auth_ldap_login_attribute',
67  '?dolibarr_main_auth_ldap_host',
68  '?dolibarr_main_auth_ldap_port',
69  '?dolibarr_main_auth_ldap_version',
70  '?dolibarr_main_auth_ldap_dn',
71  '?dolibarr_main_auth_ldap_admin_login',
72  '?dolibarr_main_auth_ldap_admin_pass',
73  '?dolibarr_main_auth_ldap_debug',
74  'separator',
75  '?dolibarr_lib_ADODB_PATH',
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_ADODB_PATH',
125  'dolibarr_lib_TCPDF_PATH',
126  'dolibarr_lib_FPDI_PATH',
127  'dolibarr_lib_NUSOAP_PATH',
128  'dolibarr_lib_GEOIP_PATH',
129  'dolibarr_lib_ODTPHP_PATH',
130  'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
131  'dolibarr_js_CKEDITOR',
132  'dolibarr_js_JQUERY',
133  'dolibarr_js_JQUERY_UI',
134  'dolibarr_font_DOL_DEFAULT_TTF',
135  'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
136  'separator',
137  'Limit nb of email sent by page',
138  'Strict mode is on/off'
139  );
140 
141 print '<table class="noborder centpercent">';
142 print '<tr class="liste_titre"><td width="280">'.$langs->trans("Label").'</td>';
143 print '<td>'.$langs->trans("Parameter").'</td>';
144 print '<td>'.$langs->trans("Value").'</td>';
145 print '</tr>'."\n";
146 $i = 0;
147 foreach ($configfileparameters as $key) {
148  $ignore = 0;
149 
150  if ($key == 'dolibarr_main_url_root_alt' && empty(${$key})) {
151  $ignore = 1;
152  }
153  if ($key == 'dolibarr_main_document_root_alt' && empty(${$key})) {
154  $ignore = 1;
155  }
156 
157  if (empty($ignore)) {
158  $newkey = preg_replace('/^\?/', '', $key);
159 
160  if (preg_match('/^\?/', $key) && empty(${$newkey})) {
161  $i++;
162  continue; // We discard parametes starting with ?
163  }
164 
165  if ($newkey == 'separator' && $lastkeyshown == 'separator') {
166  $i++;
167  continue;
168  }
169 
170  print '<tr class="oddeven">';
171  if ($newkey == 'separator') {
172  print '<td colspan="3">&nbsp;</td>';
173  } else {
174  // Label
175  print "<td>".$configfilelib[$i].'</td>';
176  // Key
177  print '<td>'.$newkey.'</td>';
178  // Value
179  print "<td>";
180  if ($newkey == 'dolibarr_main_db_pass') {
181  print preg_replace('/./i', '*', ${$newkey});
182  } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
183  print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
184  } else {
185  print ${$newkey};
186  }
187  if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
188  print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
189  }
190  print "</td>";
191  }
192  print "</tr>\n";
193  $lastkeyshown = $newkey;
194  }
195  $i++;
196 }
197 print '</table>';
198 print '<br>';
199 
200 
201 
202 // Parameters in database
203 print load_fiche_titre($langs->trans("Database"));
204 print '<table class="noborder">';
205 print '<tr class="liste_titre">';
206 print '<td>'.$langs->trans("Parameter").'</td>';
207 print '<td>'.$langs->trans("Value").'</td>';
208 if (empty($conf->multicompany->enabled) || !$user->entity) {
209  print '<td>'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
210 }
211 print "</tr>\n";
212 
213 $sql = "SELECT";
214 $sql .= " rowid";
215 $sql .= ", ".$db->decrypt('name')." as name";
216 $sql .= ", ".$db->decrypt('value')." as value";
217 $sql .= ", type";
218 $sql .= ", note";
219 $sql .= ", entity";
220 $sql .= " FROM ".MAIN_DB_PREFIX."const";
221 if (empty($conf->multicompany->enabled)) {
222  // If no multicompany mode, admins can see global and their constantes
223  $sql .= " WHERE entity IN (0,".$conf->entity.")";
224 } else {
225  // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
226  if ($user->entity) {
227  $sql .= " WHERE entity IN (".$db->sanitize($user->entity.",".$conf->entity).")";
228  }
229 }
230 $sql .= " ORDER BY entity, name ASC";
231 $resql = $db->query($sql);
232 if ($resql) {
233  $num = $db->num_rows($resql);
234  $i = 0;
235 
236  while ($i < $num) {
237  $obj = $db->fetch_object($resql);
238 
239  print '<tr class="oddeven">';
240  print '<td>'.$obj->name.'</td>'."\n";
241  print '<td>'.$obj->value.'</td>'."\n";
242  if (empty($conf->multicompany->enabled) || !$user->entity) {
243  print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
244  }
245  print "</tr>\n";
246 
247  $i++;
248  }
249 }
250 
251 print '</table>';
252 
253 // End of page
254 llxFooter();
255 $db->close();
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59