better skip algorithm for checkboxes on delete

This commit is contained in:
Roland Gruber 2007-05-26 18:04:28 +00:00
parent a5fade8b95
commit 23064b6b7a
1 changed files with 7 additions and 4 deletions

View File

@ -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++) {