dolibarr 25.0.0-alpha
security.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2022 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 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
6 * Copyright (C) 2024-2026 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
28// Load Dolibarr environment
29require '../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
41
42$action = GETPOST('action', 'aZ09');
43
44// Load translation files required by the page
45$langs->loadLangs(array("users", "admin", "other"));
46
47if (!$user->admin) {
49}
50
51// Allow/Disallow change to clear passwords once passwords are encrypted
52$allow_disable_encryption = false;
53
54
55/*
56 * Actions
57 */
58
59if ($action == 'setgeneraterule') {
60 $value = GETPOST("value", "alphanohtml");
61 if (strtolower($value) === 'none' && isPasswordGenerationNoneForbidden()) {
62 // The 'none' model is forbidden on this installation (conf.php lock) — refuse the change.
63 setEventMessages($langs->trans("PasswordGenerationNoneDisabled"), null, 'errors');
64 } elseif (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', $value, 'chaine', 0, '', $conf->entity)) {
65 dol_print_error($db);
66 }
67}
68
69if ($action == 'activate_encrypt') {
70 $error = 0;
71
72 $db->begin();
73
74 // 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.
75 dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
76 // We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
77 $entityforall = 0;
78 dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $entityforall);
79
80 $sql = "SELECT u.rowid, u.pass, u.pass_crypted";
81 $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
82 $sql .= " WHERE u.pass IS NOT NULL AND LENGTH(u.pass) < 32"; // Not a MD5 value
83
84 $resql = $db->query($sql);
85 if ($resql) {
86 $numrows = $db->num_rows($resql);
87 $i = 0;
88 while ($i < $numrows) {
89 $obj = $db->fetch_object($resql);
90 if (dol_hash($obj->pass)) {
91 $sql = "UPDATE ".MAIN_DB_PREFIX."user";
92 $sql .= " SET pass_crypted = '".dol_hash($obj->pass)."', pass = NULL";
93 $sql .= " WHERE rowid=".((int) $obj->rowid);
94 //print $sql;
95
96 $resql2 = $db->query($sql);
97 if (!$resql2) {
98 dol_print_error($db);
99 $error++;
100 break;
101 }
102
103 $i++;
104 }
105 }
106 } else {
107 dol_print_error($db);
108 }
109
110 //print $error." ".$sql;
111 //exit;
112 if (!$error) {
113 $db->commit();
114 } else {
115 $db->rollback();
116 dol_print_error($db, '');
117 }
118} elseif ($action == 'disable_encrypt') {
119 // By default, $allow_disable_encryption is false we do not allow to disable encryption because passwords can't be decoded once encrypted.
120 // We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
121 if ($allow_disable_encryption) {
122 dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
123 dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", 0);
124 }
125}
126
127if ($action == 'activate_encryptdbpassconf') {
128 $result = encodedecode_dbpassconf(1);
129 if ($result > 0) {
130 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.
131
132 // database value not required
133 // dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
134 header("Location: security.php");
135 exit;
136 } else {
137 setEventMessages($langs->trans('InstrucToEncodePass', dolEncrypt($dolibarr_main_db_pass)), null, 'warnings');
138 }
139} elseif ($action == 'disable_encryptdbpassconf') {
140 $result = encodedecode_dbpassconf(0);
141 if ($result > 0) {
142 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.
143
144 // database value not required
145 // dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity);
146 header("Location: security.php");
147 exit;
148 } else {
149 // setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings');
150 setEventMessages($langs->trans('InstrucToClearPass', $langs->transnoentitiesnoconv("DatabasePassword")), null, 'warnings');
151 }
152}
153
154if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
155 dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1', 'chaine', 0, '', $conf->entity);
156} elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
157 dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", $conf->entity);
158}
159
160if ($action == 'updatepattern') {
161 $pattern = GETPOST("pattern", "alpha");
162 $explodePattern = explode(';', $pattern); // List of ints separated with ';' containing counts
163
164 $patternInError = false;
165 if ((int) $explodePattern[0] < 1 || (int) $explodePattern[4] < 0) {
166 $patternInError = true;
167 }
168
169 if ((int) $explodePattern[0] < (int) $explodePattern[1] + (int) $explodePattern[2] + (int) $explodePattern[3]) {
170 $patternInError = true;
171 }
172
173 $minlengthallowed = getPasswordPatternMinLength();
174 if ((int) $explodePattern[0] < $minlengthallowed) {
175 // The 'none' model is forbidden on this installation, so the Perso model cannot be tuned
176 // down below the enforced floor either.
177 $patternInError = true;
178 setEventMessages($langs->trans("PasswordPatternMinLengthRestricted", $minlengthallowed), null, 'errors');
179 }
180
181 if (!$patternInError) {
182 dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity);
183 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
184 header("Location: security.php");
185 exit;
186 }
187}
188
189
190
191/*
192 * View
193 */
194
195$form = new Form($db);
196
197$wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
198llxHeader('', $langs->trans("Passwords"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-security');
199
200print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup');
201
202print '<div class="info">'.$langs->trans("GeneratedPasswordDesc")."</div>\n";
203
204
205$head = security_prepare_head();
206
207print dol_get_fiche_head($head, 'passwords', '', -1);
208
209print '<br>';
210
211// Select manager to generate passwords
212print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" spellcheck="false">';
213print '<input type="hidden" name="token" value="'.newToken().'">';
214print '<input type="hidden" name="action" value="update">';
215print '<input type="hidden" name="constname" value="USER_PASSWORD_GENERATED">';
216print '<input type="hidden" name="consttype" value="yesno">';
217
218// Load array with all password generation modules: scan core/modules/security/generate/
219// plus, for each enabled module declaring module_parts['models'], its own
220// core/modules/security/generate/ subdirectory — same multi-root convention already used
221// by every numbering-module scan in Dolibarr (see e.g. Facture::getNextNumRef()).
222$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
223$arrayhandler = array();
224foreach ($dirmodels as $reldir) {
225 $dir = dol_buildpath($reldir.'core/modules/security/generate/');
226 clearstatcache();
227 $handle = @opendir($dir);
228 if (is_resource($handle)) {
229 while (($file = readdir($handle)) !== false) {
230 $reg = array();
231 if (preg_match('/(modGeneratePass[a-z]+)\.class\.php$/i', $file, $reg)) {
232 // Charging the numbering class
233 $classname = $reg[1];
234 if (!class_exists($classname)) {
235 require_once $dir.$file;
236 }
237 if (class_exists($classname)) {
238 $obj = new $classname($db, $conf, $langs, $user);
239 '@phan-var-force ModeleGenPassword $obj';
240 $arrayhandler[$obj->id] = $obj;
241 }
242 }
243 }
244 closedir($handle);
245 }
246}
247asort($arrayhandler);
248
249print '<div class="div-table-responsive-no-min">';
250print '<table class="noborder centpercent">';
251print '<tr class="liste_titre">';
252print '<td colspan="2">'.$langs->trans("RuleForGeneratedPasswords").'</td>';
253print '<td>'.$langs->trans("Example").'</td>';
254print '<td class="center">'.$langs->trans("Activated").'</td>';
255print '</tr>';
256
257$tabConf = explode(";", getDolGlobalString('USER_PASSWORD_PATTERN'));
258
259foreach ($arrayhandler as $key => $module) {
260 // Show modules according to features level
261 if (!empty($module->version) && $module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
262 continue;
263 }
264 if (!empty($module->version) && $module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
265 continue;
266 }
267
268 if ($module->isEnabled()) {
269 print '<tr class="oddeven"><td class="nowraponall">';
270 print img_picto('', $module->picto, 'class="width25 size15x marginrightonly"').' ';
271 print '<div class="refid inline-block">'.ucfirst($key).'</span>';
272 print "</td><td>\n";
273 print $module->getDescription().'<br>';
274 print $langs->trans("MinLength").': <span class="opacitymedium">'.$module->length.'</span>';
275 print '</td>';
276
277 // Show example of numbering module
278 print '<td class="nowraponall">';
279 $tmp = $module->getExample();
280 if (preg_match('/^Error/', $tmp)) {
281 $langs->load("errors");
282 print '<div class="error">'.$langs->trans($tmp).'</div>';
283 } elseif ($tmp == 'NotConfigured') {
284 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
285 } else {
286 print '<span class="opacitymedium">'.$tmp.'</span>';
287 }
288 print '</td>'."\n";
289
290 print '<td class="center">';
291 if (getDolGlobalString('USER_PASSWORD_GENERATED') == $key) {
292 //print img_picto('', 'tick');
293 print img_picto($langs->trans("Enabled"), 'switch_on');
294 } else {
295 print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&token='.newToken().'&value='.$key.'">';
296 //print $langs->trans("Activate");
297 print img_picto($langs->trans("Disabled"), 'switch_off');
298 print '</a>';
299 }
300 print "</td></tr>\n";
301 }
302}
303print '</table>';
304print '</div>';
305
306print '</form>';
307
308
309// Pattern for Password Perso
310if (getDolGlobalString('USER_PASSWORD_GENERATED') == "Perso") {
311 print '<br>';
312
313 print '<div class="div-table-responsive-no-min">';
314 print '<table class="noborder centpercent">';
315 print '<tr class="liste_titre">';
316 print '<td colspan="2"> '.$langs->trans("PasswordPatternDesc").'</td>';
317 print '</tr>';
318
319
320 $minlengthallowed = getPasswordPatternMinLength();
321 print '<tr class="oddeven">';
322 print '<td>'.$langs->trans("MinLength");
323 if ($minlengthallowed > 1) {
324 print ' <span class="opacitymedium">('.$langs->trans("PasswordPatternMinLengthRestricted", $minlengthallowed).')</span>';
325 }
326 print "</td>";
327 print '<td><input type="number" class="width50 right" value="'.$tabConf[0].'" id="minlength" min="'.$minlengthallowed.'"></td>';
328 print '</tr>';
329
330
331 print '<tr class="oddeven">';
332 print '<td>'.$langs->trans("NbMajMin")."</td>";
333 print '<td><input type="number" class="width50 right" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>';
334 print '</tr>';
335
336
337 print '<tr class="oddeven">';
338 print '<td>'.$langs->trans("NbNumMin")."</td>";
339 print '<td><input type="number" class="width50 right" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>';
340 print '</tr>';
341
342
343 print '<tr class="oddeven">';
344 print '<td>'.$langs->trans("NbSpeMin")."</td>";
345 print '<td><input type="number" class="width50 right" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>';
346 print '</tr>';
347
348
349 print '<tr class="oddeven">';
350 print '<td>'.$langs->trans("NbIteConsecutive")."</td>";
351 print '<td><input type="number" class="width50 right" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>';
352 print '</tr>';
353
354
355 print '<tr class="oddeven">';
356 print '<td>'.$langs->trans("NoAmbiCaracAutoGeneration")."</td>";
357 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>';
358 print '</tr>';
359
360 print '</table>';
361
362 print '<div class="center">';
363 print '<a class="button button-save" id="linkChangePattern">'.$langs->trans("Save").'</a>';
364 print '</div>';
365
366 print '<br><br>';
367
368 print '<script type="text/javascript">';
369 print ' function getStringArg(){';
370 print ' var pattern = "";';
371 print ' pattern += $("#minlength").val() + ";";';
372 print ' pattern += $("#NbMajMin").val() + ";";';
373 print ' pattern += $("#NbNumMin").val() + ";";';
374 print ' pattern += $("#NbSpeMin").val() + ";";';
375 print ' pattern += $("#NbIteConsecutive").val() + ";";';
376 print ' pattern += $("#NoAmbiCaracAutoGeneration")[0].checked ? "1" : "0";';
377 print ' return pattern;';
378 print ' }';
379
380 print ' function valuePossible(){';
381 print ' var fields = ["#minlength", "#NbMajMin", "#NbNumMin", "#NbSpeMin", "#NbIteConsecutive"];';
382 print ' for(var i = 0 ; i < fields.length ; i++){';
383 print ' if($(fields[i]).val() < $(fields[i]).attr("min")){';
384 print ' return false;';
385 print ' }';
386 print ' }';
387 print ' ';
388 print ' var length = parseInt($("#minlength").val());';
389 print ' var length_mini = parseInt($("#NbMajMin").val()) + parseInt($("#NbNumMin").val()) + parseInt($("#NbSpeMin").val());';
390 print ' return length >= length_mini;';
391 print ' }';
392
393 print ' function generatelink(){';
394 print ' return "security.php?action=updatepattern&token='.newToken().'&pattern="+getStringArg();';
395 print ' }';
396
397 print ' function valuePatternChange(){';
398 print ' console.log("valuePatternChange");';
399 print ' var lang_save = "'.$langs->trans("Save").'";';
400 print ' var lang_error = "'.$langs->trans("Error").'";';
401 print ' var lang_Disabled = "'.$langs->trans("Disabled").'";';
402 print ' var lang_Activated = "'.$langs->trans("Activated").'";';
403 print ' $("#textcheckbox").html($("#NoAmbiCaracAutoGeneration")[0].checked ? unescape(lang_Activated) : unescape(lang_Disabled));';
404 print ' if(valuePossible()){';
405 print ' $("#linkChangePattern").attr("href",generatelink()).text(lang_save);';
406 print ' }';
407 print ' else{';
408 print ' $("#linkChangePattern").attr("href", null).text(lang_error);';
409 print ' }';
410 print ' }';
411
412 print ' $("#minlength").change(function(){valuePatternChange();});';
413 print ' $("#NbMajMin").change(function(){valuePatternChange();});';
414 print ' $("#NbNumMin").change(function(){valuePatternChange();});';
415 print ' $("#NbSpeMin").change(function(){valuePatternChange();});';
416 print ' $("#NbIteConsecutive").change(function(){valuePatternChange();});';
417 print ' $("#NoAmbiCaracAutoGeneration").change(function(){valuePatternChange();});';
418
419 print '</script>';
420}
421
422
423// Crypt passwords in database
424
425print '<br>';
426print '<form method="post" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'" spellcheck="false">';
427print '<input type="hidden" name="token" value="'.newToken().'">';
428print '<input type="hidden" name="action" value="encrypt">';
429
430print '<table class="noborder centpercent">';
431print '<tr class="liste_titre">';
432print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
433print '<td class="center">'.$langs->trans("Activated").'</td>';
434print '<td class="center"></td>';
435print '</tr>';
436
437// Disable clear password in database
438print '<tr class="oddeven">';
439print '<td colspan="3">'.$langs->trans("DoNotStoreClearPassword").'</td>';
440print '<td class="center" width="60">';
441if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
442 print img_picto($langs->trans("Active"), 'tick');
443}
444print '</td>';
445if (!getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
446 print '<td class="center" width="100">';
447 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_encrypt&token='.newToken().'">'.$langs->trans("Activate").'</a>';
448 print "</td>";
449} else {
450 print '<td class="center" width="100">';
451 if ($allow_disable_encryption) {
452 //Do not allow "disable encryption" as passwords cannot be decrypted
453 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_encrypt&token='.newToken().'">'.$langs->trans("Disable").'</a>';
454 } else {
455 print '<span class="opacitymedium">'.$langs->trans("Always").'</span>';
456 }
457 print "</td>";
458}
459print "</td>";
460print '</tr>';
461
462
463// Crypt password into config file conf.php
464
465print '<tr class="oddeven">';
466print '<td colspan="3">'.$langs->trans("MainDbPasswordFileConfEncrypted").'</td>';
467print '<td align="center" width="60">';
468if (preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
469 print img_picto($langs->trans("Active"), 'tick');
470}
471
472print '</td>';
473
474print '<td class="center" width="100">';
475if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
476 $langs->load("errors");
477 print img_warning($langs->trans("WarningPassIsEmpty"));
478} else {
479 if (empty($dolibarr_main_db_encrypted_pass)) {
480 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Activate").'</a>';
481 }
482 if (!empty($dolibarr_main_db_encrypted_pass)) {
483 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Disable").'</a>';
484 }
485}
486print "</td>";
487
488print "</td>";
489print '</tr>';
490
491
492// Disable link "Forget password" on logon
493
494print '<tr class="oddeven">';
495print '<td colspan="3">'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").'</td>';
496print '<td class="center" width="60">';
497if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
498 print img_picto($langs->trans("Active"), 'tick');
499}
500print '</td>';
501if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
502 print '<td class="center" width="100">';
503 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Activate").'</a>';
504 print "</td>";
505}
506if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
507 print '<td class="center" width="100">';
508 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Disable").'</a>';
509 print "</td>";
510}
511print "</td>";
512print '</tr>';
513
514
515print '</table>';
516
517print '</form>';
518
519print '<br>';
520
521if (GETPOSTINT('info') > 0) {
522 if (function_exists('password_hash')) {
523 print $langs->trans("Note: The function password_hash exists on your PHP")."<br>\n";
524 } else {
525 print $langs->trans("Note: The function password_hash does not exist on your PHP")."<br>\n";
526 }
527 print 'MAIN_SECURITY_HASH_ALGO = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO')."<br>\n";
528 print 'MAIN_SECURITY_SALT = '.getDolGlobalString('MAIN_SECURITY_SALT')."<br>\n";
529}
530
531print '</div>';
532
533// End of page
534llxFooter();
535$db->close();
security_prepare_head()
Prepare array with list of tabs.
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
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
Class to manage generation of HTML components Only common components must be here.
if(! $sortfield) if(! $sortorder) $module
Definition list.php:193
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
Definition html.lib.php:540
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getPasswordPatternMinLength()
Return the lowest value allowed for the minimum length (first field of USER_PASSWORD_PATTERN) of the ...
encodedecode_dbpassconf($level=0)
Encode or decode database password in config file.
isPasswordGenerationNoneForbidden()
Return if the 'none' password generation model (the one that applies no rule at all) is forbidden on ...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
dol_hash($chain, $type='0', $nosalt=0, $mode=0)
Returns a hash (non reversible encryption) of a string.
dolEncrypt($chain, $key='', $ciphering='', $forceseed='', $obfuscationmode='dolcrypt')
Encode a string with a symmetric encryption.