# html-lib.pl
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo --- license GNU GPL
# stta: (@#) 1.31051043346- [2004_01_29_102036]
# Common functions
# header(title, image, [help], [config], [nomodule], [nowebmin], [rightside],
# [header], [body])
# Output a page header with some title and image. The header may also
# include a link to help, and a link to the config page.
# The header will also have a link to to webmin index, and a link to the
# module menu if there is no config link
use Net::LDAP::Util qw(ldap_error_name ldap_error_text);
sub headerstta
{
local $text_str;
local $html_str;
local %minfo=&load_minfo("$root_directory/$module_name/");
&set_interface_colors(); # just to be sure !!!
$text_str=" ";
$html_str="";
if ( $config{check_services} eq "true" ) {
&checkSTTA_services("all","status",\$text_str);
}
if ($current_theme eq "mscstyle3" && $_[6] =~ //$text{index_title}/ge;
}
if ( ! -r "$root_directory/$module_name/help/$_[2].html" ) {
&header($_[0],$_[1],'',$_[3],$_[4],$_[5],$_[6],$_[7],$_[8]);
} else {
&header($_[0],$_[1],$_[2],$_[3],$_[4],$_[5],$_[6],$_[7],$_[8]);
}
print &out_css();
print "
";
print "
| \n";
}
print ""; &out_tabserv_chk(); print " | "; if ( $config{stta_srvtitle} ne "" ) { print "";
print "
| \n";
}
print "
| \n"; &generate_icon("images/type_icon_$i.gif", $text{"type_$i"}, $_[1]."type=$i"); print " | \n"; if ($c%5 == 4) { print "
| \n"; &generate_icon($_[$i]->{'icon'}, $_[$i]->{'name'}, $_[$i]->{'link'}); print " | \n"; if ($c%5 == 4) { print "
\n"; } sub footHere { if ( $err_msg ) { print "
| $err_msg |
\n"; &footer($config{'back_return'},$text{'index'}); print "
\n"; do "footer.pl"; } # restart_button() # Returns HTML for a link to put in the top-right corner of every page sub restart_button { my $fullOps=0; local $rv=""; if ( $access{stop} ne 1 ) { return } if ( $config{interface} eq "index" ) { $fullOps=1 } if ( $in{cat} eq "admin" || $in{cat} eq "supervision" ) { $fullOps=1 } if ( $fullOps eq 1 || $in{cat} eq "tta" ) { $rv .="$text{'tta_restart'}|\n"; } if ( $fullOps eq 1 || $in{cat} eq "ldap" ) { $rv .= "$text{'ldap_restart'}\n"; } if ( $config{'is_ldapcache'} eq "true" ) { if ( $fullOps eq 1 || $in{cat} eq "ldapcache" ) { $rv .= "|$text{'ldapcache_restart'}\n"; } } return $rv; } # show_error([message]) # Display an error message and exit. The variable $whatfailed must be set # to the name of the operation that failed. sub show_error { print "
| | |
| $err_msg |
\n"; &footer($config{'back_return'},$text{'index'}); print "
\n"; do "footer.pl"; } # htmlCacheapp(msgObj,formObj) # Display all htmls labels to get input for "ttacacheapp" object sub htmlCacheapp { if ( $msgObj eq $text{'default_obj'} ) { print "
| ",
" |
| {'link'}>",
" |
| $_[0]: $_[1] | ||
|
| \n";
if ( "$where_err" eq "ldap-rep" ) {
print "($dn): ".$text{'replica_err'} ."-->".$line_conn." \n"; print " ".$text{'replica_msg'} ." \n"; } elsif ( "$where_err" eq "tta" ) { print "$text{f_error}: $text{'msgerr_tta'} \n"; } elsif ( "$where_err" eq "cmd" ) { print "$text{f_error}: $text{'msgerr_cmd'} \n"; } elsif ( "$where_err" eq "sync" ) { print "$text{f_error}: ".&text('msgerr_sync',$_[1])." \n"; } if ( $err_msg ) { print "$err_msg \n"; } if ( $err gt 0 ) { print "$text{f_error} ($err):".eval("\$text{'msgerr_$err'}")." \n"; } if ( $debug gt 0 ) { print &text('viewlog_action',$stta_sid); } print " |
| $text{'pid'} | \n"; print "$text{'owner'} | \n"; print "$text{'cpu'} | \n"; print "$text{'command'} |
| ", "$p $d->{ppid} | \n"; } else { print "|||
| $p - $d->{ppid} | \n"; } print "$d->{user} | \n"; print "$d->{cpu} | \n"; print "",&html_escape(foreign_call("proc", "cut_string",$d->{args})); #cut_string($d->{args})), " |
\n"; } } if ( $_[3] ) { $| =1; select(STDOUT);} return @pidlist; } sub show_tta_serv_table { if ( $ReportOut ) { select(REPORTOUT)} &load_ttaprops(); &scanSTTA_services("all"); $text_str=""; &checkSTTA_services("all","status",\$text_str); &printSTTA_config(\$text_str,"="); $text_str=~s/STTA:/