\n" if (!$_[3]); } elsif ($server == -3) { # Install on hosts that do have it local %already = map { $_->{'id'}, 1 } @{$_[1]}; push(@hosts, grep { $already{$_->{'id'}} } @allhosts); print "",&text($_[0].'6', $_[2]),"
\n" if (!$_[3]); } elsif ($server =~ /^group_(.*)/) { # Install on members of some group local ($group) = grep { $_->{'name'} eq $1 } &servers::list_all_groups(\@servers); push(@hosts, grep { local $hid = $_->{'id'}; local ($s) = grep { $_->{'id'} == $hid } @servers; &indexof($s->{'host'}, @{$group->{'members'}}) >= 0 } @allhosts); print "",&text($_[0].'4', $_[2], $group->{'name'}), "
\n" if (!$_[3]); } elsif ($server != -1) { # Just install on one host local ($onehost) = grep { $_->{'id'} == $server } @allhosts; push(@hosts, $onehost); local ($s) = grep { $_->{'id'} == $onehost->{'id'} } @servers; print "",&text($_[0].'5', $_[2], &server_name($s)),"
\n" if (!$_[3]); } else { # Installing on every host push(@hosts, @allhosts); print "",&text($_[0], join(" ", @names)), "
\n" if (!$_[3]); } } return &unique(@hosts); } # get_usermin_text() # Returns the text hash for Usermin, on this system sub get_usermin_text { local %text; local %miniserv; &usermin::get_usermin_miniserv_config(\%miniserv); local $root = $miniserv{'root'}; local %ugconfig; &usermin::get_usermin_config(\%ugconfig); local $ol = $ugconfig{'overlang'}; local $o; local ($dir) = ($_[1] || "lang"); # Read global lang files foreach $o (@lang_order_list) { local $ok = &read_file_cached("$root/$dir/$o", \%text); return () if (!$ok && $o eq $default_lang); } if ($ol) { foreach $o (@lang_order_list) { &read_file_cached("$root/$ol/$o", \%text); } } &read_file_cached("$usermin::config{'usermin_dir'}/custom-lang", \%text); if ($_[0]) { # Read module's lang files local $mdir = "$root/$_[0]"; foreach $o (@lang_order_list) { &read_file_cached("$mdir/$dir/$o", \%text); } if ($ol) { foreach $o (@lang_order_list) { &read_file_cached("$mdir/$ol/$o", \%text); } } &read_file_cached("$usermin::config{'usermin_dir'}/$_[0]/custom-lang", \%text); } foreach $k (keys %text) { $text{$k} =~ s/\$(\{([^\}]+)\}|([A-Za-z0-9\.\-\_]+))/text_subs($2 || $3,\%text)/ge; } return %text; } 1;