dolibarr  13.0.2
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  * View
37  */
38 
39 llxHeader();
40 
41 print load_fiche_titre($langs->trans("SummaryConst"), '', 'title_setup');
42 
43 
44 print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')');
45 // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
46 $configfileparameters = array(
47  'dolibarr_main_url_root',
48  'dolibarr_main_url_root_alt',
49  'dolibarr_main_document_root',
50  'dolibarr_main_document_root_alt',
51  'dolibarr_main_data_root',
52  'separator',
53  'dolibarr_main_db_host',
54  'dolibarr_main_db_port',
55  'dolibarr_main_db_name',
56  'dolibarr_main_db_type',
57  'dolibarr_main_db_user',
58  'dolibarr_main_db_pass',
59  'dolibarr_main_db_character_set',
60  'dolibarr_main_db_collation',
61  '?dolibarr_main_db_prefix',
62  'separator',
63  'dolibarr_main_authentication',
64  'separator',
65  '?dolibarr_main_auth_ldap_login_attribute',
66  '?dolibarr_main_auth_ldap_host',
67  '?dolibarr_main_auth_ldap_port',
68  '?dolibarr_main_auth_ldap_version',
69  '?dolibarr_main_auth_ldap_dn',
70  '?dolibarr_main_auth_ldap_admin_login',
71  '?dolibarr_main_auth_ldap_admin_pass',
72  '?dolibarr_main_auth_ldap_debug',
73  'separator',
74  '?dolibarr_lib_ADODB_PATH',
75  '?dolibarr_lib_FPDF_PATH',
76  '?dolibarr_lib_TCPDF_PATH',
77  '?dolibarr_lib_FPDI_PATH',
78  '?dolibarr_lib_TCPDI_PATH',
79  '?dolibarr_lib_NUSOAP_PATH',
80  '?dolibarr_lib_GEOIP_PATH',
81  '?dolibarr_lib_ODTPHP_PATH',
82  '?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
83  '?dolibarr_js_CKEDITOR',
84  '?dolibarr_js_JQUERY',
85  '?dolibarr_js_JQUERY_UI',
86  '?dolibarr_font_DOL_DEFAULT_TTF',
87  '?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
88  'separator',
89  '?dolibarr_mailing_limit_sendbyweb',
90  '?dolibarr_mailing_limit_sendbycli',
91  '?dolibarr_strict_mode'
92  );
93 $configfilelib = array(
94 // 'separator',
95  $langs->trans("URLRoot"),
96  $langs->trans("URLRoot").' (alt)',
97  $langs->trans("DocumentRootServer"),
98  $langs->trans("DocumentRootServer").' (alt)',
99  $langs->trans("DataRootServer"),
100  'separator',
101  $langs->trans("DatabaseServer"),
102  $langs->trans("DatabasePort"),
103  $langs->trans("DatabaseName"),
104  $langs->trans("DriverType"),
105  $langs->trans("DatabaseUser"),
106  $langs->trans("DatabasePassword"),
107  $langs->trans("DBStoringCharset"),
108  $langs->trans("DBSortingCharset"),
109  $langs->trans("Prefix"),
110  'separator',
111  $langs->trans("AuthenticationMode"),
112  'separator',
113  'dolibarr_main_auth_ldap_login_attribute',
114  'dolibarr_main_auth_ldap_host',
115  'dolibarr_main_auth_ldap_port',
116  'dolibarr_main_auth_ldap_version',
117  'dolibarr_main_auth_ldap_dn',
118  'dolibarr_main_auth_ldap_admin_login',
119  'dolibarr_main_auth_ldap_admin_pass',
120  'dolibarr_main_auth_ldap_debug',
121  'separator',
122  'dolibarr_lib_ADODB_PATH',
123  'dolibarr_lib_TCPDF_PATH',
124  'dolibarr_lib_FPDI_PATH',
125  'dolibarr_lib_NUSOAP_PATH',
126  'dolibarr_lib_GEOIP_PATH',
127  'dolibarr_lib_ODTPHP_PATH',
128  'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
129  'dolibarr_js_CKEDITOR',
130  'dolibarr_js_JQUERY',
131  'dolibarr_js_JQUERY_UI',
132  'dolibarr_font_DOL_DEFAULT_TTF',
133  'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
134  'separator',
135  'Limit nb of email sent by page',
136  'Strict mode is on/off'
137  );
138 
139 print '<table class="noborder centpercent">';
140 print '<tr class="liste_titre"><td width="280">'.$langs->trans("Label").'</td>';
141 print '<td>'.$langs->trans("Parameter").'</td>';
142 print '<td>'.$langs->trans("Value").'</td>';
143 print '</tr>'."\n";
144 $i = 0;
145 foreach ($configfileparameters as $key)
146 {
147  $ignore = 0;
148 
149  if ($key == 'dolibarr_main_url_root_alt' && empty(${$key})) $ignore = 1;
150  if ($key == 'dolibarr_main_document_root_alt' && empty(${$key})) $ignore = 1;
151 
152  if (empty($ignore))
153  {
154  $newkey = preg_replace('/^\?/', '', $key);
155 
156  if (preg_match('/^\?/', $key) && empty(${$newkey}))
157  {
158  $i++;
159  continue; // We discard parametes starting with ?
160  }
161 
162  if ($newkey == 'separator' && $lastkeyshown == 'separator')
163  {
164  $i++;
165  continue;
166  }
167 
168  print '<tr class="oddeven">';
169  if ($newkey == 'separator')
170  {
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') print preg_replace('/./i', '*', ${$newkey});
180  elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
181  else print ${$newkey};
182  if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
183  print "</td>";
184  }
185  print "</tr>\n";
186  $lastkeyshown = $newkey;
187  }
188  $i++;
189 }
190 print '</table>';
191 print '<br>';
192 
193 
194 
195 // Parameters in database
196 print load_fiche_titre($langs->trans("Database"));
197 print '<table class="noborder">';
198 print '<tr class="liste_titre">';
199 print '<td>'.$langs->trans("Parameter").'</td>';
200 print '<td>'.$langs->trans("Value").'</td>';
201 if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
202 print "</tr>\n";
203 
204 $sql = "SELECT";
205 $sql .= " rowid";
206 $sql .= ", ".$db->decrypt('name')." as name";
207 $sql .= ", ".$db->decrypt('value')." as value";
208 $sql .= ", type";
209 $sql .= ", note";
210 $sql .= ", entity";
211 $sql .= " FROM ".MAIN_DB_PREFIX."const";
212 if (empty($conf->multicompany->enabled))
213 {
214  // If no multicompany mode, admins can see global and their constantes
215  $sql .= " WHERE entity IN (0,".$conf->entity.")";
216 } else {
217  // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
218  if ($user->entity) $sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
219 }
220 $sql .= " ORDER BY entity, name ASC";
221 $resql = $db->query($sql);
222 if ($resql)
223 {
224  $num = $db->num_rows($resql);
225  $i = 0;
226 
227  while ($i < $num)
228  {
229  $obj = $db->fetch_object($resql);
230 
231  print '<tr class="oddeven">';
232  print '<td>'.$obj->name.'</td>'."\n";
233  print '<td>'.$obj->value.'</td>'."\n";
234  if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
235  print "</tr>\n";
236 
237  $i++;
238  }
239 }
240 
241 print '</table>';
242 
243 // End of page
244 llxFooter();
245 $db->close();
llxHeader()
Empty header.
Definition: wrapper.php:45
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 Calling this function terminate execution ...
print
Draft customers invoices.
Definition: index.php:89
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
llxFooter()
Empty footer.
Definition: wrapper.php:59