3 require './web-lib.pl';
4 @available = ("webmin", "system", "servers", "cluster", "hardware", "", "net");
6 $hostname = &get_system_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_available_module_infos()
24 if (!scalar(@msc_modules));
25 if (@msc_modules == 1 && $gconfig{'gotoone'}) {
26 &redirect("$msc_modules[0]->{'dir'}/");
30 # Show standard header
31 $gconfig{'sysinfo'} = 0 if ($gconfig{'sysinfo'} == 1);
32 $theme_index_page = 1;
33 &header($gconfig{'nohostname'} ? $text{'main_title2'} :
34 &text('main_title', $ver, $hostname, $ostr), "",
39 print "<p><b>$text{'main_none'}</b><p>\n";
41 elsif ($gconfig{"notabs_${base_remote_user}"} == 2 ||
42 $gconfig{"notabs_${base_remote_user}"} == 0 && $gconfig{'notabs'}) {
43 # Generate main menu with all modules on one page
44 print "<center><table cellpadding=0>\n";
46 $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
48 foreach $m (@msc_modules) {
49 if ($pos % $cols == 0) { print "<tr>\n"; }
50 print "<td valign=top align=center>\n";
51 print "<table border><tr><td><a href=/$m->{'dir'}/>",
52 "<img src=$m->{'dir'}/images/icon.gif border=0 ",
53 "width=48 height=48></a></td></tr></table>\n";
54 print "<a href=/$m->{'dir'}/>$m->{'desc'}</a></td>\n";
55 if ($pos % $cols == $cols - 1) { print "</tr>\n"; }
58 print "</table></center><p><table width='100%' bgcolor='#FFFFFF'><tr><td></td></tr></table><br>\n";
61 # Generate categorized module list
62 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";
63 $usercol = defined($gconfig{'cs_header'}) ||
64 defined($gconfig{'cs_table'}) ||
65 defined($gconfig{'cs_page'});
68 if ($in{'cat'} eq $c) {
69 print "<td bgcolor=#bae3ff>",
70 "<img src=images/tabs/blue_left.jpg alt=\"\">","</td>\n";
71 print "<td bgcolor=#bae3ff> <b>$t</b> </td>\n";
72 print "<td bgcolor=#bae3ff>",
73 "<img src=images/tabs/blue_right.jpg alt=\"\">","</td>\n";
75 # print "<td width=10></td>\n";
77 print "</tr></table> <table border=0 cellpadding=0 cellspacing=0 ",
78 "width=100% bgcolor=#FFFFFF background=images/msctile2.jpg>\n";
79 print "<tr><td><table width=100% cellpadding=5>\n";
81 # Display the modules in this category
83 $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
85 foreach $m (@msc_modules) {
86 next if ($m->{'category'} ne $in{'cat'});
88 if ($pos % $cols == 0) { print "<tr>\n"; }
89 print "<td valign=top align=center width=$per\%>\n";
90 print "<table border bgcolor=#ffffff><tr><td><a href=/$m->{'dir'}/>",
91 "<img src=$m->{'dir'}/images/icon.gif alt=\"\" border=0></a>",
92 "</td></tr></table>\n";
93 print "<a href=/$m->{'dir'}/><font color=#000000>$m->{'desc'}</font></a></td>\n";
94 if ($pos++ % $cols == $cols - 1) { print "</tr>\n"; }
96 while($pos++ % $cols) {
97 print "<td width=$per\%></td>\n";
99 print "</table></td></tr></table></td></tr></table>";
101 print qq~<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
103 <td background="images/white_bar.jpg" nowrap><img src="images/white_bar.jpg"></td>
107 print qq~<p><table width="98%" border="0" cellspacing="0" cellpadding="0" height="4" align="center">
109 <td background="images/white_bar2.jpg" nowrap><img src="images/white_bar2.jpg"></td>
115 if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
116 !$ENV{'SSL_USER'} && !$ENV{'LOCAL_USER'} &&
117 $ENV{'HTTP_USER_AGENT'} !~ /webmin/i) {
118 print "<table width=100% cellpadding=0 cellspacing=0><tr>\n";
119 if ($gconfig{'skill_'.$base_remote_user}) {
120 print "<td><b>$text{'main_skill'}:</b>\n";
121 foreach $s ('high', 'medium', 'low') {
122 print " | " if ($done_first_skill++);
123 if ($gconfig{'skill_'.$base_remote_user} eq $s) {
124 print $text{'skill_'.$s};
127 print "<a href='switch_skill.cgi?skill=$s&",
128 "cat=$in{'cat'}'>", "<font color=000000>", $text{'skill_'.$s},"</font></a>";
133 print "<table width=95% align=center><tr><td width=100%><b><font color='#FFFFFF'> ";
134 print &text('main_version', $ver, $hostname, $ostr)
135 if (!$gconfig{'nohostname'});
136 print "</font></b>\n";
139 print "<td align=right><a href='http://www.msclinux.com/'>",
140 "<img src='images/theme_by.jpg' border='0'></a> </div><br>\n";
141 print "</tr></table>\n";
150 foreach $l (split(//, $t)) {
152 if ($ll > 127 && $lang->{'charset'}) {
153 print "<img src=images/letters2/$ll.$lang->{'charset'}.gif alt=\"$l\" align=bottom border=0>";
156 print "<img src=images/letters2/$ll.gif alt=\"\ \" align=bottom border=0>";
159 print "<img src=images/letters2/$ll.gif alt=\"$l\" align=bottom border=0>";