fixed sorting of DNs

This commit is contained in:
Roland Gruber 2003-10-28 19:32:10 +00:00
parent 723c21b13a
commit 35bf6395b8
4 changed files with 51 additions and 19 deletions

View File

@ -251,12 +251,20 @@ function cmp_array($a, $b) {
// sort specifies the sort column
global $sort;
global $attr_array;
// sort by first attribute with name $sort
// sort by first column if no attribute is given
if (!$sort) $sort = strtolower($attr_array[0]);
if ($sort != "dn") {
// sort by first attribute with name $sort
if ($a[$sort][0] == $b[$sort][0]) return 0;
else if ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1;
else return -1;
}
else {
if ($a[$sort] == $b[$sort]) return 0;
else if ($a[$sort] == max($a[$sort], $b[$sort])) return 1;
else return -1;
}
}
// save variables to session

View File

@ -364,12 +364,20 @@ function cmp_array($a, $b) {
// sort specifies the sort column
global $sort;
global $attr_array;
// sort by first attribute with name $sort
// sort by first column if no attribute is given
if (!$sort) $sort = strtolower($attr_array[0]);
if ($sort != "dn") {
// sort by first attribute with name $sort
if ($a[$sort][0] == $b[$sort][0]) return 0;
else if ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1;
else return -1;
}
else {
if ($a[$sort] == $b[$sort]) return 0;
else if ($a[$sort] == max($a[$sort], $b[$sort])) return 1;
else return -1;
}
}
// save variables to session
$_SESSION['grp_info'] = $grp_info;

View File

@ -355,12 +355,20 @@ function cmp_array($a, $b) {
// sort specifies the sort column
global $sort;
global $attr_array;
// sort by first attribute with name $sort
// sort by first column if no attribute is given
if (!$sort) $sort = strtolower($attr_array[0]);
if ($sort != "dn") {
// sort by first attribute with name $sort
if ($a[$sort][0] == $b[$sort][0]) return 0;
else if ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1;
else return -1;
}
else {
if ($a[$sort] == $b[$sort]) return 0;
else if ($a[$sort] == max($a[$sort], $b[$sort])) return 1;
else return -1;
}
}
// save variables to session
$_SESSION['hst_info'] = $hst_info;

View File

@ -420,10 +420,18 @@ function cmp_array($a, $b) {
global $attr_array;
// sort by first attribute with name $sortattrib
if (!$sortattrib) $sortattrib = strtolower($attr_array[0]);
if ($sortattrib != "dn") {
// sort by first column if no attribute is given
if ($a[$sortattrib][0] == $b[$sortattrib][0]) return 0;
else if ($a[$sortattrib][0] == max($a[$sortattrib][0], $b[$sortattrib][0])) return 1;
else return -1;
}
else {
if ($a[$sortattrib] == $b[$sortattrib]) return 0;
else if ($a[$sortattrib] == max($a[$sortattrib], $b[$sortattrib])) return 1;
else return -1;
}
}
// save variables to session
$_SESSION['usr_units'] = $usr_units;