27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
33 $langs->loadLangs(array(
"users",
"admin",
"other"));
39 $action =
GETPOST(
'action',
'aZ09');
47 if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
51 Header(
"Location: ".$_SERVER[
"PHP_SELF"]);
56 } elseif (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
59 Header(
"Location: ".$_SERVER[
"PHP_SELF"]);
64 } elseif ($action ==
'updateform') {
65 $res1 = 1; $res2 = 1; $res3 = 1; $res4 = 1; $res5 = 1;
67 $res1 =
dolibarr_set_const($db,
"MAIN_APPLICATION_TITLE",
GETPOST(
"MAIN_APPLICATION_TITLE",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
70 $res2 =
dolibarr_set_const($db,
"MAIN_SESSION_TIMEOUT",
GETPOST(
"MAIN_SESSION_TIMEOUT",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
72 if (
GETPOSTISSET(
'MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT')) {
73 $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);
75 if (
GETPOSTISSET(
'MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS')) {
76 $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);
78 if (
GETPOSTISSET(
'MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS')) {
79 $res5 =
dolibarr_set_const($db,
"MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS",
GETPOST(
"MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS",
'alphanohtml'),
'int', 0,
'', $conf->entity);
81 if ($res1 && $res2 && $res3 && $res4 && $res5) {
82 setEventMessages($langs->trans(
"RecordModifiedSuccessfully"),
null,
'mesgs');
94 $wikihelp =
'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
99 print
'<span class="opacitymedium">'.$langs->trans(
"MiscellaneousDesc").
"</span><br>\n";
104 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
105 print
'<input type="hidden" name="token" value="'.newToken().
'">';
106 print
'<input type="hidden" name="action" value="updateform">';
115 print
'<table class="noborder centpercent">';
116 print
'<tr class="liste_titre">';
117 print
'<td colspan="3">'.$langs->trans(
"Parameters").
'</td>';
118 print
'<td class="right" width="100">'.$langs->trans(
"Status").
'</td>';
122 print
'<tr class="oddeven">';
123 print
'<td colspan="3">'.$langs->trans(
"UseCaptchaCode").
'</td>';
124 print
'<td class="right">';
125 if (function_exists(
"imagecreatefrompng")) {
126 if (!empty($conf->use_javascript_ajax)) {
129 if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) {
130 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_MAIN_SECURITY_ENABLECAPTCHA&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
132 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_MAIN_SECURITY_ENABLECAPTCHA&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
136 $desc =
$form->textwithpicto(
'', $langs->transnoentities(
"EnableGDLibraryDesc"), 1,
'warning');
142 print
'<tr class="oddeven">';
143 print
'<td colspan="3">'.$langs->trans(
"UseAdvancedPerms").
'</td>';
144 print
'<td class="right">';
145 if (!empty($conf->use_javascript_ajax)) {
148 if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
149 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_MAIN_USE_ADVANCED_PERMS&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
151 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_MAIN_USE_ADVANCED_PERMS&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
163 print
'<table width="100%" class="noborder">';
164 print
'<tr class="liste_titre">';
165 print
'<td colspan="2">'.$langs->trans(
"Parameters").
'</td>';
166 print
'<td>'.$langs->trans(
"Value").
'</td>';
170 $sessiontimeout = ini_get(
"session.gc_maxlifetime");
171 if (empty($conf->global->MAIN_SESSION_TIMEOUT)) {
172 $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
174 print
'<tr class="oddeven">';
175 print
'<td>'.$langs->trans(
"SessionTimeOut").
'</td><td class="right">';
176 if (ini_get(
"session.gc_probability") == 0) {
177 print
$form->textwithpicto(
'', $langs->trans(
"SessionsPurgedByExternalSystem", ini_get(
"session.gc_maxlifetime")));
179 print
$form->textwithpicto(
'', $langs->trans(
"SessionExplanation", ini_get(
"session.gc_probability"), ini_get(
"session.gc_divisor"), ini_get(
"session.gc_maxlifetime")));
182 print
'<td class="nowrap">';
183 print
'<input class="flat right width50" name="MAIN_SESSION_TIMEOUT" type="text" value="'.getDolGlobalInt(
'MAIN_SESSION_TIMEOUT').
'"> '.strtolower($langs->trans(
"Seconds"));
187 print
'<tr class="oddeven">';
188 print
'<td>'.$langs->trans(
"MaxNumberOfImagesInGetPost").
'</td><td class="right">';
190 print
'<td class="nowrap">';
191 print
'<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"));
195 print
'<tr class="oddeven">';
196 print
'<td>'.$langs->trans(
"MaxNumberOfPostOnPublicPagesByIP").
'</td><td class="right">';
198 print
'<td class="nowrap">';
199 print
'<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"));
203 print
'<tr class="oddeven">';
204 print
'<td>'.$langs->trans(
"MaxNumberOfAttachementOnForms").
'</td><td class="right">';
206 print
'<td class="nowrap">';
207 print
'<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"));
226 print
$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($actionsave) if(!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $wikihelp
View.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.