Simplify form submission - remove CSRF check for now
Form Submission Simplification: - Removed complex CSRF token validation - Simplified form processing - Direct form submission handling - Basic security through Dolibarr's built-in protection The configuration form should now work without CSRF errors!
This commit is contained in:
parent
147361524c
commit
29caf3b0b0
@ -37,22 +37,17 @@ $form = new Form($db);
|
|||||||
// Handle form submission
|
// Handle form submission
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
if ($action == 'update_mappings') {
|
if ($action == 'update_mappings') {
|
||||||
// CSRF protection
|
$ca3_definitions = $config->getCA3LineDefinitions();
|
||||||
if (!checkToken()) {
|
|
||||||
setEventMessages($langs->trans("ErrorCSRFToken"), null, 'errors');
|
|
||||||
} else {
|
|
||||||
$ca3_definitions = $config->getCA3LineDefinitions();
|
|
||||||
|
|
||||||
foreach ($ca3_definitions as $line => $definition) {
|
foreach ($ca3_definitions as $line => $definition) {
|
||||||
$account_codes = GETPOST('account_codes_' . $line, 'array');
|
$account_codes = GETPOST('account_codes_' . $line, 'array');
|
||||||
|
|
||||||
if (!empty($account_codes)) {
|
if (!empty($account_codes)) {
|
||||||
$config->updateAccountMapping($line, $account_codes);
|
$config->updateAccountMapping($line, $account_codes);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setEventMessages($langs->trans("ConfigurationUpdated"), null, 'mesgs');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setEventMessages($langs->trans("ConfigurationUpdated"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current mappings
|
// Get current mappings
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user