Well, it took me a while, but I figured out how to sort the user list in the admin display. The only thing is that it sorts the uppercase letters first and then the lowercase letters. Still, it should help if you've got a lot of users on your system.
In db.cgi, sub admin_display
change
Code:
# If we are inquiring, let's look for the specified user.
my (@data, $user_list, $perm, $password);
$user_list = qq~<select name="username"><option> </option>~;
LINE: foreach $line (@lines) {
$line =~ /^#/ and next LINE;
$line =~ /^\s*$/ and next LINE;
chomp $line;
@data = split (/:/, $line);
if ($in{'inquire'} and ($in{'username'} eq $data[0])) {
$user_list .= qq~<option value="$data[0]" SELECTED>$data[0]</option>\n~;
$perm = qq|
View <input type=checkbox name="per_view" value="1" |;
($data[2] and $perm .= "CHECKED"); $perm .= qq|>
Add <input type=checkbox name="per_add" value="1" |;
($data[3] and $perm .= "CHECKED"); $perm .= qq|>
Delete <input type=checkbox name="per_del" value="1" |;
($data[4] and $perm .= "CHECKED"); $perm .= qq|>
Modify <input type=checkbox name="per_mod" value="1" |;
($data[5] and $perm .= "CHECKED"); $perm .= qq|>
Admin <input type=checkbox name="per_admin" value="1" |;
($data[6] and $perm .= "CHECKED"); $perm .= qq|>|;
$password = $data[1];
}
else {
$user_list .= qq~<option value="$data[0]">$data[0]</option>\n~;
}
}
$user_list .= "</select>";
to
Code:
# If we are inquiring, let's look for the specified user.
my (@data, $user_list, $perm, $password);
$user_list = qq~<select name="username"><option> </option>~;
LINE: foreach $line (@lines) {
$line =~ /^#/ and next LINE;
$line =~ /^\s*$/ and next LINE;
chomp $line;
@data = split (/:/, $line);
push (@users,$data[0]);
if ($in{'inquire'} and ($in{'username'} eq $data[0])) {
$password = $data[1];
$perm = qq|
View <input type=checkbox name="per_view" value="1" |;
($data[2] and $perm .= "CHECKED"); $perm .= qq|>
Add <input type=checkbox name="per_add" value="1" |;
($data[3] and $perm .= "CHECKED"); $perm .= qq|>
Delete <input type=checkbox name="per_del" value="1" |;
($data[4] and $perm .= "CHECKED"); $perm .= qq|>
Modify <input type=checkbox name="per_mod" value="1" |;
($data[5] and $perm .= "CHECKED"); $perm .= qq|>
Admin <input type=checkbox name="per_admin" value="1" |;
($data[6] and $perm .= "CHECKED"); $perm .= qq|>|;
}
}
foreach $user (sort @users) {
if ($in{'inquire'} and ($in{'username'} eq $user)) {
$user_list .= qq~<option value="$user" SELECTED>$user</option>\n~;
}
else {
$user_list .= qq~<option value="$user">$user</option>\n~;
}
}
$user_list .= "</select>";
------------------
JPD
[This message has been edited by JPDeni (edited March 10, 1999).]