diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 7c9c8aa2ef1..e0a4bc85f0e 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -46,17 +46,20 @@ $boxes = array(); */ if ($action == 'addconst') - { dolibarr_set_const($db, "MAIN_BOXES_MAXLINES",$_POST["MAIN_BOXES_MAXLINES"],'',0,'',$conf->entity); } -if ($action == 'add') { +if ($action == 'add') +{ $error=0; $db->begin(); - if (isset($_POST['boxid']) && is_array($_POST['boxid'])) { - foreach($_POST['boxid'] as $boxid) { - if ($boxid['active']=='on') { + if (isset($_POST['boxid']) && is_array($_POST['boxid'])) + { + foreach($_POST['boxid'] as $boxid) + { + if (is_numeric($boxid['pos']) && $boxid['pos'] >= 0) // 0=Home, 1=... + { $pos = $boxid['pos']; // Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos") @@ -330,7 +333,7 @@ print '