#!/usr/bin/perl # Show the left-side menu of Webmin modules BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); &ReadParse(); %text = &load_language($current_theme); %gaccess = &get_module_acl(undef, ""); # Work out what modules and categories we have @cats = &get_visible_modules_categories(); @modules = map { @{$_->{'modules'}} } @cats; &popup_header(); print < EOF # Show login print "
\n"; print "
\n"; print &text('left_login', $remote_user),"
\n"; print "
\n"; if ($gconfig{"notabs_${base_remote_user}"} == 2 || $gconfig{"notabs_${base_remote_user}"} == 0 && $gconfig{'notabs'} || @modules <= 1) { # Show all modules in one list foreach $minfo (@modules) { $target = $minfo->{'noframe'} ? "_top" : "right"; print "{'dir'}/>$minfo->{'desc'}
\n"; } } else { # Show all modules under categories foreach $c (@cats) { # Show category opener, plus modules under it &print_category_opener( $c->{'code'}, $in{$c->{'code'}} ? 1 : 0, $c->{'unused'} ? "$c->{'desc'}" : $c->{'desc'}); $cls = $in{$c->{'code'}} ? "itemshown" : "itemhidden"; print "
"; foreach my $minfo (@{$c->{'modules'}}) { &print_category_link("$minfo->{'dir'}/", $minfo->{'desc'}, undef, undef, $minfo->{'noframe'} ? "_top" : "", ); } print "
\n"; } } # Show module/help search form if (-r "$root_directory/webmin_search.cgi" && $gaccess{'webminsearch'}) { print "
\n"; print $text{'left_search'}," "; print &ui_textbox("search", undef, 15); } print "\n"; # Show current module's log search, if logging if ($gconfig{'log'} && &foreign_available("webminlog")) { print "
\n"; print "
\n"; } # Show info link print "
\n"; print "
\n"; # Show feedback link, but only if a custom email is set %gaccess = &get_module_acl(undef, ""); if (&get_product_name() eq 'webmin' && # For Webmin !$ENV{'ANONYMOUS_USER'} && $gconfig{'nofeedbackcc'} != 2 && $gaccess{'feedback'} && $gconfig{'feedback_to'} || &get_product_name() eq 'usermin' && # For Usermin !$ENV{'ANONYMOUS_USER'} && $gconfig{'feedback'} ) { print "\n"; } # Show refesh modules link, for master admin if (&foreign_available("webmin")) { print "\n"; } # Show logout link &get_miniserv_config(\%miniserv); if ($miniserv{'logout'} && !$ENV{'SSL_USER'} && !$ENV{'LOCAL_USER'} && $ENV{'HTTP_USER_AGENT'} !~ /webmin/i) { print "
\n"; if ($main::session_id) { print ""; } else { print ""; } print "
\n"; } # Show link back to original Webmin server if ($ENV{'HTTP_WEBMIN_SERVERS'}) { print "
\n"; print ""; } print "
\n"; print "
\n"; &popup_footer(); # print_category_opener(name, &allcats, label) # Prints out an open/close twistie for some category sub print_category_opener { local ($c, $status, $label) = @_; $label = $c eq "others" ? $text{'left_others'} : $label; local $img = $status ? "gray-open.gif" : "gray-closed.gif"; # Show link to close or open catgory print "
"; print "[+]\n"; print "
\n"; } sub print_category_link { local ($link, $label, $image, $noimage, $target) = @_; $target ||= "right"; print "
$label
\n"; }