Remove deprecated defined(@foo)
https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3138980&group_id=17457
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ else {
|
||||
|
||||
# Redirect if the user has only one module
|
||||
@msc_modules = &get_visible_module_infos()
|
||||
if (!defined(@msc_modules));
|
||||
if (!length(@msc_modules));
|
||||
|
||||
if (!defined($in{'cat'})) {
|
||||
# Maybe redirect to some module after login
|
||||
|
||||
Executable
+139
@@ -0,0 +1,139 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
require './web-lib.pl';
|
||||
@available = ("webmin", "system", "servers", "cluster", "hardware", "", "net");
|
||||
&init_config();
|
||||
$hostname = &get_display_hostname();
|
||||
$ver = &get_webmin_version();
|
||||
&get_miniserv_config(\%miniserv);
|
||||
if ($gconfig{'real_os_type'}) {
|
||||
$ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}";
|
||||
}
|
||||
else {
|
||||
$ostr = "$gconfig{'os_type'} $gconfig{'os_version'}";
|
||||
}
|
||||
&ReadParse();
|
||||
|
||||
# Redirect if the user has only one module
|
||||
@msc_modules = &get_visible_module_infos()
|
||||
if (!length(@msc_modules));
|
||||
if (@msc_modules == 1 && $gconfig{'gotoone'}) {
|
||||
&redirect("$msc_modules[0]->{'dir'}/");
|
||||
exit;
|
||||
}
|
||||
|
||||
# Show standard header
|
||||
$gconfig{'sysinfo'} = 0 if ($gconfig{'sysinfo'} == 1);
|
||||
&header($gconfig{'nohostname'} ? $text{'main_title2'} :
|
||||
&text('main_title', $ver, $hostname, $ostr), "",
|
||||
undef, undef, 1, 1);
|
||||
|
||||
if (!@msc_modules) {
|
||||
# use has no modules!
|
||||
print "<p><b>$text{'main_none'}</b><p>\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 "<center><table cellpadding=0>\n";
|
||||
$pos = 0;
|
||||
$cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
|
||||
$per = 100.0 / $cols;
|
||||
foreach $m (@msc_modules) {
|
||||
if ($pos % $cols == 0) { print "<tr>\n"; }
|
||||
print "<td valign=top align=center>\n";
|
||||
print "<table border><tr><td><a href=/$m->{'dir'}/>",
|
||||
"<img src=$m->{'dir'}/images/icon.gif border=0 ",
|
||||
"width=20 height=20></a></td></tr></table>\n";
|
||||
print "<a href=/$m->{'dir'}/>$m->{'desc'}</a></td>\n";
|
||||
if ($pos % $cols == $cols - 1) { print "</tr>\n"; }
|
||||
$pos++;
|
||||
}
|
||||
print "</table></center><p><table width='100%' bgcolor='#FFFFFF'><tr><td></td></tr></table>\n";
|
||||
}
|
||||
else {
|
||||
# Generate categorized module list
|
||||
print "<table border=0 cellpadding=0 cellspacing=0 width=100% align=center><tr><td><table border=0 cellpadding=0 cellspacing=0 width=100% height=20><tr>\n";
|
||||
$usercol = defined($gconfig{'cs_header'}) ||
|
||||
defined($gconfig{'cs_table'}) ||
|
||||
defined($gconfig{'cs_page'});
|
||||
foreach $c (@cats) {
|
||||
$t = $cats{$c};
|
||||
if ($in{'cat'} eq $c) {
|
||||
print "<td bgcolor=#424242><b><font color=#FFFFFF><center>$t</center></font></b></td>\n";
|
||||
}
|
||||
}
|
||||
print "</tr></table>";
|
||||
&make_sep;
|
||||
print "<table width=100% cellpadding=5>\n";
|
||||
|
||||
# Display the modules in this category
|
||||
foreach $m (@msc_modules) {
|
||||
next if ($m->{'category'} ne $in{'cat'});
|
||||
|
||||
print "<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr><td><a href=/$m->{'dir'}/>",
|
||||
"<img src=$m->{'dir'}/images/icon.gif alt=\"\" width=25 height=25 border=1></a>",
|
||||
"</td><td width=100% bgcolor=#9e9aa2>\n";
|
||||
print " <a href=/$m->{'dir'}/>"; &chop_font2; print "</a></td></tr></table>\n";
|
||||
&make_sep;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
|
||||
!$ENV{'SSL_USER'} && !$ENV{'LOCAL_USER'} &&
|
||||
$ENV{'HTTP_USER_AGENT'} !~ /webmin/i) {
|
||||
print "<table width=100% cellpadding=0 cellspacing=0><tr>\n";
|
||||
if ($gconfig{'skill_'.$base_remote_user}) {
|
||||
print "<td><b>$text{'main_skill'}:</b>\n";
|
||||
foreach $s ('high', 'medium', 'low') {
|
||||
print " | " if ($done_first_skill++);
|
||||
if ($gconfig{'skill_'.$base_remote_user} eq $s) {
|
||||
print $text{'skill_'.$s};
|
||||
}
|
||||
else {
|
||||
print "<a href='switch_skill.cgi?skill=$s&",
|
||||
"cat=$in{'cat'}'>", "<font color=000000>", $text{'skill_'.$s},"</font></a>";
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
&footer();
|
||||
|
||||
|
||||
sub chop_font {
|
||||
|
||||
foreach $l (split(//, $t)) {
|
||||
$ll = ord($l);
|
||||
if ($ll > 127 && $lang->{'charset'}) {
|
||||
print "<img src=images/letters2/$ll.$lang->{'charset'}.gif alt=\"$l\" align=bottom border=0>";
|
||||
}
|
||||
elsif ($l eq " ") {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"\ \" align=bottom border=0>";
|
||||
}
|
||||
else {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"$l\" align=bottom border=0>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub chop_font2 {
|
||||
|
||||
foreach $l (split(//, $m->{'desc'})) {
|
||||
$ll = ord($l);
|
||||
if ($ll > 127 && $lang->{'charset'}) {
|
||||
print "<img src=images/letters2/$ll.$lang->{'charset'}.gif alt=\"$l\" align=middle border=0>";
|
||||
}
|
||||
elsif ($l eq " ") {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"\ \" align=middle border=0>";
|
||||
}
|
||||
else {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"$l\" align=middle border=0>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Executable
+163
@@ -0,0 +1,163 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
require './web-lib.pl';
|
||||
@available = ("webmin", "system", "servers", "cluster", "hardware", "", "net");
|
||||
&init_config();
|
||||
$hostname = &get_system_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'}";
|
||||
}
|
||||
&ReadParse();
|
||||
|
||||
# Redirect if the user has only one module
|
||||
@msc_modules = &get_available_module_infos()
|
||||
if (!length(@msc_modules));
|
||||
if (@msc_modules == 1 && $gconfig{'gotoone'}) {
|
||||
&redirect("$msc_modules[0]->{'dir'}/");
|
||||
exit;
|
||||
}
|
||||
|
||||
# Show standard header
|
||||
$gconfig{'sysinfo'} = 0 if ($gconfig{'sysinfo'} == 1);
|
||||
$theme_index_page = 1;
|
||||
&header($gconfig{'nohostname'} ? $text{'main_title2'} :
|
||||
&text('main_title', $ver, $hostname, $ostr), "",
|
||||
undef, undef, 1, 1);
|
||||
|
||||
if (!@msc_modules) {
|
||||
# use has no modules!
|
||||
print "<p><b>$text{'main_none'}</b><p>\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 "<center><table cellpadding=0>\n";
|
||||
$pos = 0;
|
||||
$cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
|
||||
$per = 100.0 / $cols;
|
||||
foreach $m (@msc_modules) {
|
||||
if ($pos % $cols == 0) { print "<tr>\n"; }
|
||||
print "<td valign=top align=center>\n";
|
||||
print "<table border><tr><td><a href=/$m->{'dir'}/>",
|
||||
"<img src=$m->{'dir'}/images/icon.gif border=0 ",
|
||||
"width=48 height=48></a></td></tr></table>\n";
|
||||
print "<a href=/$m->{'dir'}/>$m->{'desc'}</a></td>\n";
|
||||
if ($pos % $cols == $cols - 1) { print "</tr>\n"; }
|
||||
$pos++;
|
||||
}
|
||||
print "</table></center><p><table width='100%' bgcolor='#FFFFFF'><tr><td></td></tr></table><br>\n";
|
||||
}
|
||||
else {
|
||||
# Generate categorized module list
|
||||
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";
|
||||
$usercol = defined($gconfig{'cs_header'}) ||
|
||||
defined($gconfig{'cs_table'}) ||
|
||||
defined($gconfig{'cs_page'});
|
||||
foreach $c (@cats) {
|
||||
$t = $cats{$c};
|
||||
if ($in{'cat'} eq $c) {
|
||||
print "<td bgcolor=#bae3ff>",
|
||||
"<img src=images/tabs/blue_left.jpg alt=\"\">","</td>\n";
|
||||
print "<td bgcolor=#bae3ff> <b>$t</b> </td>\n";
|
||||
print "<td bgcolor=#bae3ff>",
|
||||
"<img src=images/tabs/blue_right.jpg alt=\"\">","</td>\n";
|
||||
}
|
||||
# print "<td width=10></td>\n";
|
||||
}
|
||||
print "</tr></table> <table border=0 cellpadding=0 cellspacing=0 ",
|
||||
"width=100% bgcolor=#FFFFFF background=images/msctile2.jpg>\n";
|
||||
print "<tr><td><table width=100% cellpadding=5>\n";
|
||||
|
||||
# Display the modules in this category
|
||||
$pos = 0;
|
||||
$cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
|
||||
$per = 100.0 / $cols;
|
||||
foreach $m (@msc_modules) {
|
||||
next if ($m->{'category'} ne $in{'cat'});
|
||||
|
||||
if ($pos % $cols == 0) { print "<tr>\n"; }
|
||||
print "<td valign=top align=center width=$per\%>\n";
|
||||
print "<table border bgcolor=#ffffff><tr><td><a href=/$m->{'dir'}/>",
|
||||
"<img src=$m->{'dir'}/images/icon.gif alt=\"\" border=0></a>",
|
||||
"</td></tr></table>\n";
|
||||
print "<a href=/$m->{'dir'}/><font color=#000000>$m->{'desc'}</font></a></td>\n";
|
||||
if ($pos++ % $cols == $cols - 1) { print "</tr>\n"; }
|
||||
}
|
||||
while($pos++ % $cols) {
|
||||
print "<td width=$per\%></td>\n";
|
||||
}
|
||||
print "</table></td></tr></table></td></tr></table>";
|
||||
|
||||
print qq~<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
|
||||
<tr>
|
||||
<td background="images/white_bar.jpg" nowrap><img src="images/white_bar.jpg"></td>
|
||||
</tr>
|
||||
</table>~;
|
||||
|
||||
print qq~<p><table width="98%" border="0" cellspacing="0" cellpadding="0" height="4" align="center">
|
||||
<tr>
|
||||
<td background="images/white_bar2.jpg" nowrap><img src="images/white_bar2.jpg"></td>
|
||||
</tr>
|
||||
</table><p>~;
|
||||
|
||||
}
|
||||
|
||||
if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
|
||||
!$ENV{'SSL_USER'} && !$ENV{'LOCAL_USER'} &&
|
||||
$ENV{'HTTP_USER_AGENT'} !~ /webmin/i) {
|
||||
print "<table width=100% cellpadding=0 cellspacing=0><tr>\n";
|
||||
if ($gconfig{'skill_'.$base_remote_user}) {
|
||||
print "<td><b>$text{'main_skill'}:</b>\n";
|
||||
foreach $s ('high', 'medium', 'low') {
|
||||
print " | " if ($done_first_skill++);
|
||||
if ($gconfig{'skill_'.$base_remote_user} eq $s) {
|
||||
print $text{'skill_'.$s};
|
||||
}
|
||||
else {
|
||||
print "<a href='switch_skill.cgi?skill=$s&",
|
||||
"cat=$in{'cat'}'>", "<font color=000000>", $text{'skill_'.$s},"</font></a>";
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
print "<table width=95% align=center><tr><td width=100%><b><font color='#FFFFFF'> ";
|
||||
print &text('main_version', $ver, $hostname, $ostr)
|
||||
if (!$gconfig{'nohostname'});
|
||||
print "</font></b>\n";
|
||||
print "</td>\n";
|
||||
|
||||
print "<td align=right><a href='http://www.msclinux.com/'>",
|
||||
"<img src='images/theme_by.jpg' border='0'></a> </div><br>\n";
|
||||
print "</tr></table>\n";
|
||||
|
||||
}
|
||||
|
||||
&footer();
|
||||
|
||||
|
||||
sub chop_font {
|
||||
|
||||
foreach $l (split(//, $t)) {
|
||||
$ll = ord($l);
|
||||
if ($ll > 127 && $lang->{'charset'}) {
|
||||
print "<img src=images/letters2/$ll.$lang->{'charset'}.gif alt=\"$l\" align=bottom border=0>";
|
||||
}
|
||||
elsif ($l eq " ") {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"\ \" align=bottom border=0>";
|
||||
}
|
||||
else {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"$l\" align=bottom border=0>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -288,7 +288,7 @@ if ($driver_handle &&
|
||||
$cstr .= ";port=$config{'port'}" if ($config{'port'});
|
||||
local @uinfo;
|
||||
if ($postgres_sameunix &&
|
||||
defined(@uinfo = getpwnam($postgres_login))) {
|
||||
(@uinfo = getpwnam($postgres_login))) {
|
||||
# DBI call which must run in subprocess
|
||||
pipe(OUTr, OUTw);
|
||||
if (!($pid = fork())) {
|
||||
|
||||
@@ -22,9 +22,9 @@ if (open(READ, $readers_file)) {
|
||||
}
|
||||
print "<tr> <td width=50% valign=top nowrap>\n";
|
||||
printf "<input type=radio name=readers_def value=1 %s> %s\n",
|
||||
defined(@readers) ? "" : "checked", $text{'access_readers1'};
|
||||
length(@readers) ? "" : "checked", $text{'access_readers1'};
|
||||
printf "<input type=radio name=readers_def value=0 %s> %s<br>\n",
|
||||
defined(@readers) ? "checked" : "", $text{'access_readers0'};
|
||||
length(@readers) ? "checked" : "", $text{'access_readers0'};
|
||||
print "<textarea rows=20 cols=30 name=readers>",
|
||||
join("\n", @readers),"</textarea>",
|
||||
&user_chooser_button("readers", 1),"</td>\n";
|
||||
@@ -40,9 +40,9 @@ if (open(WRITE, $writers_file)) {
|
||||
}
|
||||
print "<td width=50% valign=top nowrap>\n";
|
||||
printf "<input type=radio name=writers_def value=1 %s> %s\n",
|
||||
defined(@writers) ? "" : "checked", $text{'access_writers1'};
|
||||
length(@writers) ? "" : "checked", $text{'access_writers1'};
|
||||
printf "<input type=radio name=writers_def value=0 %s> %s<br>\n",
|
||||
defined(@writers) ? "checked" : "", $text{'access_writers0'};
|
||||
length(@writers) ? "checked" : "", $text{'access_writers0'};
|
||||
print "<textarea rows=20 cols=30 name=writers>",
|
||||
join("\n", @writers),"</textarea>",
|
||||
&user_chooser_button("writers", 1),"</td> </tr>\n";
|
||||
|
||||
@@ -39,7 +39,7 @@ if (!$config{'mailq_count'}) {
|
||||
"$text{'routes_title'}<br>(smtproutes)",
|
||||
"$text{'percents_title'}<br>(percenthack)",
|
||||
"$text{'assigns_title'}<br>(assign)",
|
||||
defined(@queue) ?
|
||||
length(@queue) ?
|
||||
"$text{'queue_title'}<br>".&text('queue_count', scalar(@queue)) :
|
||||
"$text{'queue_title'}<br>(qmail-qread)",
|
||||
$text{'boxes_title'} );
|
||||
|
||||
@@ -52,7 +52,7 @@ foreach $m (@mods) {
|
||||
&unlock_file($mods);
|
||||
|
||||
$basedir = &get_hostsentry_dir();
|
||||
if (defined(@foreign)) {
|
||||
if (length(@foreign)) {
|
||||
&lock_file("$basedir/moduleForeignDomain.allow");
|
||||
&open_tempfile(FOREIGN, ">$basedir/moduleForeignDomain.allow");
|
||||
foreach $f (@foreign) {
|
||||
@@ -61,7 +61,7 @@ if (defined(@foreign)) {
|
||||
&close_tempfile(FOREIGN);
|
||||
&unlock_file("$basedir/moduleForeignDomain.allow");
|
||||
}
|
||||
if (defined(@multiple)) {
|
||||
if (length(@multiple)) {
|
||||
&lock_file("$basedir/moduleMultipleLogins.allow");
|
||||
&open_tempfile(MULTIPLE, ">$basedir/moduleMultipleLogins.allow");
|
||||
foreach $m (@multiple) {
|
||||
|
||||
+3
-3
@@ -45,15 +45,15 @@ $in{'dir'} || &error($text{'upload_edir'});
|
||||
$download{'dir'} = $in{'dir'};
|
||||
if ($can_mode != 3) {
|
||||
# User can be entered
|
||||
defined(@uinfo = getpwnam($in{'user'})) || &error($text{'upload_euser'});
|
||||
length(@uinfo = getpwnam($in{'user'})) || &error($text{'upload_euser'});
|
||||
&can_as_user($in{'user'}) ||
|
||||
&error(&text('download_eucannot', $in{'user'}));
|
||||
$download{'uid'} = $uinfo[2];
|
||||
$in{'group_def'} || defined(@ginfo = getgrnam($in{'group'})) ||
|
||||
$in{'group_def'} || length(@ginfo = getgrnam($in{'group'})) ||
|
||||
&error($text{'upload_egroup'});
|
||||
$can_mode == 0 || $in{'group_def'} || &in_group(\@uinfo, \@ginfo) ||
|
||||
&error($text{'download_egcannot'});
|
||||
$download{'gid'} = defined(@ginfo) ? $ginfo[2] : $uinfo[3];
|
||||
$download{'gid'} = length(@ginfo) ? $ginfo[2] : $uinfo[3];
|
||||
}
|
||||
else {
|
||||
# User is fixed
|
||||
|
||||
+4
-4
@@ -17,11 +17,11 @@ if (defined($in{'email_def'}) && !$in{'email_def'}) {
|
||||
}
|
||||
if ($can_mode != 3) {
|
||||
# User can be entered
|
||||
defined(@uinfo = getpwnam($in{'user'})) ||
|
||||
length(@uinfo = getpwnam($in{'user'})) ||
|
||||
&error($text{'upload_euser'});
|
||||
&can_as_user($in{'user'}) ||
|
||||
&error(&text('upload_eucannot', $in{'user'}));
|
||||
$in{'group_def'} || defined(@ginfo = getgrnam($in{'group'})) ||
|
||||
$in{'group_def'} || length(@ginfo = getgrnam($in{'group'})) ||
|
||||
&error($text{'upload_egroup'});
|
||||
$can_mode == 0 || $in{'group_def'} || &in_group(\@uinfo, \@ginfo) ||
|
||||
&error($text{'upload_egcannot'});
|
||||
@@ -41,7 +41,7 @@ $found || &error($text{'upload_enone'});
|
||||
&error(&text('upload_eaccess', "<tt>$in{'dir'}</tt>", $!));
|
||||
|
||||
# Switch to the upload user
|
||||
&switch_uid_to($uinfo[2], defined(@ginfo) ? $ginfo[2] : $uinfo[3]);
|
||||
&switch_uid_to($uinfo[2], length(@ginfo) ? $ginfo[2] : $uinfo[3]);
|
||||
|
||||
# Create the directory if needed
|
||||
if (!-d $in{'dir'} && $in{'mkdir'}) {
|
||||
@@ -163,7 +163,7 @@ for($i=0; defined($d = $in{"upload$i"}); $i++) {
|
||||
# Doesn't look possible
|
||||
$err = $text{'upload_notcomp'};
|
||||
}
|
||||
&switch_uid_to($uinfo[2], defined(@ginfo) ? $ginfo[2] : $uinfo[3]);
|
||||
&switch_uid_to($uinfo[2], length(@ginfo) ? $ginfo[2] : $uinfo[3]);
|
||||
if (!$err) {
|
||||
local $j = join("<br>",
|
||||
map { " <tt>$_</tt>" } @files);
|
||||
|
||||
Executable
+153
@@ -0,0 +1,153 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
require './web-lib.pl';
|
||||
@available = ("webmin", "system", "servers", "cluster", "hardware", "", "net");
|
||||
&init_config();
|
||||
$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'}";
|
||||
}
|
||||
&ReadParse();
|
||||
|
||||
# Redirect if the user has only one module
|
||||
@msc_modules = &get_visible_module_infos()
|
||||
if (!length(@msc_modules));
|
||||
|
||||
if (!defined($in{'cat'})) {
|
||||
# Maybe redirect to some module after login
|
||||
local $goto = &get_goto_module(\@msc_modules);
|
||||
if ($goto) {
|
||||
&redirect($goto->{'dir'}.'/');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
# Show standard header
|
||||
$gconfig{'sysinfo'} = 0 if ($gconfig{'sysinfo'} == 1);
|
||||
$theme_index_page = 1;
|
||||
&header($gconfig{'nohostname'} ? $text{'main_title2'} :
|
||||
&text('main_title', $ver, $hostname, $ostr), "",
|
||||
undef, undef, 1, 1);
|
||||
print $text{'main_header'};
|
||||
|
||||
if (!@msc_modules) {
|
||||
# use has no modules!
|
||||
print "<p><b>$text{'main_none'}</b><p>\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 "<center><table cellpadding=0>\n";
|
||||
$pos = 0;
|
||||
$cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
|
||||
$per = 100.0 / $cols;
|
||||
foreach $m (@msc_modules) {
|
||||
if ($pos % $cols == 0) { print "<tr>\n"; }
|
||||
print "<td valign=top align=center>\n";
|
||||
local $idx = $m->{'index_link'};
|
||||
print "<table border><tr><td><a href=$m->{'dir'}/$idx>",
|
||||
"<img src=$m->{'dir'}/images/icon.gif border=0 ",
|
||||
"width=48 height=48></a></td></tr></table>\n";
|
||||
print "<a href=$m->{'dir'}/$idx>$m->{'desc'}</a></td>\n";
|
||||
if ($pos % $cols == $cols - 1) { print "</tr>\n"; }
|
||||
$pos++;
|
||||
}
|
||||
print "</table></center><p><table width='100%' bgcolor='#FFFFFF'><tr><td></td></tr></table><br>\n";
|
||||
}
|
||||
else {
|
||||
# Generate categorized module list
|
||||
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";
|
||||
$usercol = defined($gconfig{'cs_header'}) ||
|
||||
defined($gconfig{'cs_table'}) ||
|
||||
defined($gconfig{'cs_page'});
|
||||
foreach $c (@cats) {
|
||||
$t = $cats{$c};
|
||||
if ($in{'cat'} eq $c) {
|
||||
print "<td bgcolor=#bae3ff>",
|
||||
"<img src=images/tabs/blue_left.jpg alt=\"\">","</td>\n";
|
||||
print "<td bgcolor=#bae3ff> <b>$t</b> </td>\n";
|
||||
print "<td bgcolor=#bae3ff>",
|
||||
"<img src=images/tabs/blue_right.jpg alt=\"\">","</td>\n";
|
||||
}
|
||||
# print "<td width=10></td>\n";
|
||||
}
|
||||
print "</tr></table> <table border=0 cellpadding=0 cellspacing=0 ",
|
||||
"width=100% bgcolor=#FFFFFF background=images/msctile2.jpg>\n";
|
||||
print "<tr><td><table width=100% cellpadding=5>\n";
|
||||
|
||||
# Display the modules in this category
|
||||
$pos = 0;
|
||||
$cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
|
||||
$per = 100.0 / $cols;
|
||||
foreach $m (@msc_modules) {
|
||||
next if ($m->{'category'} ne $in{'cat'});
|
||||
|
||||
if ($pos % $cols == 0) { print "<tr>\n"; }
|
||||
print "<td valign=top align=center width=$per\%>\n";
|
||||
print "<table border bgcolor=#ffffff><tr><td><a href=$m->{'dir'}/>",
|
||||
"<img src=$m->{'dir'}/images/icon.gif alt=\"\" border=0></a>",
|
||||
"</td></tr></table>\n";
|
||||
print "<a href=$m->{'dir'}/><font color=#000000>$m->{'desc'}</font></a></td>\n";
|
||||
if ($pos++ % $cols == $cols - 1) { print "</tr>\n"; }
|
||||
}
|
||||
while($pos++ % $cols) {
|
||||
print "<td width=$per\%></td>\n";
|
||||
}
|
||||
print "</table></td></tr></table></td></tr></table>";
|
||||
|
||||
print qq~<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
|
||||
<tr>
|
||||
<td background="images/white_bar.jpg" nowrap><img src="images/white_bar.jpg"></td>
|
||||
</tr>
|
||||
</table>~;
|
||||
|
||||
print qq~<p><table width="98%" border="0" cellspacing="0" cellpadding="0" height="4" align="center">
|
||||
<tr>
|
||||
<td background="images/white_bar2.jpg" nowrap><img src="images/white_bar2.jpg"></td>
|
||||
</tr>
|
||||
</table><p>~;
|
||||
|
||||
}
|
||||
|
||||
if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
|
||||
!$ENV{'SSL_USER'} && !$ENV{'LOCAL_USER'} &&
|
||||
$ENV{'HTTP_USER_AGENT'} !~ /webmin/i) {
|
||||
print "<table width=95% align=center><tr><td width=100%><b><font color='#FFFFFF'> ";
|
||||
print &text('main_version', $ver, $hostname, $ostr)
|
||||
if (!$gconfig{'nohostname'});
|
||||
print "</font></b>\n";
|
||||
print "</td>\n";
|
||||
|
||||
print "</tr></table>\n";
|
||||
}
|
||||
|
||||
print $text{'main_footer'};
|
||||
&footer();
|
||||
|
||||
|
||||
sub chop_font {
|
||||
|
||||
foreach $l (split(//, $t)) {
|
||||
$ll = ord($l);
|
||||
if ($ll > 127 && $lang->{'charset'}) {
|
||||
print "<img src=images/letters2/$ll.$lang->{'charset'}.gif alt=\"$l\" align=bottom border=0>";
|
||||
}
|
||||
elsif ($l eq " ") {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"\ \" align=bottom border=0>";
|
||||
}
|
||||
else {
|
||||
print "<img src=images/letters2/$ll.gif alt=\"$l\" align=bottom border=0>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user