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