Fix test on token is not done for login page.
This commit is contained in:
parent
73e55f1b73
commit
3fab4696ae
@ -432,10 +432,12 @@ if (!defined('NOTOKENRENEWAL')) {
|
||||
// Check token
|
||||
if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN))
|
||||
|| defined('CSRFCHECK_WITH_TOKEN')) { // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page
|
||||
// Check all cases that need a token (all POST actions, all actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set, all sensitive GET actions)
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST' ||
|
||||
((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) ||
|
||||
in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check'))) {
|
||||
// Check all cases that need a token (all POST actions + all login, actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set + all sensitive GET actions)
|
||||
if (
|
||||
$_SERVER['REQUEST_METHOD'] == 'POST' ||
|
||||
((GETPOSTISSET('actionlogin') || GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) ||
|
||||
in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_reject_check'))
|
||||
) {
|
||||
if (!GETPOSTISSET('token')) {
|
||||
if (GETPOST('uploadform', 'int')) {
|
||||
dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." refused. File size too large.");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user