#!/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 "\n"; print "\n"; print "\n"; print "
$text{'gedit_details'}
\n"; print "\n"; print "\n"; print "\n"; printf "\n"; print "\n"; printf "\n"; print "\n"; print "
$text{'gedit_group'}$ginfo{'group'}$text{'gedit_gid'} %s (%s)\n", $text{'uedit_leave'}, $ginfo{'gid'}; printf " %s\n", $text{'gedit_set'}; print "
$text{'pass'} %s (%s)\n", $text{'uedit_leave'}, $ginfo{'pass'} ? $ginfo{'pass'} : $text{'uedit_none'}; print " $text{'none2'}
\n"; print " $text{'encrypted'}\n"; print "
\n"; print " $text{'clear'}\n"; print "
$text{'gedit_members'} \n"; printf " %s (%s)
\n", $text{'uedit_leave'}, $ginfo{'members'} ? $ginfo{'members'} : $text{'uedit_none'}; printf " %s\n", $text{'gedit_add'}; print " ", &user_chooser_button("membersadd", 1),"
\n"; printf " %s\n", $text{'gedit_del'}; print " ", &user_chooser_button("membersdel", 1),"

\n"; print "\n"; print "\n"; print "
$text{'onsave'}
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'chgid'} $text{'no'} $text{'gedit_homedirs'} $text{'gedit_allfiles'}
$text{'uedit_servs'} $text{'uedit_mall'} $text{'uedit_mthis'}
$text{'gedit_mothers'} $text{'yes'} $text{'no'}

\n"; print "\n"; print "\n"; # Find the servers this group is on foreach $h (@hosts) { local ($og) = grep { $_->{'group'} eq $in{'group'} } @{$h->{'groups'}}; if ($og) { local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers; push(@icons, &get_webprefix() ? (&get_webprefix()."/servers/images/".$s->{'type'}.".svg") : ("../servers/images/".$s->{'type'}.".svg")); push(@links, "edit_host.cgi?id=$h->{'id'}"); push(@titles, $s->{'desc'} ? $s->{'desc'} : $s->{'host'}); } } if (@icons < @hosts) { # Offer to create on all servers print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "

\n"; print "\n"; print "\n"; 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); print "
"; } &ui_print_footer("", $text{'index_return'});