r2188 - made closing brace be correctly processed right after a keyword
[racktables] / index.php
CommitLineData
b325120a 1<?php
e673ee24
DO
2
3require 'inc/init.php';
da958e52
DO
4// no ctx override is necessary
5fixContext();
6if (!permitted())
7{
8 renderAccessDenied();
9 die;
10}
b0348307
DO
11// Only store the tab name after clearance is got. Any failure is unhandleable.
12setcookie ('RTLT-' . $pageno, $tabno, time() + getConfigVar ('COOKIE_TTL'));
e673ee24
DO
13
14echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
15echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
16echo '<head><title>' . getTitle ($pageno, $tabno) . "</title>\n";
21fd978f 17echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
e673ee24
DO
18echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
19echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
20echo "<style type='text/css'>\n";
21// Print style information
9c0b0016 22foreach (array ('F', 'A', 'U', 'T', 'Th', 'Tw', 'Thw') as $statecode)
e673ee24
DO
23{
24 echo "td.state_${statecode} {\n";
2a201216 25 echo "\ttext-align: center;\n";
9c0b0016 26 echo "\tbackground-color: #" . (getConfigVar ('color_' . $statecode)) . ";\n";
2a201216 27 echo "\tfont: bold 10px Verdana, sans-serif;\n";
e673ee24
DO
28 echo "}\n\n";
29}
30?>
31 </style>
a30489ac 32 <script language='javascript' type='text/javascript' src='js/live_validation.js'></script>
54592771 33 <script language='javascript' type='text/javascript' src='js/codepress/codepress.js'></script>
e673ee24
DO
34 </head>
35<body>
36 <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%' class=maintable>
37 <tr class=mainheader>
c4d215e8 38 <td colspan=2>
e673ee24
DO
39 <table width='100%' cellspacing=0 cellpadding=2 border=0>
40 <tr>
1db97c25 41 <td valign=top><a href='http://racktables.org/'><?php printImageHREF ('logo'); ?></a></td>
b325120a 42 <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
e673ee24
DO
43 </tr>
44 </table>
45 </td>
46 </tr>
47
48 <tr>
c4d215e8 49 <td class="menubar" colspan=2>
e673ee24
DO
50 <table border="0" width="100%" cellpadding="3" cellspacing="0">
51 <tr>
b325120a 52<?php showPathAndSearch ($pageno); ?>
e673ee24
DO
53 </tr>
54 </table>
55 </td>
56 </tr>
57
58 <tr>
b325120a 59<?php
e673ee24
DO
60 showTabs ($pageno, $tabno);
61?>
62 </tr>
63
64 <tr>
c4d215e8 65 <td colspan=2>
b325120a 66<?php
e45a78d7
DO
67if (isset ($tabhandler[$pageno][$tabno]))
68{
3bebaebd
DO
69 if (isset ($page[$pageno]['bypass']) && isset ($page[$pageno]['bypass_type']))
70 {
71 switch ($page[$pageno]['bypass_type'])
72 {
73 case 'uint':
2c6c7645 74 assertUIntArg ($page[$pageno]['bypass'], 'index');
3bebaebd 75 break;
105cea6e 76 case 'uint0':
2c6c7645 77 assertUIntArg ($page[$pageno]['bypass'], 'index', TRUE);
105cea6e 78 break;
1fbc9fd6
DO
79 case 'inet4':
80 assertIPv4Arg ($page[$pageno]['bypass'], 'index');
81 break;
3bebaebd 82 default:
b0348307 83 showError ('Dispatching error for bypass parameter', __FILE__);
3bebaebd
DO
84 break;
85 }
86 $tabhandler[$pageno][$tabno] ($_REQUEST[$page[$pageno]['bypass']]);
87 }
e45a78d7
DO
88 else
89 $tabhandler[$pageno][$tabno] ();
90}
91elseif (isset ($page[$pageno]['handler']))
e673ee24
DO
92 $page[$pageno]['handler'] ($tabno);
93else
b0348307 94 showError ("Failed to find handler for page '${pageno}', tab '${tabno}'", __FILE__);
e673ee24
DO
95?>
96 </td>
97 </tr>
98 </table>
99</body>
100</html>