Files
librenms-librenms/html/index.php
T

143 lines
4.2 KiB
PHP
Raw Normal View History

2009-09-07 11:07:59 +00:00
<?php
2011-03-17 11:48:03 +00:00
ob_start();
ini_set('allow_url_fopen', 0);
ini_set('display_errors', 0);
2011-03-17 11:48:03 +00:00
if (strpos($_SERVER['REQUEST_URI'], "debug"))
{
$debug = "1";
2007-04-03 14:10:23 +00:00
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
ini_set('error_reporting', E_ALL);
2010-08-21 12:54:42 +00:00
} else {
$debug = FALSE;
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
ini_set('log_errors', 0);
ini_set('error_reporting', 0);
2007-04-03 14:10:23 +00:00
}
2011-03-17 11:48:03 +00:00
include("../includes/defaults.inc.php");
include("../config.php");
include("../includes/functions.php");
include("includes/functions.inc.php");
include("includes/authenticate.inc.php");
$start = utime();
$now = time();
$day = time() - (24 * 60 * 60);
$twoday = time() - (2 * 24 * 60 * 60);
$week = time() - (7 * 24 * 60 * 60);
$month = time() - (31 * 24 * 60 * 60);
$year = time() - (365 * 24 * 60 * 60);
# Load the settings for Multi-Tenancy.
if (is_array($config['branding'])) {
if ($config['branding'][$_SERVER['SERVER_NAME']])
{
foreach ($config['branding'][$_SERVER['SERVER_NAME']] as $confitem => $confval)
{
eval("\$config['" . $confitem . "'] = \$confval;");
}
} else {
foreach ($config['branding']['default'] as $confitem => $confval)
{
eval("\$config['" . $confitem . "'] = \$confval;");
}
}
2011-03-17 11:48:03 +00:00
}
2007-04-03 14:10:23 +00:00
?>
2010-01-09 21:47:08 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2007-04-03 14:10:23 +00:00
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
2008-10-30 21:27:48 +00:00
<title><?php echo($config['page_title']); ?></title>
<base href="<?php echo($config['base_url']); ?>" />
2009-03-17 20:29:54 +00:00
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="content-language" content="en-us" />
2008-03-23 21:32:54 +00:00
<?php
2011-03-17 11:48:03 +00:00
if ($config['page_refresh']) { echo("<meta http-equiv='refresh' content='".$config['page_refresh']."'>"); }
2008-03-23 21:32:54 +00:00
?>
2010-01-09 00:17:02 +00:00
<link href="<?php echo($config['stylesheet']); ?>" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="<?php echo($config['favicon']); ?>" />
2010-01-09 00:17:02 +00:00
<link rel="stylesheet" href="css/mktree.css" type="text/css" />
2007-04-03 14:10:23 +00:00
</head>
2010-01-09 00:17:02 +00:00
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
2010-01-10 18:47:32 +00:00
<script type="text/javascript" src="js/mktree.js"></script>
<script type="text/javascript">
2007-04-03 14:10:23 +00:00
<!-- Begin
2011-03-17 11:48:03 +00:00
function popUp(URL)
{
2007-04-03 14:10:23 +00:00
day = new Date();
id = day.getTime();
2011-03-17 11:48:03 +00:00
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=600');");
2007-04-03 14:10:23 +00:00
}
// End -->
2010-01-10 18:47:32 +00:00
</script>
<script type="text/javascript" src="js/overlib.js"></script>
<div id="center">
2007-04-03 14:10:23 +00:00
<?php include("includes/".$config['web_header']); ?>
2009-06-19 10:43:02 +00:00
2011-03-17 11:48:03 +00:00
<?php if ($_SESSION['authenticated']) {include("includes/print-menubar.php"); } else {echo('<hr color="#444444" />'); } ?>
2007-04-03 14:10:23 +00:00
2010-01-10 18:47:32 +00:00
<div class="clearer"></div>
2007-04-03 14:10:23 +00:00
2010-01-10 18:47:32 +00:00
<div class="content-mat" style="border: 1px none #fcc;">
<div id="content" style="border: 1px none #ccc; min-height:650px;">
<div style="margin: 7px;"></div>
2007-04-03 14:10:23 +00:00
<?php
2011-03-17 11:48:03 +00:00
if ($_SESSION['authenticated'])
{
## Authenticated. Print a page.
if (isset($_GET['page']) && !strstr("..", $_GET['page']) && is_file("pages/" . $_GET['page'] . ".inc.php"))
{
include("pages/" . $_GET['page'] . ".inc.php");
} else {
if (isset($config['front_page']) && is_file($config['front_page']))
{
include($config['front_page']);
} else {
include("pages/front/default.php");
2007-04-03 14:10:23 +00:00
}
2011-03-17 11:48:03 +00:00
}
2011-03-17 11:48:03 +00:00
} else {
## Not Authenticated. Print login.
include("pages/logon.inc.php");
exit;
}
2007-04-03 14:10:23 +00:00
?>
</div>
2010-01-10 18:47:32 +00:00
<div class="clearer"></div>
</div>
</div>
2007-04-03 14:10:23 +00:00
<?php
2011-03-17 11:48:03 +00:00
$end = utime(); $run = $end - $start;
$gentime = substr($run, 0, 5);
2011-03-17 11:48:03 +00:00
echo('<br /> <br /> <br /> <br /> <div id="footer">' . (isset($config['footer']) ? $config['footer'] : ''));
echo('<br />Powered by <a href="http://www.observium.org" target="_blank">Observium ' . $config['version']);
2011-03-17 11:48:03 +00:00
if (file_exists('.svn/entries'))
{
$svn = File('.svn/entries');
echo('-SVN r' . trim($svn[3]));
unset($svn);
}
2011-03-17 11:48:03 +00:00
echo('</a>. Copyright &copy; 2006-'. date("Y"). ' by Adam Armstrong. All rights reserved.');
2011-03-17 11:48:03 +00:00
if ($config['page_gen'])
{
echo('<br />Generated in ' . $gentime . ' seconds.');
}
2011-03-17 11:48:03 +00:00
echo('</div>');
2007-04-03 14:10:23 +00:00
?>
</body>
</html>