29require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
49$langs->loadLangs(array(
'admin',
'banks',
'bills',
'blockedlog',
'other'));
52$action =
GETPOST(
'action',
'aZ09');
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$optioncss =
GETPOST(
'optioncss',
'aZ');
60$search_showonlyerrors =
GETPOSTINT(
'search_showonlyerrors');
61if ($search_showonlyerrors < 0) {
62 $search_showonlyerrors = 0;
65$search_startyear =
GETPOSTINT(
'search_startyear');
66$search_startmonth =
GETPOSTINT(
'search_startmonth');
67$search_startday =
GETPOSTINT(
'search_startday');
69$search_endmonth =
GETPOSTINT(
'search_endmonth');
71$search_id =
GETPOST(
'search_id',
'alpha');
72$search_fk_user =
GETPOST(
'search_fk_user',
'intcomma');
74if (
GETPOST(
'search_startyear') !=
'') {
75 $search_start =
dol_mktime(0, 0, 0, $search_startmonth, $search_startday, $search_startyear);
78if (
GETPOST(
'search_endyear') !=
'') {
79 $search_end =
dol_mktime(23, 59, 59, $search_endmonth, $search_endday, $search_endyear);
81$search_code =
GETPOST(
'search_code',
'array:alpha');
82$search_ref =
GETPOST(
'search_ref',
'alpha');
83$search_amount =
GETPOST(
'search_amount',
'alpha');
84$search_signature =
GETPOST(
'search_signature',
'alpha');
86if (($search_start == -1 || empty($search_start)) && !GETPOSTISSET(
'search_startmonth') && !GETPOSTISSET(
'begin')) {
89 $search_startday = $tmparray[
'mday'];
90 $search_startmonth = $tmparray[
'mon'];
91 $search_startyear = $tmparray[
'year'];
96$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
97$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
99if (empty($page) || $page == -1) {
102$offset = $limit * $page;
103$pageprev = $page - 1;
104$pagenext = $page + 1;
106if (empty($sortfield)) {
107 $sortfield =
'rowid';
109if (empty($sortorder)) {
114$block_static->loadTrackedEvents();
117if ((!$user->admin && !$user->hasRight(
'blockedlog',
'read')) || !
isModEnabled(
'blockedlog')) {
122$user->rights->blockedlog->create = 1;
127$max_execution_time_for_importexport =
getDolGlobalInt(
'EXPORT_MAX_EXECUTION_TIME', 300);
128$max_time = @ini_get(
"max_execution_time");
129if ($max_time && $max_time < $max_execution_time_for_importexport) {
130 dol_syslog(
"max_execution_time=".$max_time.
" is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.
". We try to increase it dynamically.");
131 @ini_set(
"max_execution_time", $max_execution_time_for_importexport);
136$permission = $user->hasRight(
'blockedlog',
'read');
137$permissiontoadd = $user->hasRight(
'blockedlog',
'read');
138$permtoedit = $permissiontoadd;
152if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
154 $search_fk_user =
'';
157 $search_code = array();
160 $search_signature =
'';
161 $search_showonlyerrors = 0;
162 $search_startyear =
'';
163 $search_startmonth =
'';
164 $search_startday =
'';
165 $search_endyear =
'';
166 $search_endmonth =
'';
169 $search_array_options = array();
172include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
174if (
GETPOST(
'action') ==
'export' && $user->hasRight(
'blockedlog',
'read')) {
179 $periodnotcomplete = 0;
182 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Year")),
null,
"errors");
196 $periodnotcomplete = 1;
199 $suffixperiod = ($periodnotcomplete ?
'INCOMPLETE' :
'DONOTMODIFY');
203 $sql =
"SELECT rowid";
204 $sql .=
" FROM ".MAIN_DB_PREFIX.
"blockedlog";
205 $sql .=
" WHERE entity = ".((int) $conf->entity);
208 $sql .=
" AND date_creation BETWEEN '".$db->idate($dates).
"' AND '".$db->idate($datee).
"'";
209 $sql .=
" ORDER BY date_creation ASC, rowid ASC";
210 $sql .= $db->plimit(1);
212 $res = $db->query($sql);
215 $obj = $db->fetch_object($res);
217 $firstid = $obj->rowid;
218 $previoushash = $block_static->getPreviousHash(0, $firstid);
221 $previoushash =
'nodata';
231 $secretkey = $registrationnumber;
237 $nameofdownoadedfile =
"unalterable-log-archive-".$dolibarr_main_db_name.
"-".str_replace(
'-',
'', $yearmonthtoexport).
'-'.$yearmonthdateofexportstandard.
'UTC-'.$suffixperiod.
'.csv';
240 $tmpfile =
getMultidirOutput($block_static,
'blockedlog').
'/archives/'.$nameofdownoadedfile;
242 $formatexport =
'VE1';
256 $fh = fopen($tmpfile,
'w');
259 if (!$error && $fh) {
261 $sql =
"SELECT rowid, date_creation, tms, user_fullname, action, amounts_taxexcl, amounts, element, fk_object, date_object, ref_object,";
262 $sql .=
" signature, fk_user, object_data, object_version, object_format, debuginfo";
263 $sql .=
" FROM ".MAIN_DB_PREFIX.
"blockedlog";
264 $sql .=
" WHERE entity = ".((int) $conf->entity);
267 $sql .=
" AND date_creation BETWEEN '".$db->idate($dates).
"' AND '".$db->idate($datee).
"'";
268 $sql .=
" ORDER BY date_creation ASC, rowid ASC";
270 $resql = $db->query($sql);
273 fwrite($fh,
"BEGIN - date=".$yearmonthdateofexport.
" - period=".$yearmonthtoexport.($periodnotcomplete ?
'-'.$suffixperiod :
'').
" - formatexport=".$formatexport.
" - user=".$user->
getFullName($langs)
274 .
';'.$langs->transnoentities(
'Id')
275 .
';'.$langs->transnoentities(
'DateCreation')
276 .
';'.$langs->transnoentities(
'Action')
277 .
';'.$langs->transnoentities(
'Origin')
278 .
';'.$langs->transnoentities(
'AmountHT')
279 .
';'.$langs->transnoentities(
'AmountTTC')
280 .
';'.$langs->transnoentities(
'Ref')
281 .
';'.$langs->transnoentities(
'Date')
282 .
';'.$langs->transnoentities(
'User')
283 .
';'.$langs->transnoentities(
'LinkTo')
284 .
';'.$langs->transnoentities(
'LinkType')
285 .
';'.$langs->transnoentities(
'FullData')
286 .
';'.$langs->transnoentities(
'Version')
287 .
';'.$langs->transnoentities(
'VersionSignature')
288 .
';'.$langs->transnoentities(
'FingerprintDatabase')
289 .
';'.$langs->transnoentities(
'Status')
290 .
';'.$langs->transnoentities(
'FingerprintExport')
296 $refinvoicefound = array();
297 $totalhtamount = array();
298 $totalvatamount = array();
299 $totalamount = array();
301 while ($obj = $db->fetch_object($resql)) {
304 $block_static->id = $obj->rowid;
305 $block_static->entity = $obj->entity;
307 $block_static->date_creation = $db->jdate($obj->date_creation);
309 $block_static->module_source = $obj->module_source;
311 $block_static->amounts_taxexcl = (float) $obj->amounts_taxexcl;
312 $block_static->amounts = (float) $obj->amounts;
314 $block_static->action = $obj->action;
315 $block_static->date_object = $db->jdate($obj->date_object);
316 $block_static->ref_object = $obj->ref_object;
318 $block_static->user_fullname = $obj->user_fullname;
320 $block_static->object_data = $block_static->dolDecodeBlockedData($obj->object_data);
323 $block_static->signature = $obj->signature;
325 $block_static->element = $obj->element;
326 $block_static->fk_object = $obj->fk_object;
328 $block_static->fk_user = $obj->fk_user;
330 $block_static->date_modification = $db->jdate($obj->tms);
331 $block_static->object_version = $obj->object_version;
332 $block_static->object_format = $obj->object_format;
334 $block_static->certified = ($obj->certified == 1);
336 $block_static->linktoref = $obj->linktoref;
337 $block_static->linktype = $obj->linktype;
339 $block_static->debuginfo = $obj->debuginfo;
342 $checksignature = $block_static->checkSignature($previoushash);
344 if ($checksignature) {
345 $statusofrecord =
'Valid';
346 if ($loweridinerror > 0) {
347 $statusofrecordnote =
'ValidButFoundAPreviousKO';
349 $statusofrecordnote =
'';
352 $statusofrecord =
'KO';
353 $statusofrecordnote =
'LineCorruptedOrNotMatchingPreviousOne';
354 $loweridinerror = $obj->rowid;
358 $statusofrecordnote = $langs->trans(
"PreviousFingerprint").
': '.$previoushash.($statusofrecordnote ?
' - '.$statusofrecordnote :
'');
361 $concatenateddata = $block_static->buildKeyForSignature();
364 $signatureexport =
dol_hash($previoushash.$concatenateddata,
'sha256');
369 $total_ht = $total_vat = $total_ttc = 0;
370 sumAmountsForUnalterableEvent($block_static, $refinvoicefound, $totalhtamount, $totalvatamount, $totalamount, $total_ht, $total_vat, $total_ttc);
375 .csvClean($block_static->date_creation).
';'
376 .csvClean($block_static->action).
';'
377 .csvClean($block_static->module_source).
';'
378 .csvClean($block_static->amounts_taxexcl).
';'
379 .csvClean($block_static->amounts).
';'
380 .csvClean($block_static->ref_object).
';'
381 .csvClean($block_static->date_object).
';'
382 .csvClean($block_static->user_fullname).
';'
383 .csvClean($block_static->linktoref).
';'
384 .csvClean($block_static->linktype).
';'
385 .csvClean($obj->object_data).
';'
386 .csvClean($block_static->object_version).
';'
387 .csvClean($block_static->object_format).
';'
388 .csvClean($block_static->signature).
';'
389 .csvClean($statusofrecord).
';'
390 .csvClean($signatureexport).
';'.
"\n");
393 $previoushash = $obj->signature;
641 $sha256 = hash_file($algo, $tmpfile);
642 $hmacsha256 = hash_hmac_file($algo, $tmpfile, $secretkey);
645 file_put_contents($tmpfile,
'END - sha256='.$sha256.
' - hmac_sha256='.$hmacsha256, FILE_APPEND);
654 if ($periodnotcomplete) {
655 setEventMessages($langs->trans(
"ErrorPeriodMustBePastToAllowExport"),
null,
"warnings");
658 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
665 $object->entity = $conf->entity;
667 $object->fullname = $user->getFullName($langs);
669 $object->label =
'Export unalterable logs';
670 $object->period =
'year='.GETPOSTINT(
'yeartoexport').(GETPOSTINT(
'monthtoexport') ?
' month='.GETPOSTINT(
'monthtoexport') :
'');
672 $action =
'BLOCKEDLOG_EXPORT';
673 $result = $b->setObjectData($object, $action, 0, $user,
null);
677 setEventMessages(
'Failed to insert the export int the unalterable log',
null,
'errors');
681 $res = $b->create($user);
684 setEventMessages(
'Failed to insert the export int the unalterable log',
null,
'errors');
696$form =
new Form($db);
699if (
GETPOST(
'withtab',
'alpha')) {
700 $title = $langs->trans(
"ModuleSetup").
' '.$langs->trans(
'BlockedLog');
702 $title = $langs->trans(
"BrowseBlockedLog");
704$help_url =
"EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
706llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-blockedlog page-admin_blockedlog_list');
708$blocks = $block_static->getLog(
'all', (
int) $search_id, $MAXLINES, $sortfield, $sortorder, (
int) $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code, $search_signature);
709if (!is_array($blocks)) {
711 setEventMessages($langs->trans(
"TooManyRecordToScanRestrictFilters", $MAXLINES),
null,
'errors');
713 dol_print_error($block_static->db, $block_static->error, $block_static->errors);
719if (
GETPOST(
'withtab',
'alpha')) {
720 $linkback =
'<a href="'.dolBuildUrl($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
726$texttop =
'<small class="opacitymedium">'.$langs->trans(
"RegistrationNumber").
':</small> <small>'.
dol_trunc($registrationnumber, 10).
'</small>';
728print
load_fiche_titre($title.
'<br>'.$texttop, $linkback,
'blockedlog', 0,
'',
'', $morehtmlcenter);
737print
'<div class="opacitymedium hideonsmartphone justify">';
739print $langs->trans(
"ArchivesDesc").
"<br>";
745$htmltext .= $langs->trans(
"UnalterableLogTool2", $langs->transnoentities(
"Archives")).
"<br>";
746if (
$mysoc->country_code ==
'FR') {
747 $htmltext .=
'<br>'.$langs->trans(
"UnalterableLogTool1FR").
'<br>';
759 $param .=
'&contextpage='.urlencode($contextpage);
761if ($limit > 0 && $limit != $conf->liste_limit) {
762 $param .=
'&limit='.((int) $limit);
764if ($search_id !=
'') {
765 $param .=
'&search_id='.urlencode($search_id);
767if ($search_fk_user > 0) {
768 $param .=
'&search_fk_user='.urlencode($search_fk_user);
770if ($search_startyear > 0) {
771 $param .=
'&search_startyear='.((int) $search_startyear);
773if ($search_startmonth > 0) {
774 $param .=
'&search_startmonth='.((int) $search_startmonth);
776if ($search_startday > 0) {
777 $param .=
'&search_startday='.((int) $search_startday);
779if ($search_endyear > 0) {
780 $param .=
'&search_endyear='.((int) $search_endyear);
782if ($search_endmonth > 0) {
783 $param .=
'&search_endmonth='.((int) $search_endmonth);
785if ($search_endday > 0) {
786 $param .=
'&search_endday='.((int) $search_endday);
789 $param .=
'&search_amount='.urlencode($search_amount);
791if ($search_signature) {
792 $param .=
'&search_signature='.urlencode($search_signature);
794if ($search_showonlyerrors > 0) {
795 $param .=
'&search_showonlyerrors='.((int) $search_showonlyerrors);
797if ($optioncss !=
'') {
798 $param .=
'&optioncss='.urlencode($optioncss);
800if (
GETPOST(
'withtab',
'alpha')) {
801 $param .=
'&withtab='.urlencode(
GETPOST(
'withtab',
'alpha'));
807if ($action ==
'deletefile') {
808 $langs->load(
"companies");
809 print $form->formconfirm(
810 $_SERVER[
"PHP_SELF"].
'?urlfile='.urlencode(
GETPOST(
"urlfile")).
'&linkid='.
GETPOSTINT(
'linkid').(empty($param) ?
'' : $param),
811 $langs->trans(
'DeleteFile'),
812 $langs->trans(
'ConfirmDeleteFile'),
813 'confirm_deletefile',
821print
'<form method="POST" id="exportArchives" action="'.$_SERVER[
"PHP_SELF"].
'?output=file">';
822print
'<input type="hidden" name="token" value="'.newToken().
'">';
823print
'<input type="hidden" name="action" value="export">';
825print
'<div class="right">';
827print
'<span class="hideonsmartphone">'.$langs->trans(
"RestrictYearToExport").
': </span>';
829print $formother->select_month((
string)
GETPOSTINT(
'monthtoexport'),
'monthtoexport', $langs->trans(
"Month"), 0,
'minwidth50 maxwidth75imp valignmiddle',
true);
830print
'<input type="text" name="yeartoexport" class="valignmiddle maxwidth75imp" value="'.GETPOST(
'yeartoexport').
'" placeholder="'.$langs->trans(
"Year").
'">';
839print
'<input type="hidden" name="withtab" value="'.GETPOST(
'withtab',
'alpha').
'">';
840print
'<input type="submit" name="downloadcsv" class="button" value="'.$langs->trans(
'DownloadLogCSV').
'">';
867$filearray =
dol_dir_list($upload_dir,
'files', 0,
'',
null,
'name', SORT_ASC, 1);
869$modulepart =
'blockedlog';
870$relativepathwithnofile =
'archives/';
877include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
885$tmparray = $formfile->form_attach_new_file(
886 $_SERVER[
"PHP_SELF"],
891 $conf->browser->layout ==
'phone' ? 40 : 60,
906$formToUploadAFile =
'';
908if (is_array($tmparray) && !empty($tmparray)) {
909 $formToUploadAFile = $tmparray[
'formToUploadAFile'];
914$formfile->list_of_documents(
920 $relativepathwithnofile,
925 $langs->transnoentitiesnoconv(
'Archives'),
936 array(
'afteruploadtitle' => $formToUploadAFile,
'showhideaddbutton' => 1)
946print
'<script type="text/javascript">
948jQuery(document).ready(function () {
949 jQuery("#dialogforpopup").dialog({
951 classes: { "ui-dialog": "highlight" },
952 maxHeight: window.innerHeight-60,
953 height: window.innerHeight-60,
954 width: '.($conf->browser->layout ==
'phone' ? 400 : 700).
',
957 }).css("z-index: 5000");
959 $("a[rel=show-info]").click(function() {
960 console.log("We click on tooltip a[rel=show-info], we open popup and get content using an ajax call");
962 var fk_block = $(this).attr("data-blockid");
967 url:
"'.DOL_URL_ROOT.'/blockedlog/ajax/block-info.php?id="+fk_block,
969 }).done(
function(data) {
970 jQuery(
"#dialogforpopup").html(data);
973 var mydialog = jQuery(
"#dialogforpopup");
974 mydialog.dialog({autoOpen:
false, modal:
true, height: (window.innerHeight - 150), width: \
'80%\', title: \''.
dol_escape_js($langs->trans(
"UnlaterableDataOfEvent")).
'\',});
975 mydialog.dialog("open");
982if (
GETPOST(
'withtab',
'alpha')) {
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
sumAmountsForUnalterableEvent($block, &$refinvoicefound, &$totalhtamount, &$totalvatamount, &$totalamount, &$total_ht, &$total_vat, &$total_ttc)
sumAmountsForUnalterableEvent
getHashUniqueIdOfRegistration()
Return a hash unique identifier of the registration.
blockedlogadmin_prepare_head($withtabsetup)
Define head array for tabs of blockedlog tools setup pages.
Class to manage Blocked Log.
getFullName($langs, $option=0, $nameorder=-1, $maxlen=0)
Return full name (civility+' '+name+' '+lastname)
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
csvClean($newvalue, $charset='', $separator='')
Clean a cell to respect rules of CSV file cells.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
currentToken()
Return the value of token currently saved into session with name 'token'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
getDolDefaultContextPage($s)
Return the default context page string.
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')) if(!function_exists( 'str_starts_with')) if(!function_exists('str_ends_with')) if(!function_exists( 'str_contains')) getMultidirOutput($object, $module='', $forobject=0, $mode='output')
Return the full path of the directory where a module (or an object of a module) stores its files.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
isModEnabled($module)
Is Dolibarr module enabled.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_hash($chain, $type='0', $nosalt=0, $mode=0)
Returns a hash (non reversible encryption) of a string.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=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.