#!/usr/local/bin/perl # list_hosts.cgi # Display other webmin servers to which the configuration should be copied # and run. require './cfengine-lib.pl'; &foreign_require("servers", "servers-lib.pl"); &ui_print_header(undef, $text{'hosts_title'}, "", "hosts"); # Show existing servers print &ui_subheading($text{'hosts_hosts'}); @servers = &list_servers(); @hosts = &list_cfengine_hosts(); foreach $h (@hosts) { local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers; next if (!$s); push(@titles, &server_name($s)); push(@links, "edit_host.cgi?id=$h->{'id'}"); push(@icons, "$gconfig{'webprefix'}/servers/images/$s->{'type'}.gif"); $gothost{$h->{'id'}}++; } if (@links) { &icons_table(\@links, \@titles, \@icons); } else { print "$text{'hosts_nohosts'}
\n"; } # Display adding form print "
\n"; # Display run form if (@hosts) { print &ui_hr(); print "\n"; } &ui_print_footer("", $text{'index_return'});