dolibarr  16.0.5
security.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
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 
26 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
29 
30 $action = GETPOST('action', 'aZ09');
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array("users", "admin", "other"));
34 
35 if (!$user->admin) {
37 }
38 
39 // Allow/Disallow change to clear passwords once passwords are crypted
40 $allow_disable_encryption = true;
41 
42 
43 /*
44  * Actions
45  */
46 
47 if ($action == 'setgeneraterule') {
48  if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', GETPOST("value", "alphanohtml"), 'chaine', 0, '', $conf->entity)) {
49  dol_print_error($db);
50  } else {
51  header("Location: ".$_SERVER["PHP_SELF"]);
52  exit;
53  }
54 }
55 
56 if ($action == 'activate_encrypt') {
57  $error = 0;
58 
59  $db->begin();
60 
61  // On old version a bug created the constant into user entity, so we delete it to be sure, such entry won't exists. We want it in entity 0 or nowhere.
62  dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $conf->entity);
63  // We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
64  $entityforall = 0;
65  dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $entityforall);
66 
67  $sql = "SELECT u.rowid, u.pass, u.pass_crypted";
68  $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
69  $sql .= " WHERE u.pass IS NOT NULL AND LENGTH(u.pass) < 32"; // Not a MD5 value
70 
71  $resql = $db->query($sql);
72  if ($resql) {
73  $numrows = $db->num_rows($resql);
74  $i = 0;
75  while ($i < $numrows) {
76  $obj = $db->fetch_object($resql);
77  if (dol_hash($obj->pass)) {
78  $sql = "UPDATE ".MAIN_DB_PREFIX."user";
79  $sql .= " SET pass_crypted = '".dol_hash($obj->pass)."', pass = NULL";
80  $sql .= " WHERE rowid=".((int) $obj->rowid);
81  //print $sql;
82 
83  $resql2 = $db->query($sql);
84  if (!$resql2) {
85  dol_print_error($db);
86  $error++;
87  break;
88  }
89 
90  $i++;
91  }
92  }
93  } else {
94  dol_print_error($db);
95  }
96 
97  //print $error." ".$sql;
98  //exit;
99  if (!$error) {
100  $db->commit();
101  header("Location: security.php");
102  exit;
103  } else {
104  $db->rollback();
105  dol_print_error($db, '');
106  }
107 } elseif ($action == 'disable_encrypt') {
108  //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
109  //Do not allow "disable encryption" as passwords cannot be decrypted
110  if ($allow_disable_encryption) {
111  dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
112  }
113  header("Location: security.php");
114  exit;
115 }
116 
117 if ($action == 'activate_encryptdbpassconf') {
118  $result = encodedecode_dbpassconf(1);
119  if ($result > 0) {
120  sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
121 
122  // database value not required
123  //dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
124  header("Location: security.php");
125  exit;
126  } else {
127  setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings');
128  }
129 } elseif ($action == 'disable_encryptdbpassconf') {
130  $result = encodedecode_dbpassconf(0);
131  if ($result > 0) {
132  sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
133 
134  // database value not required
135  //dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity);
136  header("Location: security.php");
137  exit;
138  } else {
139  setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings');
140  }
141 }
142 
143 if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
144  dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1', 'chaine', 0, '', $conf->entity);
145  header("Location: security.php");
146  exit;
147 } elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
148  dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", $conf->entity);
149  header("Location: security.php");
150  exit;
151 }
152 
153 if ($action == 'updatepattern') {
154  $pattern = GETPOST("pattern", "alpha");
155  $explodePattern = explode(';', $pattern);
156 
157  $patternInError = false;
158  if ($explodePattern[0] < 1 || $explodePattern[4] < 0) {
159  $patternInError = true;
160  }
161 
162  if ($explodePattern[0] < $explodePattern[1] + $explodePattern[2] + $explodePattern[3]) {
163  $patternInError = true;
164  }
165 
166  if (!$patternInError) {
167  dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity);
168  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
169  header("Location: security.php");
170  exit;
171  }
172 }
173 
174 
175 
176 /*
177  * View
178  */
179 
180 $form = new Form($db);
181 
182 $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
183 llxHeader('', $langs->trans("Passwords"), $wikihelp);
184 
185 print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup');
186 
187 print '<span class="opacitymedium">'.$langs->trans("GeneratedPasswordDesc")."</span><br>\n";
188 print "<br>\n";
189 
190 
191 $head = security_prepare_head();
192 
193 print dol_get_fiche_head($head, 'passwords', '', -1);
194 
195 print '<br>';
196 
197 // Select manager to generate passwords
198 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
199 print '<input type="hidden" name="token" value="'.newToken().'">';
200 print '<input type="hidden" name="action" value="update">';
201 print '<input type="hidden" name="constname" value="USER_PASSWORD_GENERATED">';
202 print '<input type="hidden" name="consttype" value="yesno">';
203 
204 // Charge tableau des modules generation
205 $dir = "../core/modules/security/generate";
206 clearstatcache();
207 $handle = opendir($dir);
208 $i = 1;
209 if (is_resource($handle)) {
210  while (($file = readdir($handle)) !== false) {
211  if (preg_match('/(modGeneratePass[a-z]+)\.class\.php$/i', $file, $reg)) {
212  // Charging the numbering class
213  $classname = $reg[1];
214  require_once $dir.'/'.$file;
215 
216  $obj = new $classname($db, $conf, $langs, $user);
217  $arrayhandler[$obj->id] = $obj;
218  $i++;
219  }
220  }
221  closedir($handle);
222 }
223 asort($arrayhandler);
224 
225 print '<div class="div-table-responsive-no-min">';
226 print '<table class="noborder centpercent">';
227 print '<tr class="liste_titre">';
228 print '<td colspan="2">'.$langs->trans("RuleForGeneratedPasswords").'</td>';
229 print '<td>'.$langs->trans("Example").'</td>';
230 print '<td class="center">'.$langs->trans("Activated").'</td>';
231 print '</tr>';
232 
233 foreach ($arrayhandler as $key => $module) {
234  // Show modules according to features level
235  if (!empty($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
236  continue;
237  }
238  if (!empty($module->version) && $module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
239  continue;
240  }
241 
242  if ($module->isEnabled()) {
243  print '<tr class="oddeven"><td width="100">';
244  print ucfirst($key);
245  print "</td><td>\n";
246  print $module->getDescription().'<br>';
247  print $langs->trans("MinLength").': '.$module->length;
248  print '</td>';
249 
250  // Show example of numbering module
251  print '<td class="nowrap">';
252  $tmp = $module->getExample();
253  if (preg_match('/^Error/', $tmp)) {
254  $langs->load("errors");
255  print '<div class="error">'.$langs->trans($tmp).'</div>';
256  } elseif ($tmp == 'NotConfigured') {
257  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
258  } else {
259  print '<span class="opacitymedium">'.$tmp.'</span>';
260  }
261  print '</td>'."\n";
262 
263  print '<td width="100" align="center">';
264  if ($conf->global->USER_PASSWORD_GENERATED == $key) {
265  //print img_picto('', 'tick');
266  print img_picto($langs->trans("Enabled"), 'switch_on');
267  } else {
268  print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&token='.newToken().'&value='.$key.'">';
269  //print $langs->trans("Activate");
270  print img_picto($langs->trans("Disabled"), 'switch_off');
271  print '</a>';
272  }
273  print "</td></tr>\n";
274  }
275 }
276 print '</table>';
277 print '</div>';
278 
279 print '</form>';
280 
281 //if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
282 // Patter for Password Perso
283 if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
284  $tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN);
285  print '<br>';
286 
287  print '<div class="div-table-responsive-no-min">';
288  print '<table class="noborder centpercent">';
289  print '<tr class="liste_titre">';
290  print '<td colspan="2"> '.$langs->trans("PasswordPatternDesc").'</td>';
291  print '</tr>';
292 
293 
294  print '<tr class="oddeven">';
295  print '<td>'.$langs->trans("MinLength")."</td>";
296  print '<td><input type="number" value="'.$tabConf[0].'" id="minlenght" min="1"></td>';
297  print '</tr>';
298 
299 
300  print '<tr class="oddeven">';
301  print '<td>'.$langs->trans("NbMajMin")."</td>";
302  print '<td><input type="number" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>';
303  print '</tr>';
304 
305 
306  print '<tr class="oddeven">';
307  print '<td>'.$langs->trans("NbNumMin")."</td>";
308  print '<td><input type="number" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>';
309  print '</tr>';
310 
311 
312  print '<tr class="oddeven">';
313  print '<td>'.$langs->trans("NbSpeMin")."</td>";
314  print '<td><input type="number" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>';
315  print '</tr>';
316 
317 
318  print '<tr class="oddeven">';
319  print '<td>'.$langs->trans("NbIteConsecutive")."</td>";
320  print '<td><input type="number" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>';
321  print '</tr>';
322 
323 
324  print '<tr class="oddeven">';
325  print '<td>'.$langs->trans("NoAmbiCaracAutoGeneration")."</td>";
326  print '<td><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <label for="NoAmbiCaracAutoGeneration" id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</label></td>';
327  print '</tr>';
328 
329  print '</table>';
330 
331  print '<br>';
332  print '<div class="center">';
333  print '<a class="button button-save" id="linkChangePattern">'.$langs->trans("Save").'</a>';
334  print '</div>';
335  print '<br><br>';
336 
337  print '<script type="text/javascript">';
338  print ' function getStringArg(){';
339  print ' var pattern = "";';
340  print ' pattern += $("#minlenght").val() + ";";';
341  print ' pattern += $("#NbMajMin").val() + ";";';
342  print ' pattern += $("#NbNumMin").val() + ";";';
343  print ' pattern += $("#NbSpeMin").val() + ";";';
344  print ' pattern += $("#NbIteConsecutive").val() + ";";';
345  print ' pattern += $("#NoAmbiCaracAutoGeneration")[0].checked ? "1" : "0";';
346  print ' return pattern;';
347  print ' }';
348 
349  print ' function valuePossible(){';
350  print ' var fields = ["#minlenght", "#NbMajMin", "#NbNumMin", "#NbSpeMin", "#NbIteConsecutive"];';
351  print ' for(var i = 0 ; i < fields.length ; i++){';
352  print ' if($(fields[i]).val() < $(fields[i]).attr("min")){';
353  print ' return false;';
354  print ' }';
355  print ' }';
356  print ' ';
357  print ' var length = parseInt($("#minlenght").val());';
358  print ' var length_mini = parseInt($("#NbMajMin").val()) + parseInt($("#NbNumMin").val()) + parseInt($("#NbSpeMin").val());';
359  print ' return length >= length_mini;';
360  print ' }';
361 
362  print ' function generatelink(){';
363  print ' return "security.php?action=updatepattern&token='.newToken().'&pattern="+getStringArg();';
364  print ' }';
365 
366  print ' function valuePatternChange(){';
367  print ' console.log("valuePatternChange");';
368  print ' var lang_save = "'.$langs->trans("Save").'";';
369  print ' var lang_error = "'.$langs->trans("Error").'";';
370  print ' var lang_Disabled = "'.$langs->trans("Disabled").'";';
371  print ' var lang_Activated = "'.$langs->trans("Activated").'";';
372  print ' $("#textcheckbox").html($("#NoAmbiCaracAutoGeneration")[0].checked ? unescape(lang_Activated) : unescape(lang_Disabled));';
373  print ' if(valuePossible()){';
374  print ' $("#linkChangePattern").attr("href",generatelink()).text(lang_save);';
375  print ' }';
376  print ' else{';
377  print ' $("#linkChangePattern").attr("href", null).text(lang_error);';
378  print ' }';
379  print ' }';
380 
381  print ' $("#minlenght").change(function(){valuePatternChange();});';
382  print ' $("#NbMajMin").change(function(){valuePatternChange();});';
383  print ' $("#NbNumMin").change(function(){valuePatternChange();});';
384  print ' $("#NbSpeMin").change(function(){valuePatternChange();});';
385  print ' $("#NbIteConsecutive").change(function(){valuePatternChange();});';
386  print ' $("#NoAmbiCaracAutoGeneration").change(function(){valuePatternChange();});';
387 
388  print '</script>';
389 }
390 
391 
392 // Crypt passwords in database
393 
394 print '<br>';
395 print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
396 print '<input type="hidden" name="token" value="'.newToken().'">';
397 print "<input type=\"hidden\" name=\"action\" value=\"encrypt\">";
398 
399 print '<table class="noborder centpercent">';
400 print '<tr class="liste_titre">';
401 print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
402 print '<td class="center">'.$langs->trans("Activated").'</td>';
403 print '<td class="center">'.$langs->trans("Action").'</td>';
404 print '</tr>';
405 
406 // Disable clear password in database
407 print '<tr class="oddeven">';
408 print '<td colspan="3">'.$langs->trans("DoNotStoreClearPassword").'</td>';
409 print '<td class="center" width="60">';
410 if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
411  print img_picto($langs->trans("Active"), 'tick');
412 }
413 print '</td>';
414 if (!getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
415  print '<td class="center" width="100">';
416  print '<a href="security.php?action=activate_encrypt">'.$langs->trans("Activate").'</a>';
417  print "</td>";
418 }
419 
420 // Database conf file encryption
421 if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
422  print '<td class="center" width="100">';
423  if ($allow_disable_encryption) {
424  //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
425  //Do not allow "disable encryption" as passwords cannot be decrypted
426  print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_encrypt&token='.newToken().'">'.$langs->trans("Disable").'</a>';
427  } else {
428  print '-';
429  }
430  print "</td>";
431 }
432 print "</td>";
433 print '</tr>';
434 
435 
436 // Crypt password into config file conf.php
437 
438 print '<tr class="oddeven">';
439 print '<td colspan="3">'.$langs->trans("MainDbPasswordFileConfEncrypted").'</td>';
440 print '<td align="center" width="60">';
441 if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
442  print img_picto($langs->trans("Active"), 'tick');
443 }
444 
445 print '</td>';
446 
447 print '<td class="center" width="100">';
448 if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
449  $langs->load("errors");
450  print img_warning($langs->trans("WarningPassIsEmpty"));
451 } else {
452  if (empty($dolibarr_main_db_encrypted_pass)) {
453  print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Activate").'</a>';
454  }
455  if (!empty($dolibarr_main_db_encrypted_pass)) {
456  print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Disable").'</a>';
457  }
458 }
459 print "</td>";
460 
461 print "</td>";
462 print '</tr>';
463 
464 
465 // Disable link "Forget password" on logon
466 
467 print '<tr class="oddeven">';
468 print '<td colspan="3">'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").'</td>';
469 print '<td class="center" width="60">';
470 if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
471  print img_picto($langs->trans("Active"), 'tick');
472 }
473 print '</td>';
474 if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
475  print '<td class="center" width="100">';
476  print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Activate").'</a>';
477  print "</td>";
478 }
479 if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
480  print '<td class="center" width="100">';
481  print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Disable").'</a>';
482  print "</td>";
483 }
484 print "</td>";
485 print '</tr>';
486 
487 
488 print '</table>';
489 print '</form>';
490 print '<br>';
491 
492 if (GETPOST('info', 'int') > 0) {
493  if (function_exists('password_hash')) {
494  print $langs->trans("Note: The function password_hash exists on your PHP")."<br>\n";
495  } else {
496  print $langs->trans("Note: The function password_hash does not exists on your PHP")."<br>\n";
497  }
498  print 'MAIN_SECURITY_HASH_ALGO = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO')."<br>\n";
499  print 'MAIN_SECURITY_SALT = '.getDolGlobalString('MAIN_SECURITY_SALT')."<br>\n";
500 }
501 
502 print '</div>';
503 
504 // End of page
505 llxFooter();
506 $db->close();
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
security_prepare_head
security_prepare_head()
Prepare array with list of tabs.
Definition: admin.lib.php:772
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:552
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
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
img_warning
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
Definition: functions.lib.php:4521
encodedecode_dbpassconf
encodedecode_dbpassconf($level=0)
Encode or decode database password in config file.
Definition: security2.lib.php:364
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
dol_hash
dol_hash($chain, $type='0')
Returns a hash of a string.
Definition: security.lib.php:104
$wikihelp
if($actionsave) if(!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $wikihelp
View.
Definition: agenda_xcal.php:72
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_encode
dol_encode($chain, $key='1')
Encode a string with base 64 algorithm + specific delta change.
Definition: security.lib.php:38
dolibarr_set_const
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:627
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
$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
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
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