#!/usr/local/bin/perl # edit_group.cgi # Display a form for editing an existing group require './cluster-useradmin-lib.pl'; &ReadParse(); @hosts = &list_useradmin_hosts(); @servers = &list_servers(); if ($in{'host'} ne '') { ($host) = grep { $_->{'id'} == $in{'host'} } @hosts; local ($g) = grep { $_->{'group'} eq $in{'group'} } @{$host->{'groups'}}; %ginfo = %$g; } else { foreach $h (@hosts) { local ($g) = grep { $_->{'group'} eq $in{'group'} } @{$h->{'groups'}}; if ($g) { $host = $h; %ginfo = %$g; last; } } } ($serv) = grep { $_->{'id'} == $host->{'id'} } @servers; $desc = &text('gedit_host', $serv->{'desc'} ? $serv->{'desc'} : $serv->{'host'}); &ui_print_header($desc, $text{'gedit_title'}, ""); print "
\n"; print &ui_hr(); print &ui_subheading($text{'uedit_hosts'}); if ($config{'table_mode'}) { # Show as table print &ui_columns_start([ $text{'index_thost'}, $text{'index_tdesc'}, $text{'index_ttype'} ]); foreach $h (@hosts) { local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers; next if (!$s); local ($type) = grep { $_->[0] eq $s->{'type'} } @servers::server_types; local ($link) = $config{'conf_host_links'} ? &ui_link("edit_host.cgi?id=$h->{'id'}",($s->{'host'} || &get_system_hostname())) : ($s->{'host'} || &get_system_hostname()); print &ui_columns_row([ $link, $s->{'desc'}, $type->[1], ]); } print &ui_columns_end(); } else { # Show as icons &icons_table(\@links, \@titles, \@icons); } &ui_print_footer("", $text{'index_return'});