Server IP : 195.201.23.43 / Your IP : 13.59.203.127 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/cluster-useradmin/ |
Upload File : |
#!/usr/bin/perl # search_group.cgi # Search the list of groups across all servers, and display the results require './cluster-useradmin-lib.pl'; &ReadParse(); $m = $in{'match'}; $w = $in{'what'}; @hosts = &list_useradmin_hosts(); @servers = &list_servers(); foreach $h (@hosts) { ($s) = grep { $_->{'id'} == $h->{'id'} } @servers; foreach $g (@{$h->{'groups'}}) { $f = $g->{$in{'field'}}; if ($m == 0 && $f eq $w || $m == 1 && eval { $f =~ /$w/i } || $m == 4 && index($f, $w) >= 0 || $m == 2 && $f ne $w || $m == 3 && eval { $f !~ /$w/i } || $m == 5 && index($f, $w) < 0) { push(@{$hosts{$g->{'group'}}}, $s->{'desc'} ? $s->{'desc'} : $s->{'host'}); push(@match, $g) if (!$found{$g->{'group'}}++); } } } if (@match == 1) { &redirect("edit_group.cgi?group=".$match[0]->{'group'}); } else { &ui_print_header(undef, $text{'search_title'}, ""); if (@match == 0) { print "<p><b>$text{'search_gnotfound'}</b>. <p>\n"; } else { print "<table border width=100%>\n"; print "<tr $tb> <td><b>$text{'gedit_group'}</b></td>\n"; print "<td><b>$text{'gedit_gid'}</b></td>\n"; print "<td><b>$text{'gedit_members'}</b></td>\n"; print "<td><b>$text{'search_hosts'}</b></td> </tr>\n"; foreach $m (@match) { local $members = join(" ", split(/,/, $m->{'members'})); print "<tr $cb>\n"; print "<td><a href=\"edit_group.cgi?group=$m->{'group'}\">$m->{'group'}</a></td>\n"; print "<td>$m->{'gid'}</td>\n"; print "<td>$members </td>\n"; @h = @{$hosts{$m->{'group'}}}; @h = @h[0 .. 10], ".." if (@h > 10); print "<td>",join(", ", @h),"</td>\n"; print "</tr>\n"; } print "</table><p>\n"; } &ui_print_footer("", $text{'index_return'}); }Private