r4178 bugfix: PHP warnings were appearing before rackspace on SLB object page, defaul...
[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
1d4d254b
AA
17// call the main handler - page or tab handler.
18// catch exception and show its error message instead of page/tab content
19try {
e45a78d7 20if (isset ($tabhandler[$pageno][$tabno]))
08408472 21 call_user_func ($tabhandler[$pageno][$tabno], getBypassValue());
e45a78d7 22elseif (isset ($page[$pageno]['handler']))
e673ee24
DO
23 $page[$pageno]['handler'] ($tabno);
24else
1d4d254b 25 showError ("Failed to find handler for page '${pageno}', tab '${tabno}'");
08408472 26$content = ob_get_clean();
1d4d254b
AA
27} catch (Exception $e) {
28 ob_clean();
29 $content = '';
30 showError ("Unhandled exception: " . $e->getMessage());
31}
32
08408472 33ob_start();
e673ee24 34?>
08408472
AA
35<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
36<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
37<head><title><?php echo getTitle ($pageno); ?></title>
38<?php printPageHeaders(); ?>
39</head>
40<body>
41<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" class="maintable">
42 <tr class="mainheader"><td>
43 <table width="100%" cellspacing="0" cellpadding="2" border="0">
44 <tr>
45 <td valign=top><a href="http://racktables.org/"><?php printImageHREF ('logo'); ?></a></td>
46 <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
47 </tr>
48 </table>
49 </td></tr>
50 <tr><td class="menubar">
51 <table border="0" width="100%" cellpadding="3" cellspacing="0">
52 <tr><?php showPathAndSearch ($pageno); ?></tr>
53 </table>
54 </td></tr>
55 <tr><td><?php showTabs ($pageno, $tabno); ?></td></tr>
1d4d254b 56 <tr><td><?php showMessageOrError(); ?></td></tr>
08408472
AA
57 <tr><td><?php echo $content; ?></td></tr>
58</table>
59</body>
60</html>
e410ebfc 61<?php
65e557dd 62 ob_flush();
90a3d6d8
DY
63} catch (Exception $e) {
64 ob_end_clean();
65 printException($e);
66}
1d4d254b 67clearMessages(); // prevent message appearing in foreign tab
e410ebfc 68?>