24 require
'../../main.inc.php';
25 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
27 $langs->load(
"admin");
32 $action =
GETPOST(
'action',
'aZ09');
33 $confirm =
GETPOST(
'confirm',
'alpha');
34 $choice =
GETPOST(
'choice',
'aZ09');
39 if (!empty($conf->syslog->enabled))
41 $filelog = $conf->global->SYSLOG_FILE;
42 $filelog = preg_replace(
'/DOL_DATA_ROOT/i', DOL_DATA_ROOT, $filelog);
49 if ($action ==
'purge' && !preg_match(
'/^confirm/i', $choice) && ($choice !=
'allfiles' || $confirm ==
'yes'))
53 if (!empty($ExecTimeLimit))
55 $err = error_reporting();
58 @set_time_limit($ExecTimeLimit);
59 error_reporting($err);
62 require_once DOL_DOCUMENT_ROOT.
'/core/class/utils.class.php';
63 $utils =
new Utils($db);
64 $result = $utils->purgeFiles($choice);
66 $mesg = $utils->output;
77 $form =
new Form($db);
81 print '<span class="opacitymedium">'.$langs->trans(
"PurgeAreaDesc", $dolibarr_main_data_root).
'</span><br>';
85 print '<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
86 print '<input type="hidden" name="token" value="'.newToken().
'" />';
87 print '<input type="hidden" name="action" value="purge" />';
89 print '<table class="border centpercent">';
91 print '<tr class="border"><td style="padding: 4px">';
93 if (!empty($conf->syslog->enabled)) {
94 print '<input type="radio" name="choice" id="choicelogfile" value="logfile"';
95 print ($choice && $choice ==
'logfile') ?
' checked' :
'';
96 $filelogparam = $filelog;
97 if ($user->admin && preg_match(
'/^dolibarr.*\.log$/', basename($filelog))) {
98 $filelogparam =
'<a class="wordbreak" href="'.DOL_URL_ROOT.
'/document.php?modulepart=logs&file=';
99 $filelogparam .= basename($filelog);
100 $filelogparam .=
'">'.$filelog.
'</a>';
102 $desc = $langs->trans(
"PurgeDeleteLogFile",
'{filelogparam}');
103 $desc = str_replace(
'{filelogparam}', $filelogparam, $desc);
104 print '> <label for="choicelogfile">'.$desc.
'</label>';
108 print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
109 print (!$choice || $choice ==
'tempfiles' || $choice ==
'allfiles') ?
' checked' :
'';
110 print '> <label for="choicetempfiles">'.$langs->trans(
"PurgeDeleteTemporaryFiles").
'</label><br><br>';
112 print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
113 print ($choice && $choice ==
'confirm_allfiles') ?
' checked' :
'';
114 print '> <label for="choiceallfiles">'.$langs->trans(
"PurgeDeleteAllFilesInDocumentsDir", $dolibarr_main_data_root).
'</label><br>';
116 print '</td></tr></table>';
121 print '<div class="center"><input class="button" type="submit" value="'.$langs->trans(
"PurgeRunNow").
'"></div>';
126 if (preg_match(
'/^confirm/i', $choice)) {
128 $formquestion = array();
129 print $form->formconfirm(
$_SERVER[
"PHP_SELF"].
'?choice=allfiles', $langs->trans(
'Purge'), $langs->trans(
'ConfirmPurge').img_warning().
' ',
'purge', $formquestion,
'no', 2);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage utility methods.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
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 ...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.