28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
42$langs->loadLangs(array(
"users",
"admin",
"other"));
48$action =
GETPOST(
'action',
'aZ09');
56if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
60 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
65} elseif (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
68 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
73} elseif ($action ==
'updateform') {
79 if (GETPOSTISSET(
'MAIN_APPLICATION_TITLE')) {
82 if (GETPOSTISSET(
'MAIN_SESSION_TIMEOUT')) {
85 if (GETPOSTISSET(
'MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT')) {
86 $res3 =
dolibarr_set_const($db,
"MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT",
GETPOST(
"MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT",
'alphanohtml'),
'int', 0,
'',
$conf->entity);
88 if (GETPOSTISSET(
'MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS')) {
89 $res4 =
dolibarr_set_const($db,
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS",
GETPOST(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS",
'alphanohtml'),
'int', 0,
'',
$conf->entity);
91 if (GETPOSTISSET(
'MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS')) {
92 $res5 =
dolibarr_set_const($db,
"MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS",
GETPOST(
"MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS",
'alphanohtml'),
'int', 0,
'',
$conf->entity);
94 if ($res1 && $res2 && $res3 && $res4 && $res5) {
95 setEventMessages($langs->trans(
"RecordModifiedSuccessfully"),
null,
'mesgs');
105$form =
new Form($db);
107$wikihelp =
'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
108llxHeader(
'', $langs->trans(
"Miscellaneous"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-security_other');
112print
'<span class="opacitymedium">'.$langs->trans(
"MiscellaneousDesc").
"</span><br>\n";
117print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
118print
'<input type="hidden" name="token" value="'.newToken().
'">';
119print
'<input type="hidden" name="action" value="updateform">';
128print
'<table class="noborder centpercent">';
129print
'<tr class="liste_titre">';
130print
'<td colspan="3">'.$langs->trans(
"Parameters").
'</td>';
131print
'<td class="right" width="100">'.$langs->trans(
"Status").
'</td>';
135print
'<tr class="oddeven">';
136print
'<td colspan="3">'.$langs->trans(
"UseAdvancedPerms").
'</td>';
137print
'<td class="right">';
138if (!empty(
$conf->use_javascript_ajax)) {
139 print ajax_constantonoff(
'MAIN_USE_ADVANCED_PERMS');
142 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_MAIN_USE_ADVANCED_PERMS&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
144 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_MAIN_USE_ADVANCED_PERMS&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
156print
'<table width="100%" class="noborder">';
157print
'<tr class="liste_titre">';
158print
'<td colspan="2">'.$langs->trans(
"Parameters").
'</td>';
163$sessiontimeout = ini_get(
"session.gc_maxlifetime");
165 $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
167print
'<tr class="oddeven">';
168print
'<td>'.$langs->trans(
"SessionTimeOut").
'</td><td class="right">';
169if (ini_get(
"session.gc_probability") == 0) {
171 print $form->textwithpicto(
'', $langs->trans(
"SessionsPurgedByExternalSystem", get_cfg_var(
"session.gc_maxlifetime")));
173 print $form->textwithpicto(
'', $langs->trans(
"SessionExplanation", ini_get(
"session.gc_probability"), ini_get(
"session.gc_divisor"), ini_get(
"session.gc_maxlifetime")));
176print
'<td class="nowrap">';
177print
'<input class="flat right width50" name="MAIN_SESSION_TIMEOUT" type="text" value="'.getDolGlobalInt(
'MAIN_SESSION_TIMEOUT').
'"> '.strtolower($langs->trans(
"Seconds"));
181print
'<tr class="oddeven">';
182print
'<td>'.$langs->trans(
"MaxNumberOfImagesInGetPost").
'</td><td class="right">';
184print
'<td class="nowrap">';
185print
'<input class="flat right width50" name="MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT" type="text" value="'.getDolGlobalInt(
'MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT').
'"> '.strtolower($langs->trans(
"Images"));
189print
'<tr class="oddeven">';
190print
'<td>'.$langs->trans(
"MaxNumberOfPostOnPublicPagesByIP").
'</td><td class="right">';
192print
'<td class="nowrap">';
193print
'<input class="flat right width50" name="MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS" type="text" value="'.getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200).
'"> '.strtolower($langs->trans(
"Posts"));
197print
'<tr class="oddeven">';
198print
'<td>'.$langs->trans(
"MaxNumberOfAttachementOnForms").
'</td><td class="right">';
200print
'<td class="nowrap">';
201print
'<input class="flat right width50" name="MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS" type="text" value="'.getDolGlobalInt(
"MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS", 10).
'"> '.strtolower($langs->trans(
"Files"));
205print
'<tr class="oddeven">';
206print
'<td>'.$langs->trans(
"MaxNumberOfFailedAuth").
'</td><td class="right">';
208print
'<td class="nowrap">';
209print
'<input class="flat right width50" name="MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH" type="text" value="'.getDolGlobalInt(
"MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH", 100).
'"> '.$langs->trans(
"FailedAuth");
228print $form->buttonsSaveCancel(
"Modify",
'');
security_prepare_head()
Prepare array with list of tabs.
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.