3 # Search the list of groups across all servers, and display the results
5 require './cluster-useradmin-lib.pl';
9 @hosts = &list_useradmin_hosts();
10 @servers = &list_servers();
12 ($s) = grep { $_->{'id'} == $h->{'id'} } @servers;
13 foreach $g (@{$h->{'groups'}}) {
14 $f = $g->{$in{'field'}};
15 if ($m == 0 && $f eq $w ||
16 $m == 1 && eval { $f =~ /$w/i } ||
17 $m == 4 && index($f, $w) >= 0 ||
18 $m == 2 && $f ne $w ||
19 $m == 3 && eval { $f !~ /$w/i } ||
20 $m == 5 && index($f, $w) < 0) {
21 push(@{$hosts{$g->{'group'}}},
22 $s->{'desc'} ? $s->{'desc'} : $s->{'host'});
23 push(@match, $g) if (!$found{$g->{'group'}}++);
28 &redirect("edit_group.cgi?group=".$match[0]->{'group'});
31 &ui_print_header(undef, $text{'search_title'}, "");
33 print "<p><b>$text{'search_gnotfound'}</b>. <p>\n";
36 print "<table border width=100%>\n";
37 print "<tr $tb> <td><b>$text{'gedit_group'}</b></td>\n";
38 print "<td><b>$text{'gedit_gid'}</b></td>\n";
39 print "<td><b>$text{'gedit_members'}</b></td>\n";
40 print "<td><b>$text{'search_hosts'}</b></td> </tr>\n";
42 local $members = join(" ", split(/,/, $m->{'members'}));
44 print "<td><a href=\"edit_group.cgi?group=$m->{'group'}\">$m->{'group'}</a></td>\n";
45 print "<td>$m->{'gid'}</td>\n";
46 print "<td>$members </td>\n";
47 @h = @{$hosts{$m->{'group'}}};
48 @h = @h[0 .. 10], ".." if (@h > 10);
49 print "<td>",join(", ", @h),"</td>\n";
52 print "</table><p>\n";
54 &ui_print_footer("", $text{'index_return'});