3 require './web-lib.pl';
4 @available = ("webmin", "system", "servers", "cluster", "hardware", "", "net");
6 $hostname = &get_display_hostname();
7 $ver = &get_webmin_version();
8 &get_miniserv_config(\%miniserv);
9 if ($gconfig{'real_os_type'}) {
10 if ($gconfig{'os_version'} eq "*") {
11 $ostr = $gconfig{'real_os_type'};
14 $ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}";
18 $ostr = "$gconfig{'os_type'} $gconfig{'os_version'}";
22 # Redirect if the user has only one module
23 @msc_modules = &get_visible_module_infos()
24 if (!length(@msc_modules));
26 if (!defined($in{'cat'})) {
27 # Maybe redirect to some module after login
28 local $goto = &get_goto_module(\@msc_modules);
30 &redirect($goto->{'dir'}.'/');
35 # Show standard header
36 $gconfig{'sysinfo'} = 0 if ($gconfig{'sysinfo'} == 1);
37 $theme_index_page = 1;
38 &header($gconfig{'nohostname'} ? $text{'main_title2'} :
39 &text('main_title', $ver, $hostname, $ostr), "",
41 print $text{'main_header'};
45 print "<p><b>$text{'main_none'}</b><p>\n";
47 elsif ($gconfig{"notabs_${base_remote_user}"} == 2 ||
48 $gconfig{"notabs_${base_remote_user}"} == 0 && $gconfig{'notabs'}) {
49 # Generate main menu with all modules on one page
50 print "<center><table cellpadding=0>\n";
52 $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
54 foreach $m (@msc_modules) {
55 if ($pos % $cols == 0) { print "<tr>\n"; }
56 print "<td valign=top align=center>\n";
57 local $idx = $m->{'index_link'};
58 print "<table border><tr><td><a href=$m->{'dir'}/$idx>",
59 "<img src=$m->{'dir'}/images/icon.gif border=0 ",
60 "width=48 height=48></a></td></tr></table>\n";
61 print "<a href=$m->{'dir'}/$idx>$m->{'desc'}</a></td>\n";
62 if ($pos % $cols == $cols - 1) { print "</tr>\n"; }
65 print "</table></center><p><table width='100%' bgcolor='#FFFFFF'><tr><td></td></tr></table><br>\n";
68 # Generate categorized module list
69 print "<table border=0 cellpadding=0 cellspacing=0 width=95% align=center><tr><td><table border=0 cellpadding=0 cellspacing=0 height=20><tr>\n";
70 $usercol = defined($gconfig{'cs_header'}) ||
71 defined($gconfig{'cs_table'}) ||
72 defined($gconfig{'cs_page'});
75 if ($in{'cat'} eq $c) {
76 print "<td bgcolor=#bae3ff>",
77 "<img src=images/tabs/blue_left.jpg alt=\"\">","</td>\n";
78 print "<td bgcolor=#bae3ff> <b>$t</b> </td>\n";
79 print "<td bgcolor=#bae3ff>",
80 "<img src=images/tabs/blue_right.jpg alt=\"\">","</td>\n";
82 # print "<td width=10></td>\n";
84 print "</tr></table> <table border=0 cellpadding=0 cellspacing=0 ",
85 "width=100% bgcolor=#FFFFFF background=images/msctile2.jpg>\n";
86 print "<tr><td><table width=100% cellpadding=5>\n";
88 # Display the modules in this category
90 $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
92 foreach $m (@msc_modules) {
93 next if ($m->{'category'} ne $in{'cat'});
95 if ($pos % $cols == 0) { print "<tr>\n"; }
96 print "<td valign=top align=center width=$per\%>\n";
97 print "<table border bgcolor=#ffffff><tr><td><a href=$m->{'dir'}/>",
98 "<img src=$m->{'dir'}/images/icon.gif alt=\"\" border=0></a>",
99 "</td></tr></table>\n";
100 print "<a href=$m->{'dir'}/><font color=#000000>$m->{'desc'}</font></a></td>\n";
101 if ($pos++ % $cols == $cols - 1) { print "</tr>\n"; }
103 while($pos++ % $cols) {
104 print "<td width=$per\%></td>\n";
106 print "</table></td></tr></table></td></tr></table>";
108 print qq~<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
110 <td background="images/white_bar.jpg" nowrap><img src="images/white_bar.jpg"></td>
114 print qq~<p><table width="98%" border="0" cellspacing="0" cellpadding="0" height="4" align="center">
116 <td background="images/white_bar2.jpg" nowrap><img src="images/white_bar2.jpg"></td>
122 if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
123 !$ENV{'SSL_USER'} && !$ENV{'LOCAL_USER'} &&
124 $ENV{'HTTP_USER_AGENT'} !~ /webmin/i) {
125 print "<table width=95% align=center><tr><td width=100%><b><font color='#FFFFFF'> ";
126 print &text('main_version', $ver, $hostname, $ostr)
127 if (!$gconfig{'nohostname'});
128 print "</font></b>\n";
131 print "</tr></table>\n";
134 print $text{'main_footer'};
140 foreach $l (split(//, $t)) {
142 if ($ll > 127 && $lang->{'charset'}) {
143 print "<img src=images/letters2/$ll.$lang->{'charset'}.gif alt=\"$l\" align=bottom border=0>";
146 print "<img src=images/letters2/$ll.gif alt=\"\ \" align=bottom border=0>";
149 print "<img src=images/letters2/$ll.gif alt=\"$l\" align=bottom border=0>";