Handle hostnames with upper-case letters
[webmin.git] / caldera / index.cgi
1 #!/usr/local/bin/perl
2 # index.cgi
3 # Webmin index page for Caldera's theme. Contains two frames, with the
4 # categories and modules always at the top and the CGIs at the bottom
5
6 BEGIN { push(@INC, ".."); };
7 use WebminCore;
8 &init_config();
9 $hostname = &get_display_hostname();
10 $ver = &get_webmin_version();
11 if ($gconfig{'real_os_type'}) {
12         $ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}";
13         }
14 else {
15         $ostr = "$gconfig{'os_type'} $gconfig{'os_version'}";
16         }
17
18 # Find the category with the most modules
19 foreach $m (&get_available_module_infos(1)) {
20         local $c = $m->{'category'} ? $m->{'category'} : 'other';
21         $count{$c}++;
22         $maxcat = $count{$c} if ($count{$c} > $maxcat);
23         }
24 $rows = 55 + (int(($maxcat-1) / 3)+1)*25;
25
26 # Display the frameset
27 $title = $gconfig{'nohostname'} ? $text{'main_title2'} :
28               &text('main_title', $ver, $hostname, $ostr);
29 if ($gconfig{'showlogin'}) {
30         $title = $remote_user." : ".$title;
31         }
32 &PrintHeader();
33 print "<!doctype html public \"-//W3C//DTD HTML 3.2 Final//EN\">\n";
34 print "<html><head><title>$title</title></head>\n";
35 print "<frameset rows='$rows,*' border=0>\n";
36 $goto = &get_goto_module();
37 if ($goto) {
38         print "<frame scrolling=no noresize src='index_top.cgi?cat=$goto->{'category'}' name=top>\n";
39         print "<frame scrolling=auto noresize src='$goto->{'dir'}/' name=body>\n";
40         }
41 else {
42         print "<frame scrolling=no noresize src='index_top.cgi' name=top>\n";
43         print "<frame scrolling=auto noresize src='index_body.cgi' name=body>\n";
44         }
45 print "</frameset></html>\n";
46