3 # Search the list of users across all servers, and display the results
5 require './cluster-useradmin-lib.pl';
10 @hosts = &list_useradmin_hosts();
11 @servers = &list_servers();
13 ($s) = grep { $_->{'id'} == $h->{'id'} } @servers;
14 foreach $u (@{$h->{'users'}}) {
15 $f = $u->{$in{'field'}};
16 if ($m == 0 && $f eq $w ||
17 $m == 1 && eval { $f =~ /$w/i } ||
18 $m == 4 && index($f, $w) >= 0 ||
19 $m == 2 && $f ne $w ||
20 $m == 3 && eval { $f !~ /$w/i } ||
21 $m == 5 && index($f, $w) < 0) {
22 push(@{$hosts{$u->{'user'}}},
23 $s->{'desc'} ? $s->{'desc'} : $s->{'host'});
24 push(@match, $u) if (!$found{$u->{'user'}}++);
29 &redirect("edit_user.cgi?user=".$match[0]->{'user'});
32 &ui_print_header(undef, $text{'search_title'}, "");
34 print "<p><b>$text{'search_notfound'}</b>. <p>\n";
37 print "<table border width=100%>\n";
38 print "<tr $tb> <td><b>$text{'user'}</b></td>\n";
39 print "<td><b>$text{'uid'}</b></td>\n";
40 print "<td><b>$text{'real'}</b></td>\n";
41 print "<td><b>$text{'home'}</b></td>\n";
42 print "<td><b>$text{'search_hosts'}</b></td> </tr>\n";
44 $m->{'real'} =~ s/,.*$// if ($uconfig{'extra_real'});
46 print "<td><a href=\"edit_user.cgi?user=$m->{'user'}\">$m->{'user'}</a></td>\n";
47 print "<td>$m->{'uid'}</td>\n";
48 print "<td>$m->{'real'} </td>\n";
49 print "<td>$m->{'home'}</td>\n";
50 @h = @{$hosts{$m->{'user'}}};
51 @h = @h[0 .. 10], ".." if (@h > 10);
52 print "<td>",join(", ", @h),"</td>\n";
55 print "</table><p>\n";
57 &ui_print_footer("", $text{'index_return'});