3 BEGIN { push(@INC, ".."); };
5 @available = ("webmin", "system", "servers", "cluster", "hardware", "", "net");
7 $hostname = &get_display_hostname();
8 $ver = &get_webmin_version();
9 &get_miniserv_config(\%miniserv);
10 if ($gconfig{'real_os_type'}) {
11 if ($gconfig{'os_version'} eq "*") {
12 $ostr = $gconfig{'real_os_type'};
15 $ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}";
19 $ostr = "$gconfig{'os_type'} $gconfig{'os_version'}";
23 # Redirect if the user has only one module
24 @msc_modules = &get_visible_module_infos()
25 if (!scalar(@msc_modules));
27 if (!defined($in{'cat'})) {
28 # Maybe redirect to some module after login
29 local $goto = &get_goto_module(\@msc_modules);
31 &redirect($goto->{'dir'}.'/');
36 # Show standard header
37 $gconfig{'sysinfo'} = 0 if ($gconfig{'sysinfo'} == 1);
38 $main::theme_index_page = 1;
39 $title = $gconfig{'nohostname'} ? $text{'main_title2'} :
40 &text('main_title', $ver, $hostname, $ostr);
43 print $text{'main_header'};
47 print "<p><b>$text{'main_none'}</b><p>\n";
49 elsif ($gconfig{"notabs_${base_remote_user}"} == 2 ||
50 $gconfig{"notabs_${base_remote_user}"} == 0 && $gconfig{'notabs'}) {
51 # Generate main menu with all modules on one page
52 print "<center><table cellpadding=0>\n";
54 $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
56 foreach $m (@msc_modules) {
57 if ($pos % $cols == 0) { print "<tr>\n"; }
58 print "<td valign=top align=center>\n";
59 local $idx = $m->{'index_link'};
60 $desc = $m->{'longdesc'} || $m->{'desc'};
61 print "<table border><tr><td><a href=$m->{'dir'}/$idx>",
62 "<img src=$m->{'dir'}/images/icon.gif border=0 ",
63 "width=48 height=48 title=\"$desc\"></a></td></tr></table>\n";
64 print "<a href=$m->{'dir'}/$idx>$m->{'desc'}</a></td>\n";
65 if ($pos % $cols == $cols - 1) { print "</tr>\n"; }
68 print "</table></center><p><table width='100%' bgcolor='#FFFFFF'><tr><td></td></tr></table><br>\n";
71 # Generate categorized module list
72 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";
73 $usercol = defined($gconfig{'cs_header'}) ||
74 defined($gconfig{'cs_table'}) ||
75 defined($gconfig{'cs_page'});
78 if ($in{'cat'} eq $c) {
79 print "<td bgcolor=#bae3ff>",
80 "<img src=images/tabs/blue_left.jpg alt=\"\">","</td>\n";
81 print "<td bgcolor=#bae3ff> <b>$t</b> </td>\n";
82 print "<td bgcolor=#bae3ff>",
83 "<img src=images/tabs/blue_right.jpg alt=\"\">","</td>\n";
85 # print "<td width=10></td>\n";
87 print "</tr></table> <table border=0 cellpadding=0 cellspacing=0 ",
88 "width=100% bgcolor=#FFFFFF background=images/msctile2.jpg>\n";
89 print "<tr><td><table width=100% cellpadding=5>\n";
91 # Display the modules in this category
93 $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
95 foreach $m (@msc_modules) {
96 next if ($m->{'category'} ne $in{'cat'});
98 if ($pos % $cols == 0) { print "<tr>\n"; }
99 $desc = $m->{'longdesc'} || $m->{'desc'};
100 print "<td valign=top align=center width=$per\%>\n";
101 print "<table border bgcolor=#ffffff><tr><td><a href=$m->{'dir'}/>",
102 "<img src=$m->{'dir'}/images/icon.gif title=\"$desc\" border=0></a>",
103 "</td></tr></table>\n";
104 print "<a href=$m->{'dir'}/><font color=#000000>$m->{'desc'}</font></a></td>\n";
105 if ($pos++ % $cols == $cols - 1) { print "</tr>\n"; }
107 while($pos++ % $cols) {
108 print "<td width=$per\%></td>\n";
110 print "</table></td></tr></table></td></tr></table>";
112 print qq~<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
114 <td background="images/white_bar.jpg" nowrap><img src="images/white_bar.jpg"></td>
118 print qq~<p><table width="98%" border="0" cellspacing="0" cellpadding="0" height="4" align="center">
120 <td background="images/white_bar2.jpg" nowrap><img src="images/white_bar2.jpg"></td>
126 if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
127 !$ENV{'SSL_USER'} && !$ENV{'LOCAL_USER'} &&
128 $ENV{'HTTP_USER_AGENT'} !~ /webmin/i) {
129 print "<table width=95% align=center><tr><td width=100%><b><font color='#FFFFFF'> ";
130 print &text('main_version', $ver, $hostname, $ostr)."\n"
131 if (!$gconfig{'nohostname'});
132 print $text{'main_readonly'}."\n" if (&is_readonly_mode());
133 print "</font></b>\n";
136 print "<td align=right><img src='images/theme_by.jpg' border='0'> </td>\n";
137 print "</tr></table>\n";
141 # Check for incorrect OS
142 if (&foreign_check("webmin")) {
143 &foreign_require("webmin", "webmin-lib.pl");
144 &webmin::show_webmin_notifications();
147 print $text{'main_footer'};
153 foreach $l (split(//, $t)) {
155 if ($ll > 127 && $lang->{'charset'}) {
156 print "<img src=images/letters2/$ll.$lang->{'charset'}.gif alt=\"$l\" align=bottom border=0>";
159 print "<img src=images/letters2/$ll.gif alt=\"\ \" align=bottom border=0>";
162 print "<img src=images/letters2/$ll.gif alt=\"$l\" align=bottom border=0>";