- Timestamp:
- 12/29/09 13:06:01 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r53 r54 52 52 $session->param('domlistsortby','domain'); 53 53 $session->param('domlistorder','ASC'); 54 $session->param('useradminsortby','user name');54 $session->param('useradminsortby','user'); 55 55 $session->param('useradminorder','ASC'); 56 56 $session->param('grpmansortby','group'); … … 67 67 my $group = ($webvar{group} ? $webvar{group} : 1); 68 68 69 # per-page startwith, filter, searchsubs 70 $session->param($webvar{page}.'startwith', $webvar{startwith}) if $webvar{startwith}; 71 $session->param($webvar{page}.'filter', $webvar{filter}) if $webvar{filter}; 72 $webvar{searchsubs} =~ s/^n ?// if $webvar{searchsubs}; 73 $session->param($webvar{page}.'searchsubs', $webvar{searchsubs}) if $webvar{searchsubs}; 74 75 my $startwith = $session->param($webvar{page}.'startwith'); 76 my $filter = $session->param($webvar{page}.'filter'); 77 my $searchsubs = $session->param($webvar{page}.'searchsubs'); 78 79 80 81 if (0) { 69 82 # filter, starts with, search subgroups 70 83 $session->param('filter', "$webvar{page}:filter$webvar{filter}") if defined($webvar{filter}); … … 80 93 my $searchsubs = $session->param('searchsubs'); 81 94 $searchsubs = ($searchsubs =~ /^$webvar{page}:searchsubs(.+)$/ ? $1 : ''); 95 } 96 97 82 98 83 99 # nrgh, can't handle login here because we don't have a database handle to check the user/pass with yet … … 1022 1038 my @cols = ('domain', 'status', 'group'); 1023 1039 my %colheads = (domain => 'Domain', status => 'Status', group => 'Group'); 1024 fill_colheads( \@cols, \%colheads);1040 fill_colheads($sortby, $sortorder, \@cols, \%colheads); 1025 1041 1026 1042 # $page->param(sortorder => $sortorder); … … 1076 1092 my $childlist = join(',',@childgroups); 1077 1093 1078 my $sql = "SELECT count(*) FROM groups WHERE group_id IN ($logingroup".($childlist ? ",$childlist" : '').")".1094 my $sql = "SELECT count(*) FROM groups WHERE parent_group_id IN ($logingroup".($childlist ? ",$childlist" : '').")". 1079 1095 ($startwith ? " AND group_name ~* '^[$startwith]'" : ''). 1080 1096 ($filter ? " AND group_name ~* '$filter'" : ''); … … 1099 1115 my @cols = ('group','parent','nusers','ndomains'); 1100 1116 my %colnames = (group => 'Group', parent => 'Parent Group', nusers => 'Users', ndomains => 'Domains'); 1101 fill_colheads( \@cols, \%colnames);1117 fill_colheads($sortby, $sortorder, \@cols, \%colnames); 1102 1118 1103 1119 # waffle, waffle - keep state on these as well as sortby, sortorder? … … 1118 1134 "LEFT OUTER JOIN users u ON u.group_id=g.group_id ". 1119 1135 "LEFT OUTER JOIN domains d ON d.group_id=g.group_id ". 1120 "WHERE g. group_id IN ($logingroup".($childlist ? ",$childlist" : '').") ".1136 "WHERE g.parent_group_id IN ($logingroup".($childlist ? ",$childlist" : '').") ". 1121 1137 ##fixme: don't do variable subs in SQL, use placeholders and params in ->execute() 1122 1138 ($startwith ? " AND g.group_name ~* '^[$startwith]'" : ''). … … 1201 1217 my @cols = ('user','fname','type','group','status'); 1202 1218 my %colnames = (user => 'Username', fname => 'Full Name', type => 'Type', group => 'Group', status => 'Status'); 1203 fill_colheads( \@cols, \%colnames);1219 fill_colheads($sortby, $sortorder, \@cols, \%colnames); 1204 1220 1205 1221 # waffle, waffle - keep state on these as well as sortby, sortorder? … … 1250 1266 # Takes an array ref and hash ref 1251 1267 sub fill_colheads { 1268 my $sortby = shift; 1269 my $sortorder = shift; 1252 1270 my $cols = shift; 1253 1271 my $colnames = shift; … … 1274 1292 $page->param(colheads => \@headings); 1275 1293 1276 } # end gentableheadings1294 } # end fill_colheads()
Note:
See TracChangeset
for help on using the changeset viewer.