r4091 l2addressForDatabase(): signal error with exception, not NULL
[racktables] / index.php
CommitLineData
b325120a 1<?php
90a3d6d8
DY
2ob_start();
3try {
f77323f1 4require 'inc/interface.php';
e673ee24 5require 'inc/init.php';
329ec966 6prepareNavigation();
da958e52
DO
7// no ctx override is necessary
8fixContext();
750d26d2 9redirectIfNecessary();
da958e52 10if (!permitted())
da958e52 11 renderAccessDenied();
878512c6 12header ('Content-Type: text/html; charset=UTF-8');
b0348307 13// Only store the tab name after clearance is got. Any failure is unhandleable.
fa5b2764
AA
14if (isset ($_REQUEST['tab']) and ! isset ($_SESSION['RTLT'][$pageno]['dont_remember']))
15 $_SESSION['RTLT'][$pageno] = array ('tabname' => $tabno, 'time' => time());
e673ee24 16
e673ee24 17?>
e673ee24
DO
18 <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%' class=maintable>
19 <tr class=mainheader>
c4d215e8 20 <td colspan=2>
e673ee24
DO
21 <table width='100%' cellspacing=0 cellpadding=2 border=0>
22 <tr>
1db97c25 23 <td valign=top><a href='http://racktables.org/'><?php printImageHREF ('logo'); ?></a></td>
b325120a 24 <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
e673ee24
DO
25 </tr>
26 </table>
27 </td>
28 </tr>
29
30 <tr>
c4d215e8 31 <td class="menubar" colspan=2>
e673ee24
DO
32 <table border="0" width="100%" cellpadding="3" cellspacing="0">
33 <tr>
b325120a 34<?php showPathAndSearch ($pageno); ?>
e673ee24
DO
35 </tr>
36 </table>
37 </td>
38 </tr>
39
40 <tr>
b325120a 41<?php
e673ee24
DO
42 showTabs ($pageno, $tabno);
43?>
44 </tr>
45
46 <tr>
c4d215e8 47 <td colspan=2>
b325120a 48<?php
e45a78d7
DO
49if (isset ($tabhandler[$pageno][$tabno]))
50{
cde28cf0
DO
51 showMessageOrError();
52 if (NULL !== ($bypass = getBypassValue()))
53 call_user_func ($tabhandler[$pageno][$tabno], $bypass);
e45a78d7 54 else
3a7bdcc6 55 call_user_func ($tabhandler[$pageno][$tabno]);
e45a78d7
DO
56}
57elseif (isset ($page[$pageno]['handler']))
9a289f12
DO
58{
59 showMessageOrError();
e673ee24 60 $page[$pageno]['handler'] ($tabno);
9a289f12 61}
e673ee24 62else
3a089a44 63 throw new RackTablesError ("Failed to find handler for page '${pageno}', tab '${tabno}'", RackTablesError::INTERNAL);
e673ee24
DO
64?>
65 </td>
66 </tr>
67 </table>
90a3d6d8 68<?php
65e557dd
AA
69 $body = ob_get_clean();
70 ob_start();
71 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
72 echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
73 echo '<head><title>' . getTitle ($pageno) . "</title>\n";
74 printPageHeaders();
75 echo "</head>\n";
76 echo "<body>\n$body</body>\n";
77 echo '</html>';
78 ob_flush();
90a3d6d8
DY
79} catch (Exception $e) {
80 ob_end_clean();
81 printException($e);
82}
65e557dd 83