2
0
forked from Wavyzz/dolibarr

Add token on most GET url for admin action

This commit is contained in:
Laurent Destailleur
2020-09-30 15:13:28 +02:00
parent 805f06fe31
commit f442dac2c9
72 changed files with 249 additions and 247 deletions

View File

@@ -504,8 +504,8 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
if (empty($conf->use_javascript_ajax) || $forcenoajax)
{
if (empty($conf->global->$code)) print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_'.$code.'&entity='.$entity.'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
else print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_'.$code.'&entity='.$entity.'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
if (empty($conf->global->$code)) print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_'.$code.'&token='.newToken().'&entity='.$entity.'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
else print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_'.$code.'&token='.newToken().'&entity='.$entity.'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} else {
$out = "\n<!-- Ajax code to switch constant ".$code." -->".'
<script>