40 if (is_numeric($key) && $key ==
'1')
42 $output_tab = array();
44 for ($i = 0; $i < $strlength; $i++)
46 $output_tab[$i] = chr(ord(substr($chain, $i, 1)) + 17);
48 $chain = implode(
"", $output_tab);
53 for ($i = 0; $i < $strlength; $i++)
55 $keychar = substr($key, ($i % strlen($key)) - 1, 1);
56 $result .= chr(ord(substr($chain, $i, 1)) + (ord($keychar) - 65));
61 return base64_encode($chain);
75 $chain = base64_decode($chain);
77 if (is_numeric($key) && $key ==
'1')
79 $output_tab = array();
81 for ($i = 0; $i < $strlength; $i++)
83 $output_tab[$i] = chr(ord(substr($chain, $i, 1)) - 17);
86 $chain = implode(
"", $output_tab);
91 for ($i = 0; $i < $strlength; $i++)
93 $keychar = substr($key, ($i % strlen($key)) - 1, 1);
94 $result .= chr(ord(substr($chain, $i, 1)) - (ord($keychar) - 65));
118 if (($type ==
'0' || $type ==
'auto') && !empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO ==
'password_hash' && function_exists(
'password_hash'))
120 return password_hash($chain, PASSWORD_DEFAULT);
124 if (!empty($conf->global->MAIN_SECURITY_SALT) && $type !=
'4' && $type !==
'md5openldap') $chain = $conf->global->MAIN_SECURITY_SALT.$chain;
126 if ($type ==
'1' || $type ==
'sha1')
return sha1($chain);
127 elseif ($type ==
'2' || $type ==
'sha1md5')
return sha1(md5($chain));
128 elseif ($type ==
'3' || $type ==
'md5')
return md5($chain);
129 elseif ($type ==
'4' || $type ==
'md5openldap')
return '{md5}'.base64_encode(mhash(MHASH_MD5, $chain));
130 elseif ($type ==
'5')
return hash(
'sha256', $chain);
131 elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO ==
'sha1')
return sha1($chain);
132 elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO ==
'sha1md5')
return sha1(md5($chain));
153 if ($type ==
'0' && !empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO ==
'password_hash' && function_exists(
'password_verify')) {
154 if ($hash[0] ==
'$')
return password_verify($chain, $hash);
155 elseif (strlen($hash) == 32)
return dol_verifyHash($chain, $hash,
'3');
156 elseif (strlen($hash) == 40)
return dol_verifyHash($chain, $hash,
'2');
161 return dol_hash($chain, $type) == $hash;
181 function restrictedArea($user, $features, $objectid = 0, $tableandshare =
'', $feature2 =
'', $dbt_keyfield =
'fk_soc', $dbt_select =
'rowid', $isdraft = 0)
191 $parentfortableentity =
'';
194 $originalfeatures = $features;
195 if ($features ==
'facturerec') $features =
'facture';
196 if ($features ==
'mo') $features =
'mrp';
197 if ($features ==
'member') $features =
'adherent';
198 if ($features ==
'subscription') { $features =
'adherent'; $feature2 =
'cotisation'; };
199 if ($features ==
'websitepage') { $features =
'website'; $tableandshare =
'website_page'; $parentfortableentity =
'fk_website@website'; }
200 if ($features ==
'project') $features =
'projet';
201 if ($features ==
'product') $features =
'produit';
204 $parameters = array(
'features'=>$features,
'originalfeatures'=>$originalfeatures,
'objectid'=>$objectid,
'dbt_select'=>$dbt_select,
'idtype'=>$dbt_select,
'isdraft'=>$isdraft);
205 $reshook = $hookmanager->executeHooks(
'restrictedArea', $parameters);
207 if (isset($hookmanager->resArray[
'result'])) {
214 if ($dbt_select !=
'rowid' && $dbt_select !=
'id') $objectid =
"'".$objectid.
"'";
217 $featuresarray = array($features);
218 if (preg_match(
'/&/', $features)) $featuresarray = explode(
"&", $features);
219 elseif (preg_match(
'/\|/', $features)) $featuresarray = explode(
"|", $features);
222 if (!empty($feature2)) $feature2 = explode(
"|", $feature2);
224 $listofmodules = explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
227 $readok = 1; $nbko = 0;
228 foreach ($featuresarray as $feature) {
229 $featureforlistofmodule = $feature;
230 if ($featureforlistofmodule ==
'produit') $featureforlistofmodule =
'product';
231 if (!empty($user->socid) && !empty($conf->global->MAIN_MODULES_FOR_EXTERNAL) && !in_array($featureforlistofmodule, $listofmodules)) {
232 $readok = 0; $nbko++;
236 if ($feature ==
'societe') {
237 if (!$user->rights->societe->lire && !$user->rights->fournisseur->lire) { $readok = 0; $nbko++; }
238 } elseif ($feature ==
'contact') {
239 if (!$user->rights->societe->contact->lire) { $readok = 0; $nbko++; }
240 } elseif ($feature ==
'produit|service') {
241 if (!$user->rights->produit->lire && !$user->rights->service->lire) { $readok = 0; $nbko++; }
242 } elseif ($feature ==
'prelevement') {
243 if (!$user->rights->prelevement->bons->lire) { $readok = 0; $nbko++; }
244 } elseif ($feature ==
'cheque') {
245 if (!$user->rights->banque->cheque) { $readok = 0; $nbko++; }
246 } elseif ($feature ==
'projet') {
247 if (!$user->rights->projet->lire && !$user->rights->projet->all->lire) { $readok = 0; $nbko++; }
248 } elseif ($feature ==
'payment') {
249 if (!$user->rights->facture->lire) { $readok = 0; $nbko++; }
250 } elseif ($feature ==
'payment_supplier') {
251 if (!$user->rights->fournisseur->facture->lire) { $readok = 0; $nbko++; }
252 } elseif (!empty($feature2)) {
254 foreach ($feature2 as $subfeature) {
255 if ($subfeature ==
'user' && $user->id == $objectid)
continue;
256 if (!empty($subfeature) && empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) { $tmpreadok = 0; } elseif (empty($subfeature) && empty($user->rights->$feature->lire) && empty($user->rights->$feature->read)) { $tmpreadok = 0; }
else { $tmpreadok = 1;
break; }
262 } elseif (!empty($feature) && ($feature !=
'user' && $feature !=
'usergroup')) {
263 if (empty($user->rights->$feature->lire)
264 && empty($user->rights->$feature->read)
265 && empty($user->rights->$feature->run)) { $readok = 0; $nbko++; }
270 if (preg_match(
'/\|/', $features) && $nbko < count($featuresarray)) $readok = 1;
276 $createok = 1; $nbko = 0;
277 $wemustcheckpermissionforcreate = (
GETPOST(
'sendit',
'alpha') ||
GETPOST(
'linkit',
'alpha') ||
GETPOST(
'action',
'aZ09') ==
'create' ||
GETPOST(
'action',
'aZ09') ==
'update');
278 $wemustcheckpermissionfordeletedraft = ((
GETPOST(
"action",
"aZ09") ==
'confirm_delete' &&
GETPOST(
"confirm",
"aZ09") ==
'yes') ||
GETPOST(
"action",
"aZ09") ==
'delete');
280 if ($wemustcheckpermissionforcreate || $wemustcheckpermissionfordeletedraft)
282 foreach ($featuresarray as $feature)
284 if ($feature ==
'contact') {
285 if (!$user->rights->societe->contact->creer) { $createok = 0; $nbko++; }
286 } elseif ($feature ==
'produit|service') {
287 if (!$user->rights->produit->creer && !$user->rights->service->creer) { $createok = 0; $nbko++; }
288 } elseif ($feature ==
'prelevement') {
289 if (!$user->rights->prelevement->bons->creer) { $createok = 0; $nbko++; }
290 } elseif ($feature ==
'commande_fournisseur') {
291 if (!$user->rights->fournisseur->commande->creer) { $createok = 0; $nbko++; }
292 } elseif ($feature ==
'banque') {
293 if (!$user->rights->banque->modifier) { $createok = 0; $nbko++; }
294 } elseif ($feature ==
'cheque') {
295 if (!$user->rights->banque->cheque) { $createok = 0; $nbko++; }
296 } elseif ($feature ==
'import') {
297 if (!$user->rights->import->run) { $createok = 0; $nbko++; }
298 } elseif ($feature ==
'ecm') {
299 if (!$user->rights->ecm->upload) { $createok = 0; $nbko++; }
300 } elseif (!empty($feature2)) {
301 foreach ($feature2 as $subfeature) {
302 if ($subfeature ==
'user' && $user->id == $objectid && $user->rights->user->self->creer)
continue;
303 if ($subfeature ==
'user' && $user->id == $objectid && $user->rights->user->self->password)
continue;
305 if (empty($user->rights->$feature->$subfeature->creer)
306 && empty($user->rights->$feature->$subfeature->write)
307 && empty($user->rights->$feature->$subfeature->create)) {
316 } elseif (!empty($feature)) {
318 if (empty($user->rights->$feature->creer)
319 && empty($user->rights->$feature->write)
320 && empty($user->rights->$feature->create)) {
328 if (preg_match(
'/\|/', $features) && $nbko < count($featuresarray)) $createok = 1;
336 if (
GETPOST(
'action',
'aZ09') ==
'confirm_create_user' &&
GETPOST(
"confirm",
'aZ09') ==
'yes')
338 if (!$user->rights->user->user->creer) $createuserok = 0;
345 $deleteok = 1; $nbko = 0;
346 if ((
GETPOST(
"action",
"aZ09") ==
'confirm_delete' &&
GETPOST(
"confirm",
"aZ09") ==
'yes') ||
GETPOST(
"action",
"aZ09") ==
'delete')
348 foreach ($featuresarray as $feature)
350 if ($feature ==
'contact')
352 if (!$user->rights->societe->contact->supprimer) $deleteok = 0;
353 } elseif ($feature ==
'produit|service')
355 if (!$user->rights->produit->supprimer && !$user->rights->service->supprimer) $deleteok = 0;
356 } elseif ($feature ==
'commande_fournisseur')
358 if (!$user->rights->fournisseur->commande->supprimer) $deleteok = 0;
359 } elseif ($feature ==
'banque')
361 if (!$user->rights->banque->modifier) $deleteok = 0;
362 } elseif ($feature ==
'cheque')
364 if (!$user->rights->banque->cheque) $deleteok = 0;
365 } elseif ($feature ==
'ecm')
367 if (!$user->rights->ecm->upload) $deleteok = 0;
368 } elseif ($feature ==
'ftp')
370 if (!$user->rights->ftp->write) $deleteok = 0;
371 } elseif ($feature ==
'salaries')
373 if (!$user->rights->salaries->delete) $deleteok = 0;
374 } elseif ($feature ==
'salaries')
376 if (!$user->rights->salaries->delete) $deleteok = 0;
377 } elseif (!empty($feature2))
379 foreach ($feature2 as $subfeature)
381 if (empty($user->rights->$feature->$subfeature->supprimer) && empty($user->rights->$feature->$subfeature->delete)) $deleteok = 0;
382 else { $deleteok = 1;
break; }
384 } elseif (!empty($feature))
387 if (empty($user->rights->$feature->supprimer)
388 && empty($user->rights->$feature->delete)
389 && empty($user->rights->$feature->run)) $deleteok = 0;
394 if (preg_match(
'/\|/', $features) && $nbko < count($featuresarray)) $deleteok = 1;
402 if (!empty($objectid) && $objectid > 0)
404 $ok =
checkUserAccessToObject($user, $featuresarray, $objectid, $tableandshare, $feature2, $dbt_keyfield, $dbt_select, $parentfortableentity);
405 $params = array(
'objectid' => $objectid,
'features' => join(
',', $featuresarray),
'features2' => $feature2);
427 function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableandshare =
'', $feature2 =
'', $dbt_keyfield =
'', $dbt_select =
'rowid', $parenttableforentity =
'')
436 $params = explode(
'&', $tableandshare);
437 $dbtablename = (!empty($params[0]) ? $params[0] :
'');
438 $sharedelement = (!empty($params[1]) ? $params[1] : $dbtablename);
440 foreach ($featuresarray as $feature)
445 if ($feature ==
'member') $feature =
'adherent';
446 if ($feature ==
'project') $feature =
'projet';
447 if ($feature ==
'task') $feature =
'projet_task';
449 $check = array(
'adherent',
'banque',
'bom',
'don',
'mrp',
'user',
'usergroup',
'payment',
'payment_supplier',
'product',
'produit',
'service',
'produit|service',
'categorie',
'resource',
'expensereport',
'holiday',
'website');
450 $checksoc = array(
'societe');
451 $checkother = array(
'contact',
'agenda');
452 $checkproject = array(
'projet',
'project');
453 $checktask = array(
'projet_task');
454 $nocheck = array(
'barcode',
'stock');
458 if (empty($dbtablename))
460 $dbtablename = $feature;
461 $sharedelement = (!empty($params[1]) ? $params[1] : $dbtablename);
465 if (in_array($feature, $check))
467 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
468 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
469 if (($feature ==
'user' || $feature ==
'usergroup') && !empty($conf->multicompany->enabled)) {
470 if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
471 if ($conf->entity == 1 && $user->admin && !$user->entity) {
472 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
473 $sql .=
" AND dbt.entity IS NOT NULL";
475 $sql .=
",".MAIN_DB_PREFIX.
"usergroup_user as ug";
476 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
477 $sql .=
" AND ((ug.fk_user = dbt.rowid";
478 $sql .=
" AND ug.entity IN (".getEntity(
'usergroup').
"))";
479 $sql .=
" OR dbt.entity = 0)";
482 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
483 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
487 if ($parenttableforentity && preg_match(
'/(.*)@(.*)/', $parenttableforentity, $reg)) {
488 $sql .=
", ".MAIN_DB_PREFIX.$reg[2].
" as dbtp";
489 $sql .=
" WHERE dbt.".$reg[1].
" = dbtp.rowid AND dbt.".$dbt_select.
" IN (".$objectid.
")";
490 $sql .=
" AND dbtp.entity IN (".getEntity($sharedelement, 1).
")";
492 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
493 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
496 } elseif (in_array($feature, $checksoc)) {
497 if ($user->socid > 0) {
499 if ($user->socid <> $objectid)
return false;
500 } elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && !$user->rights->societe->client->voir)) {
502 $sql =
"SELECT COUNT(sc.fk_soc) as nb";
503 $sql .=
" FROM (".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
504 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s)";
505 $sql .=
" WHERE sc.fk_soc IN (".$objectid.
")";
506 $sql .=
" AND sc.fk_user = ".$user->id;
507 $sql .=
" AND sc.fk_soc = s.rowid";
508 $sql .=
" AND s.entity IN (".getEntity($sharedelement, 1).
")";
509 } elseif (!empty($conf->multicompany->enabled)) {
511 $sql =
"SELECT COUNT(s.rowid) as nb";
512 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
513 $sql .=
" WHERE s.rowid IN (".$objectid.
")";
514 $sql .=
" AND s.entity IN (".getEntity($sharedelement, 1).
")";
516 } elseif (in_array($feature, $checkother))
519 if ($user->socid > 0)
521 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
522 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
523 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
524 $sql .=
" AND dbt.fk_soc = ".$user->socid;
526 elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && !$user->rights->societe->client->voir))
528 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
529 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
530 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON dbt.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
531 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
532 $sql .=
" AND (dbt.fk_soc IS NULL OR sc.fk_soc IS NOT NULL)";
533 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
535 elseif (!empty($conf->multicompany->enabled))
537 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
538 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
539 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
540 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
542 if ($feature ==
'agenda')
544 if ($objectid > 0 && empty($user->rights->agenda->allactions->read)) {
545 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
547 $action->fetch($objectid);
548 if ($action->authorid != $user->id && $action->userownerid != $user->id && !(array_key_exists($user->id, $action->userassigned))) {
553 } elseif (in_array($feature, $checkproject)) {
554 if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire))
556 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
557 $projectstatic =
new Project($db);
558 $tmps = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, 0);
559 $tmparray = explode(
',', $tmps);
560 if (!in_array($objectid, $tmparray))
return false;
562 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
563 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
564 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
565 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
567 } elseif (in_array($feature, $checktask)) {
568 if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire))
570 $task =
new Task($db);
571 $task->fetch($objectid);
573 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
574 $projectstatic =
new Project($db);
575 $tmps = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, 0);
576 $tmparray = explode(
',', $tmps);
577 if (!in_array($task->fk_project, $tmparray))
return false;
579 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
580 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
581 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
582 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
584 } elseif (!in_array($feature, $nocheck)) {
586 if ($user->socid > 0) {
587 if (empty($dbt_keyfield))
dol_print_error(
'',
'Param dbt_keyfield is required but not defined');
588 $sql =
"SELECT COUNT(dbt.".$dbt_keyfield.
") as nb";
589 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
590 $sql .=
" WHERE dbt.rowid IN (".$objectid.
")";
591 $sql .=
" AND dbt.".$dbt_keyfield.
" = ".$user->socid;
592 } elseif (!empty($conf->societe->enabled) && !$user->rights->societe->client->voir) {
594 if ($feature !=
'ticket') {
595 if (empty($dbt_keyfield))
dol_print_error(
'',
'Param dbt_keyfield is required but not defined');
596 $sql =
"SELECT COUNT(sc.fk_soc) as nb";
597 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
598 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
599 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
600 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
601 $sql .=
" AND sc.fk_soc = dbt.".$dbt_keyfield;
602 $sql .=
" AND sc.fk_user = ".$user->id;
605 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
606 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
607 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON sc.fk_soc = dbt.".$dbt_keyfield.
" AND sc.fk_user = ".$user->id;
608 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
609 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
610 $sql .=
" AND (sc.fk_user = ".$user->id.
" OR sc.fk_user IS NULL)";
613 elseif (!empty($conf->multicompany->enabled))
615 $sql =
"SELECT COUNT(dbt.".$dbt_select.
") as nb";
616 $sql .=
" FROM ".MAIN_DB_PREFIX.$dbtablename.
" as dbt";
617 $sql .=
" WHERE dbt.".$dbt_select.
" IN (".$objectid.
")";
618 $sql .=
" AND dbt.entity IN (".getEntity($sharedelement, 1).
")";
624 $resql = $db->query($sql);
627 $obj = $db->fetch_object(
$resql);
628 if (!$obj || $obj->nb < count(explode(
',', $objectid)))
return false;
649 function accessforbidden($message =
'', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null)
651 global $conf, $db, $user, $langs, $hookmanager;
652 if (!is_object($langs))
654 include_once DOL_DOCUMENT_ROOT.
'/core/class/translate.class.php';
656 $langs->setDefaultLang();
659 $langs->load(
"errors");
663 if (function_exists(
"llxHeader"))
llxHeader(
'');
666 print '<div class="error">';
667 if (!$message)
print $langs->trans(
"ErrorForbidden");
671 if (empty($showonlymessage))
673 global $action, $object;
674 if (empty($hookmanager))
678 $hookmanager->initHooks(array(
'main'));
680 $parameters = array(
'message'=>$message,
'params'=>$params);
681 $reshook = $hookmanager->executeHooks(
'getAccessForbiddenMessage', $parameters, $object, $action);
682 print $hookmanager->resPrint;
687 print $langs->trans(
"CurrentLogin").
': <font class="error">'.$user->login.
'</font><br>';
688 print $langs->trans(
"ErrorForbidden2", $langs->transnoentitiesnoconv(
"Home"), $langs->transnoentitiesnoconv(
"Users"));
690 print $langs->trans(
"ErrorForbidden3");
694 if ($printfooter && function_exists(
"llxFooter"))
llxFooter();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_hash($chain, $type= '0')
Returns a hash of a string.
dol_decode($chain, $key= '1')
Decode a base 64 encoded + specific delta change.
checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= '', $dbt_select= 'rowid', $parenttableforentity= '')
Check access by user to object.
Class to manage agenda events (actions)
dol_verifyHash($chain, $hash, $type= '0')
Compute a hash and compare it to the given one For backward compatibility reasons, if the hash is not in the password_hash format, we will try to match against md5 and sha1md5 If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function.
Class to manage projects.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
dol_encode($chain, $key= '1')
Encode a string with base 64 algorithm + specific delta change.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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 ...
Class to manage translations.
llxHeaderVierge()
Header function.
print
Draft customers invoices.
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.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...