From 23064b6b7af1c19d32732a6e7f7c565c611e7e7a Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 26 May 2007 18:04:28 +0000 Subject: [PATCH] better skip algorithm for checkboxes on delete --- lam/lib/lists.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index f4920246..0f77cefb 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -459,14 +459,17 @@ class lamList { elseif (isset($_POST['del'])){ // search for checkboxes $accounts = array_keys($_POST, "on"); - // skip trans_primary box + // skip option boxes + $change = false; for ($i = 0; $i < sizeof($accounts); $i++) { - if ($accounts[$i] === 'trans_primary') { + if (!is_numeric($accounts[$i])) { unset($accounts[$i]); - $accounts = array_values($accounts); - break; + $change = true; } } + if ($change) { + $accounts = array_values($accounts); + } // build DN list $_SESSION['delete_dn'] = array(); for ($i = 0; $i < sizeof($accounts); $i++) {