@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | // if we set another view list mode, we keep it (till we change one more time) |
| 48 | 48 | if (GETPOSTISSET('mode')) { |
| 49 | 49 | $mode = GETPOST('mode', 'alpha'); |
| 50 | - if ($mode =='common' || $mode =='commonkanban') |
|
| 50 | + if ($mode == 'common' || $mode == 'commonkanban') |
|
| 51 | 51 | dolibarr_set_const($db, "MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode, 'chaine', 0, '', $conf->entity); |
| 52 | 52 | } else { |
| 53 | 53 | $mode = (!getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT') ? 'commonkanban' : $conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT); |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); |
| 542 | 542 | |
| 543 | 543 | // Start to show page |
| 544 | -$deschelp = ''; |
|
| 544 | +$deschelp = ''; |
|
| 545 | 545 | if ($mode == 'common' || $mode == 'commonkanban') { |
| 546 | 546 | $desc = $langs->trans("ModulesDesc", '{picto}'); |
| 547 | 547 | $desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}'); |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | <div id="category-tree-left"> |
| 1147 | 1147 | <ul class="tree"> |
| 1148 | 1148 | <?php |
| 1149 | - echo $dolistore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content |
|
| 1149 | + echo $dolistore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content |
|
| 1150 | 1150 | ?> |
| 1151 | 1151 | </ul> |
| 1152 | 1152 | </div> |
@@ -47,9 +47,10 @@ discard block |
||
| 47 | 47 | // if we set another view list mode, we keep it (till we change one more time) |
| 48 | 48 | if (GETPOSTISSET('mode')) { |
| 49 | 49 | $mode = GETPOST('mode', 'alpha'); |
| 50 | - if ($mode =='common' || $mode =='commonkanban') |
|
| 51 | - dolibarr_set_const($db, "MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode, 'chaine', 0, '', $conf->entity); |
|
| 52 | -} else { |
|
| 50 | + if ($mode =='common' || $mode =='commonkanban') { |
|
| 51 | + dolibarr_set_const($db, "MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode, 'chaine', 0, '', $conf->entity); |
|
| 52 | + } |
|
| 53 | + } else { |
|
| 53 | 54 | $mode = (!getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT') ? 'commonkanban' : $conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT); |
| 54 | 55 | } |
| 55 | 56 | |
@@ -534,9 +535,15 @@ discard block |
||
| 534 | 535 | $nbofactivatedmodules = count($conf->modules); |
| 535 | 536 | |
| 536 | 537 | $nbmodulesnotautoenabled = count($conf->modules); |
| 537 | -if (in_array('fckeditor', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 538 | -if (in_array('export', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 539 | -if (in_array('import', $conf->modules)) $nbmodulesnotautoenabled--; |
|
| 538 | +if (in_array('fckeditor', $conf->modules)) { |
|
| 539 | + $nbmodulesnotautoenabled--; |
|
| 540 | +} |
|
| 541 | +if (in_array('export', $conf->modules)) { |
|
| 542 | + $nbmodulesnotautoenabled--; |
|
| 543 | +} |
|
| 544 | +if (in_array('import', $conf->modules)) { |
|
| 545 | + $nbmodulesnotautoenabled--; |
|
| 546 | +} |
|
| 540 | 547 | |
| 541 | 548 | print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); |
| 542 | 549 | |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; |
| 45 | 45 | |
| 46 | 46 | // Load translation files required by the page |
| 47 | -$langsArray=array("errors", "admin", "mails", "languages"); |
|
| 47 | +$langsArray = array("errors", "admin", "mails", "languages"); |
|
| 48 | 48 | |
| 49 | 49 | if (isModEnabled('adherent')) { |
| 50 | - $langsArray[]='members'; |
|
| 50 | + $langsArray[] = 'members'; |
|
| 51 | 51 | } |
| 52 | 52 | if (isModEnabled('eventorganization')) { |
| 53 | - $langsArray[]='eventorganization'; |
|
| 53 | + $langsArray[] = 'eventorganization'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $langs->loadLangs($langsArray); |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | } |
| 1038 | 1038 | $sortfieldtouse = ($sortable ? $fieldlist[$field] : ''); |
| 1039 | 1039 | if ($sortfieldtouse == 'type_template') { |
| 1040 | - $sortfieldtouse.= 'type_template,lang,position,label'; |
|
| 1040 | + $sortfieldtouse .= 'type_template,lang,position,label'; |
|
| 1041 | 1041 | } |
| 1042 | 1042 | print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], $sortfieldtouse, ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $css.' '); |
| 1043 | 1043 | } |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | print '<tr class="oddeven nohover'.(in_array($tmpfieldlist, array('topic', 'joinfiles')) ? ' nobottom' : '').'" id="tr-'.$tmpfieldlist.'-'.$rowid.'">'; |
| 1096 | 1096 | print '<td colspan="10">'; |
| 1097 | 1097 | |
| 1098 | - $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); |
|
| 1098 | + $fieldsforcontent = array('topic', 'email_from', 'joinfiles', 'content'); |
|
| 1099 | 1099 | if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) { |
| 1100 | 1100 | $fieldsforcontent[] = 'content_lines'; |
| 1101 | 1101 | } |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | print '<input type="hidden" name="type_template" value="'.$obj->type_template.'">'; |
| 1409 | 1409 | print $obj->type_template; |
| 1410 | 1410 | } else { |
| 1411 | - print $form->selectarray('type_template', $elementList, (!empty($obj->type_template) ? $obj->type_template:''), 1, 0, 0, '', 0, 0, 0, '', 'minwidth75 maxwidth125', 1, '', 0, 1); |
|
| 1411 | + print $form->selectarray('type_template', $elementList, (!empty($obj->type_template) ? $obj->type_template : ''), 1, 0, 0, '', 0, 0, 0, '', 'minwidth75 maxwidth125', 1, '', 0, 1); |
|
| 1412 | 1412 | } |
| 1413 | 1413 | print '</td>'; |
| 1414 | 1414 | } elseif ($context == 'add' && in_array($value, array('topic', 'joinfiles', 'content', 'content_lines'))) { |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | print $form->selectyesno($value, (isset($obj->$value) ? $obj->$value : ''), 1); |
| 1450 | 1450 | } |
| 1451 | 1451 | } else { |
| 1452 | - print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'. $value .'">'; |
|
| 1452 | + print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'.$value.'">'; |
|
| 1453 | 1453 | } |
| 1454 | 1454 | print '</td>'; |
| 1455 | 1455 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $todisabletext = ''; |
| 137 | 137 | $i = 0; |
| 138 | 138 | foreach ($arrayoffunctionstodisable as $functiontodisable) { |
| 139 | - if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) { |
|
| 139 | + if (!in_array($functiontodisable, $arrayoffunctionsdisabled)) { |
|
| 140 | 140 | if ($i > 0) { |
| 141 | 141 | $todisabletext .= ', '; |
| 142 | 142 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $todisabletext = ''; |
| 152 | 152 | $i = 0; |
| 153 | 153 | foreach ($arrayoffunctionstodisable2 as $functiontodisable) { |
| 154 | - if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) { |
|
| 154 | + if (!in_array($functiontodisable, $arrayoffunctionsdisabled)) { |
|
| 155 | 155 | if ($i > 0) { |
| 156 | 156 | $todisabletext .= ', '; |
| 157 | 157 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | print '<br>'; |
| 229 | 229 | print '<br>'; |
| 230 | 230 | |
| 231 | -print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php |
|
| 231 | +print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php |
|
| 232 | 232 | $perms = fileperms($dolibarr_main_document_root.'/'.$conffile); |
| 233 | 233 | if ($perms) { |
| 234 | 234 | if (($perms & 0x0004) || ($perms & 0x0002)) { |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | if (!getDolGlobalString('MAIN_ANTIVIRUS_COMMAND')) { |
| 429 | 429 | print ' - <span class="opacitymedium">'.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transnoentitiesnoconv("Setup")." - ".$langs->transnoentitiesnoconv("Security")).'</span>'; |
| 430 | 430 | } else { |
| 431 | - print ' - ' . getDolGlobalString('MAIN_ANTIVIRUS_COMMAND'); |
|
| 431 | + print ' - '.getDolGlobalString('MAIN_ANTIVIRUS_COMMAND'); |
|
| 432 | 432 | if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { |
| 433 | 433 | print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>'; |
| 434 | 434 | } |
@@ -439,11 +439,11 @@ discard block |
||
| 439 | 439 | $umask = getDolGlobalString('MAIN_UMASK'); |
| 440 | 440 | |
| 441 | 441 | print '<strong>'.$langs->trans("UMask").'</strong>: '; |
| 442 | -if (! in_array($umask, array('600', '660', '0600', '0660'))) { |
|
| 442 | +if (!in_array($umask, array('600', '660', '0600', '0660'))) { |
|
| 443 | 443 | print img_warning().' '; |
| 444 | 444 | } |
| 445 | 445 | print $umask; |
| 446 | -if (! in_array($umask, array('600', '660', '0600', '0660'))) { |
|
| 446 | +if (!in_array($umask, array('600', '660', '0600', '0660'))) { |
|
| 447 | 447 | print ' <span class="opacitymedium">('.$langs->trans("Recommended").': 0600 | 0660)</span>'; |
| 448 | 448 | } |
| 449 | 449 | print '<br>'; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha'); |
| 54 | 54 | $contactbulkdefault = GETPOST('MAILING_CONTACT_DEFAULT_BULK_STATUS', 'int'); |
| 55 | 55 | if (GETPOST('MAILING_DELAY', 'alpha') != '') { |
| 56 | - $mailingdelay = price2num(GETPOST('MAILING_DELAY', 'alpha'), 3); // Not less than 1 millisecond. |
|
| 56 | + $mailingdelay = price2num(GETPOST('MAILING_DELAY', 'alpha'), 3); // Not less than 1 millisecond. |
|
| 57 | 57 | } else { |
| 58 | 58 | $mailingdelay = ''; |
| 59 | 59 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | print '<tr class="oddeven"><td>'; |
| 141 | 141 | $help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); |
| 142 | 142 | print $langs->trans("MailingEMailFrom").' '.$help.'</td><td>'; |
| 143 | -print '<input class="minwidth100" type="text" name="MAILING_EMAIL_FROM" value="' . getDolGlobalString('MAILING_EMAIL_FROM').'">'; |
|
| 143 | +print '<input class="minwidth100" type="text" name="MAILING_EMAIL_FROM" value="'.getDolGlobalString('MAILING_EMAIL_FROM').'">'; |
|
| 144 | 144 | if (getDolGlobalString('MAILING_EMAIL_FROM') && !isValidEmail($conf->global->MAILING_EMAIL_FROM)) { |
| 145 | 145 | print ' '.img_warning($langs->trans("BadEMail")); |
| 146 | 146 | } |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | // default blacklist from mailing |
| 183 | 183 | print '<tr class="oddeven">'; |
| 184 | -print '<td>' . $langs->trans("DefaultBlacklistMailingStatus", $langs->transnoentitiesnoconv("No_Email")) . '</td>'; |
|
| 184 | +print '<td>'.$langs->trans("DefaultBlacklistMailingStatus", $langs->transnoentitiesnoconv("No_Email")).'</td>'; |
|
| 185 | 185 | print '<td>'; |
| 186 | -$blacklist_setting=array(0=>$langs->trans('No'), 1=>$langs->trans('Yes'), 2=>$langs->trans('DefaultStatusEmptyMandatory')); |
|
| 186 | +$blacklist_setting = array(0=>$langs->trans('No'), 1=>$langs->trans('Yes'), 2=>$langs->trans('DefaultStatusEmptyMandatory')); |
|
| 187 | 187 | print $form->selectarray("MAILING_CONTACT_DEFAULT_BULK_STATUS", $blacklist_setting, $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS); |
| 188 | 188 | print '</td>'; |
| 189 | 189 | print '<td class="hideonsmartphone"></td>'; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php'; |
| 93 | 93 | |
| 94 | -call_user_func(function () { |
|
| 94 | +call_user_func(function() { |
|
| 95 | 95 | $loader = Luracast\Restler\AutoLoader::instance(); |
| 96 | 96 | spl_autoload_register($loader); |
| 97 | 97 | return $loader; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // Enable and test if module Api is enabled |
| 115 | -if (!isModEnabled('api') ) { |
|
| 115 | +if (!isModEnabled('api')) { |
|
| 116 | 116 | $langs->load("admin"); |
| 117 | 117 | dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled"); |
| 118 | 118 | print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>'; |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | // If MAIN_API_DEBUG is set to 1, we save logs into file "dolibarr_api.log" |
| 170 | 170 | if (getDolGlobalString('MAIN_API_DEBUG')) { |
| 171 | 171 | $r = $api->r; |
| 172 | - $r->onCall(function () use ($r) { |
|
| 172 | + $r->onCall(function() use ($r) { |
|
| 173 | 173 | // Don't log Luracast Restler Explorer recources calls |
| 174 | 174 | //if (!preg_match('/^explorer/', $r->url)) { |
| 175 | 175 | // 'method' => $api->r->requestMethod, |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $allowedip = explode(' ', $conf->global->API_RESTRICT_ON_IP); |
| 202 | 202 | $ipremote = getUserRemoteIP(); |
| 203 | 203 | if (!in_array($ipremote, $allowedip)) { |
| 204 | - dol_syslog('Remote ip is '.$ipremote.', not into list ' . getDolGlobalString('API_RESTRICT_ON_IP')); |
|
| 204 | + dol_syslog('Remote ip is '.$ipremote.', not into list '.getDolGlobalString('API_RESTRICT_ON_IP')); |
|
| 205 | 205 | print 'APIs are not allowed from the IP '.$ipremote; |
| 206 | 206 | header('HTTP/1.1 503 API not allowed from your IP '.$ipremote); |
| 207 | 207 | //session_destroy(); |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - if (! $endpointisallowed) { |
|
| 357 | + if (!$endpointisallowed) { |
|
| 358 | 358 | dol_syslog('The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES', LOG_WARNING); |
| 359 | 359 | print 'The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES'; |
| 360 | 360 | header('HTTP/1.1 501 API is forbidden by API_ENDPOINT_RULES'); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
| 128 | - $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials. |
|
| 128 | + $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials. |
|
| 129 | 129 | if ($login === '--bad-login-validity--') { |
| 130 | 130 | $login = ''; |
| 131 | 131 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | // Generate token for user |
| 156 | - $token = dol_hash($login.uniqid().(!getDolGlobalString('MAIN_API_KEY')?'':$conf->global->MAIN_API_KEY), 1); |
|
| 156 | + $token = dol_hash($login.uniqid().(!getDolGlobalString('MAIN_API_KEY') ? '' : $conf->global->MAIN_API_KEY), 1); |
|
| 157 | 157 | |
| 158 | 158 | // We store API token into database |
| 159 | 159 | $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | //print "before decoding $val\n"; |
| 99 | 99 | do { |
| 100 | 100 | $oldval = $val; |
| 101 | - $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
| 101 | + $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
| 102 | 102 | // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser. |
| 103 | - $val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function ($m) { |
|
| 103 | + $val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function($m) { |
|
| 104 | 104 | // Decode 'n', ... |
| 105 | 105 | return realCharForNumericEntities($m); }, $val); |
| 106 | 106 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login |
| 139 | 139 | $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
| 140 | 140 | $inj += preg_match('/<svg/i', $val); // <svg can be allowed in POST |
| 141 | - $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
| 141 | + $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
| 142 | 142 | $inj += preg_match('/union.+select/i', $val); |
| 143 | 143 | } |
| 144 | 144 | if ($type == 3) { |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | session_set_cookie_params($sessioncookieparams); |
| 350 | 350 | } |
| 351 | 351 | session_name($sessionname); |
| 352 | - session_start(); // This call the open and read of session handler |
|
| 352 | + session_start(); // This call the open and read of session handler |
|
| 353 | 353 | //exit; // this exist generates a call to write and close |
| 354 | 354 | } |
| 355 | 355 | |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | $sessiontokenforthisurl = (empty($_SESSION['token']) ? '' : $_SESSION['token']); |
| 596 | 596 | // TODO Get the sessiontokenforthisurl into an array of session token (one array per base URL so we can use the CSRF per page and we keep ability for several tabs per url in a browser) |
| 597 | 597 | if (GETPOSTISSET('token') && GETPOST('token') != 'notrequired' && GETPOST('token', 'alpha') != $sessiontokenforthisurl) { |
| 598 | - dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".(empty($_SERVER['HTTP_REFERER'])?'':$_SERVER['HTTP_REFERER']).", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha'), LOG_WARNING); |
|
| 598 | + dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".(empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']).", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha'), LOG_WARNING); |
|
| 599 | 599 | //dol_syslog("_SESSION['token']=".$sessiontokenforthisurl, LOG_DEBUG); |
| 600 | 600 | // Do not output anything on standard output because this create problems when using the BACK button on browsers. So we just set a message into session. |
| 601 | 601 | if (!defined('NOTOKENRENEWAL')) { |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | unset($_GET['action']); |
| 612 | 612 | unset($_GET['confirmmassaction']); |
| 613 | 613 | unset($_GET['massaction']); |
| 614 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 614 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 615 | 615 | if (isset($savid)) { |
| 616 | 616 | $_POST['id'] = ((int) $savid); |
| 617 | 617 | } |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | |
| 779 | 779 | $allowedmethodtopostusername = 3; |
| 780 | 780 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
| 781 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 781 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 782 | 782 | } |
| 783 | 783 | // TODO Remove use of $_COOKIE['login_dolibarr'] ? Replace $usertotest = with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); |
| 784 | 784 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | if (!empty($_SERVER["HTTP_USER_AGENT"]) && $_SERVER["HTTP_USER_AGENT"] == 'securitytest') { |
| 902 | 902 | http_response_code(401); // It makes easier to understand if session was broken during security tests |
| 903 | 903 | } |
| 904 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 904 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 905 | 905 | } |
| 906 | 906 | exit; |
| 907 | 907 | } |
@@ -1246,7 +1246,7 @@ discard block |
||
| 1246 | 1246 | } else { |
| 1247 | 1247 | // We may have NOLOGIN set, but NOREQUIREUSER not |
| 1248 | 1248 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
| 1249 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1249 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1250 | 1250 | } |
| 1251 | 1251 | } |
| 1252 | 1252 | |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | |
| 1427 | 1427 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
| 1428 | 1428 | $message = GETPOST('seteventmessages', 'alpha'); |
| 1429 | - $messages = explode(',', $message); |
|
| 1429 | + $messages = explode(',', $message); |
|
| 1430 | 1430 | foreach ($messages as $key => $msg) { |
| 1431 | 1431 | $tmp = explode(':', $msg); |
| 1432 | 1432 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -2801,7 +2801,7 @@ discard block |
||
| 2801 | 2801 | $langs->load(explode('@', $item['name'])[1]); |
| 2802 | 2802 | $dropDownQuickAddHtml .= ' |
| 2803 | 2803 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
| 2804 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
| 2804 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
| 2805 | 2805 | '; |
| 2806 | 2806 | } |
| 2807 | 2807 | |
@@ -3645,7 +3645,7 @@ discard block |
||
| 3645 | 3645 | $forceping = GETPOST('forceping', 'alpha'); |
| 3646 | 3646 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
| 3647 | 3647 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
| 3648 | - $hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id); // Do not use dol_hash(), must not change if salt changes. |
|
| 3648 | + $hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id); // Do not use dol_hash(), must not change if salt changes. |
|
| 3649 | 3649 | |
| 3650 | 3650 | if (empty($conf->global->MAIN_FIRST_PING_OK_DATE) |
| 3651 | 3651 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && ($conf->global->MAIN_FIRST_PING_OK_ID != 'disabled')) |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | //include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
| 463 | 463 | |
| 464 | 464 | |
| 465 | -if (! ($object->id > 0)) { |
|
| 465 | +if (!($object->id > 0)) { |
|
| 466 | 466 | $langs->load("errors"); |
| 467 | 467 | print $langs->trans("ErrorRecordNotFound"); |
| 468 | 468 | } |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | |
| 1004 | 1004 | if ($adht->subscription) { |
| 1005 | 1005 | // Amount |
| 1006 | - print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.(GETPOSTISSET('subscription') ? GETPOST('subscription') : price($adht->amount, 0, '', 0)).'"> '.$langs->trans("Currency".$conf->currency) .'</td></tr>'; |
|
| 1006 | + print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.(GETPOSTISSET('subscription') ? GETPOST('subscription') : price($adht->amount, 0, '', 0)).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>'; |
|
| 1007 | 1007 | |
| 1008 | 1008 | // Label |
| 1009 | 1009 | print '<tr><td>'.$langs->trans("Label").'</td>'; |
@@ -1082,7 +1082,7 @@ discard block |
||
| 1082 | 1082 | if (!getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS') || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') { |
| 1083 | 1083 | print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>'; |
| 1084 | 1084 | } |
| 1085 | - if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product')|| isModEnabled('service'))) { |
|
| 1085 | + if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product') || isModEnabled('service'))) { |
|
| 1086 | 1086 | $prodtmp = new Product($db); |
| 1087 | 1087 | $result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); |
| 1088 | 1088 | if ($result < 0) { |
@@ -275,7 +275,7 @@ |
||
| 275 | 275 | |
| 276 | 276 | // Confirmation to delete subscription |
| 277 | 277 | if ($action == 'delete') { |
| 278 | - $formquestion=array(); |
|
| 278 | + $formquestion = array(); |
|
| 279 | 279 | //$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>'; |
| 280 | 280 | $text = $langs->trans("ConfirmDeleteSubscription"); |
| 281 | 281 | if (isModEnabled("banque") && getDolGlobalString('ADHERENT_BANK_USE')) { |