From 1be9789c339c3bb0fcbe48c8a5f7b9be6072db1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Nov 2020 14:54:26 +0100 Subject: [PATCH] Fix unalterable logs --- htdocs/blockedlog/admin/blockedlog.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index b6ce9cda1bc..39725eae3b7 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -35,6 +35,8 @@ if (!$user->admin || empty($conf->blockedlog->enabled)) accessforbidden(); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +$withtab = GETPOST('withtab', 'int'); + /* * Actions @@ -49,7 +51,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) if (dolibarr_set_const($db, $code, $values, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"].($withtab ? '?withtab='.$withtab : '')); exit; } else { dol_print_error($db); @@ -61,7 +63,7 @@ if (preg_match('/del_(.*)/', $action, $reg)) $code = $reg[1]; if (dolibarr_del_const($db, $code, 0) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + Header("Location: ".$_SERVER["PHP_SELF"].($withtab ? '?withtab='.$withtab : '')); exit; } else { dol_print_error($db); @@ -79,15 +81,13 @@ $block_static = new BlockedLog($db); llxHeader('', $langs->trans("BlockedLogSetup")); $linkback = ''; -if (GETPOST('withtab', 'alpha')) -{ +if ($withtab) { $linkback = ''.$langs->trans("BackToModuleList").''; } print load_fiche_titre($langs->trans("ModuleSetup").' '.$langs->trans('BlockedLog'), $linkback); -if (GETPOST('withtab', 'alpha')) -{ +if ($withtab) { $head = blockedlogadmin_prepare_head(); print dol_get_fiche_head($head, 'blockedlog', '', -1); } @@ -114,21 +114,26 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) { print ''; print ''.$langs->trans("BlockedLogAuthorityUrl").img_info($langs->trans('BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote')).''; print ''; + print '
'; print ''; print ''; + print ''; print ''; print ''; print '
'; + print ''; } print ''; print ''.$langs->trans("BlockedLogDisableNotAllowedForCountry").''; print ''; + print '
'; print ''; print ''; +print ''; $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite"; $sql .= " FROM ".MAIN_DB_PREFIX."c_country"; @@ -168,7 +173,7 @@ print ''; print ''; -if (GETPOST('withtab', 'alpha')) +if ($withtab) { print dol_get_fiche_end(); }