#!/usr/local/bin/perl
# Display all Webmin modules visible to the current user
BEGIN { push(@INC, ".."); };
use WebminCore;
&init_config();
&ReadParse();
$hostname = &get_display_hostname();
$ver = &get_webmin_version();
&get_miniserv_config(\%miniserv);
if ($gconfig{'real_os_type'}) {
if ($gconfig{'os_version'} eq "*") {
$ostr = $gconfig{'real_os_type'};
}
else {
$ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}";
}
}
else {
$ostr = "$gconfig{'os_type'} $gconfig{'os_version'}";
}
%access = &get_module_acl();
# Build a list of all modules
@modules = &get_visible_module_infos();
if (!defined($in{'cat'})) {
# Maybe redirect to some module after login
local $goto = &get_goto_module(\@modules);
if ($goto) {
&redirect($goto->{'dir'}.'/');
exit;
}
}
$gconfig{'sysinfo'} = 0 if ($gconfig{'sysinfo'} == 1);
if ($gconfig{'texttitles'}) {
@args = ( $text{'main_title2'}, undef );
}
else {
@args = ( $gconfig{'nohostname'} ? $text{'main_title2'} :
&text('main_title', $ver, $hostname, $ostr),
"images/webmin-blue.png" );
if ($gconfig{'showlogin'}) {
$args[0] = $remote_user." : ".$args[0];
}
}
&header(@args, undef, undef, 1, 1,
$tconfig{'brand'} ?
"$tconfig{'brand'}" :
$gconfig{'brand'} ?
"$gconfig{'brand'}" :
"$text{'main_homepage'}".
($gconfig{'nofeedbackcc'} == 2 || !$access{'feedback'} ? "" :
"
$text{'main_feedback'}")
);
print "
\n"; print $text{'main_header'}; if (!@modules) { # use has no modules! print "
$text{'main_none'}
\n"; } elsif ($gconfig{"notabs_${base_remote_user}"} == 2 || $gconfig{"notabs_${base_remote_user}"} == 0 && $gconfig{'notabs'}) { # Generate main menu with all modules on one page print "
\n";
local $idx = $m->{'index_link'};
print "
| \n";
if ($pos % $cols == $cols - 1) { print "
| ", $usercol ? " " : " "," | \n";
print "$t | \n"; print "", $usercol ? " " : " "," | \n";
}
else {
print "", $usercol ? " " : " "," | \n";
print "", "$t | \n"; print "", $usercol ? " " : " "," | \n";
}
print "\n"; } print " |
|
| ", "$text{'main_logout'} | \n"; } else { print "", "$text{'main_switch'} | \n"; } print "