26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
32 $langs->loadLangs(array(
'users',
'admin',
'other'));
37 $action =
GETPOST(
'action',
'aZ09');
39 $upload_dir = $conf->admin->dir_temp;
46 if (
GETPOST(
'sendit') && !empty($conf->global->MAIN_UPLOAD_DOC))
48 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
53 if ($action ==
'updateform')
55 $antivircommand =
GETPOST(
'MAIN_ANTIVIRUS_COMMAND',
'restricthtml');
56 $antivirparam =
GETPOST(
'MAIN_ANTIVIRUS_PARAM',
'restricthtml');
62 $res5 =
dolibarr_set_const($db,
"MAIN_ANTIVIRUS_COMMAND", trim($antivircommand),
'chaine', 0,
'', $conf->entity);
63 $res6 =
dolibarr_set_const($db,
"MAIN_ANTIVIRUS_PARAM", trim($antivirparam),
'chaine', 0,
'', $conf->entity);
64 if ($res3 && $res4 && $res5 && $res6)
setEventMessages($langs->trans(
"RecordModifiedSuccessfully"), null,
'mesgs');
70 elseif ($action ==
'delete')
72 $langs->load(
"other");
73 $file = $conf->admin->dir_temp.
'/'.
GETPOST(
'urlfile',
'alpha');
77 Header(
'Location: '.
$_SERVER[
"PHP_SELF"]);
86 $form =
new Form($db);
88 $wikihelp =
'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
93 print '<span class="opacitymedium">'.$langs->trans(
"SecurityFilesDesc").
"</span><br>\n";
97 print '<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
98 print '<input type="hidden" name="token" value="'.newToken().
'">';
99 print '<input type="hidden" name="action" value="updateform">';
109 print '<div class="div-table-responsive-no-min">';
110 print '<table class="noborder centpercent">';
111 print '<tr class="liste_titre">';
112 print '<td colspan="2">'.$langs->trans(
"Parameters").
'</td>';
113 print '<td>'.$langs->trans(
"Value").
'</td>';
116 print '<tr class="oddeven">';
117 print '<td colspan="2">'.$langs->trans(
"MaxSizeForUploadedFiles").
'.';
118 $max = @ini_get(
'upload_max_filesize');
119 if ($max)
print ' '.$langs->trans(
"MustBeLowerThanPHPLimit", $max * 1024, $langs->trans(
"Kb")).
'.';
120 else print ' '.$langs->trans(
"NoMaxSizeByPHPLimit").
'.';
122 print '<td class="nowrap">';
123 print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).
'"> '.$langs->trans(
"Kb");
128 print '<tr class="oddeven">';
129 print '<td>'.$langs->trans(
"UMask").
'</td><td class="right">';
130 print $form->textwithpicto(
'', $langs->trans(
"UMaskExplanation"));
132 print '<td class="nowrap">';
133 print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).
'">';
139 print '<tr class="oddeven">';
140 print '<td colspan="2">'.$langs->trans(
"AntiVirusCommand").
'<br>';
141 print '<span class="opacitymedium">'.$langs->trans(
"AntiVirusCommandExample").
'</span>';
145 if (ini_get(
'safe_mode') && !empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
147 $langs->load(
"errors");
148 $basedir = preg_replace(
'/"/',
'', dirname($conf->global->MAIN_ANTIVIRUS_COMMAND));
149 $listdir = explode(
';', ini_get(
'safe_mode_exec_dir'));
150 if (!in_array($basedir, $listdir))
153 dol_syslog(
"safe_mode is on, basedir is ".$basedir.
", safe_mode_exec_dir is ".ini_get(
'safe_mode_exec_dir'), LOG_WARNING);
156 print '<input type="text" '.(defined(
'MAIN_ANTIVIRUS_COMMAND') ?
'disabled ' :
'').
'name="MAIN_ANTIVIRUS_COMMAND" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ?
dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_COMMAND) :
'').
'">';
157 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
158 print '<br><span class="opacitymedium">'.$langs->trans(
"ValueIsForcedBySystem").
'</span>';
165 print '<tr class="oddeven">';
166 print '<td colspan="2">'.$langs->trans(
"AntiVirusParam").
'<br>';
167 print '<span class="opacitymedium">'.$langs->trans(
"AntiVirusParamExample").
'</span>';
170 print '<input type="text" '.(defined(
'MAIN_ANTIVIRUS_PARAM') ?
'disabled ' :
'').
'name="MAIN_ANTIVIRUS_PARAM" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_PARAM) ?
dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_PARAM) :
'').
'">';
171 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
172 print '<br><span class="opacitymedium">'.$langs->trans(
"ValueIsForcedBySystem").
'</span>';
182 print '<div class="center"><input type="submit" class="button" name="button" value="'.$langs->trans(
"Modify").
'"></div>';
190 $formfile->form_attach_new_file(
$_SERVER[
'PHP_SELF'], $langs->trans(
"FormToTestFileUploadForm"), 0, 0, 1, 50,
'',
'', 1,
'', 0);
193 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'',
'name', SORT_ASC, 1);
194 $formfile->list_of_documents($filearray, null,
'admin_temp',
'');
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $wikihelp
View.
dol_string_nospecial($str, $newstr= '_', $badcharstoreplace= '')
Clean a string from all punctuation characters to use it as a ref or login.
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
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 ...
security_prepare_head()
Prepare array with list of tabs.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles= 'addedfile', $savingdocmask= '', $link=null, $trackid= '', $generatethumbs=1, $object=null)
Get and save an upload file (for example after submitting a new file a mail form).
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...