<?php
// ----------------------------------------------------------------------
// Copyright (C) 2007 by GREGORY LE BRAS
// ----------------------------------------------------------------------
// LICENSE
//
// This file is part of ODCNMS - Open DataCenter Network Management System
//
// ODCNMS is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Foobar is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Foobar; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// ----------------------------------------------------------------------
// Original Author of file: GREGORY LE BRAS - http://www.odcnms.org/
// ----------------------------------------------------------------------
include('version.php');
if(file_exists("config/config.php")) // If config/config.php exist
{
ini_set('session.cookie_lifetime', 0);
ini_set('session.gc_maxlifetime', 5);
session_start();
if (isset($_SESSION['lang']))
{
$session_lang = $_SESSION['lang'];
include('language/'.$session_lang.'.php');
}
else
{
include('language/en.php');
}
include ("config/config.php");
include ("function/function.php");
include ("class/syslog.php");
$db_connect=mysql_connect($mysql_hostname,$mysql_username,$mysql_password);
mysql_select_db($mysql_database,$db_connect);
if ((isset($_SESSION['login'])) && (!empty($_SESSION['login'])))
{
$_SESSION['login'] = $login;
if ((!isset($_SESSION['user_authentication'])) && (empty($_SESSION['user_authentication'])))
{
user_authentication ($_SESSION['login'],$name_table_users,$mysql_hostname,$mysql_username,$mysql_password,$mysql_database);
}
if ((!isset($_SESSION['user_log'])) && (empty($_SESSION['user_log'])))
{
$currentdate = date('Y-m-d');
$currenttime = date("H:i:s");
user_log ($_SESSION['login'],$name_table_users,$name_table_users_log,"login","login","login",$mysql_hostname,$mysql_username,$mysql_password,$mysql_database);
foreach ($syslog_server as $arrayvalue)
{
$syslog = new Syslog();
$syslog->SetFacility(13);
$syslog->SetSeverity(5);
$syslog->SetProcess('odcnms');
$syslog->SetHostname('');
$syslog->SetFqdn('');
$syslog->SetIpFrom('');
$syslog->SetContent($currentdate.' '.$currenttime.' user: '.$_SESSION['login'].' - login');
$syslog->SetServer($arrayvalue);
$syslog->Send();
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>ODCNMS</title>
<link rel="shortcut icon" href="images/favicon.gif">
<link href="stylesheets/style.css" rel=StyleSheet type=text/css>
<script language="JavaScript" type="text/javascript" src="javascript/javascript.js"></script>
<script language="JavaScript" type="text/javascript" src="javascript/slider.js"></script>
<script language="JavaScript" type="text/javascript" src="javascript/network_calculator.js"></script>
<script language="JavaScript" type="text/javascript" src="javascript/javascript_test.js"></script>
<script language="JavaScript" type="text/javascript" src="javascript/selectbox.js"></script>
<script language="JavaScript" type="text/javascript" src="javascript/OptionTransfer.js"></script>
<script language="JavaScript" type="text/javascript" src="javascript/gen_validatorv2.js" ></script>
<script language="JavaScript" type="text/javascript" src="javascript/sortable.js" ></script>
<script language="JavaScript" type="text/javascript" src="javascript/prototype_window/prototype.js"> </script>
<script language="JavaScript" type="text/javascript" src="javascript/prototype_window/effects.js"> </script>
<script language="JavaScript" type="text/javascript" src="javascript/prototype_window/window.js"> </script>
<script language="JavaScript" type="text/javascript" src="javascript/prototype_window/debug.js"> </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<link href="images/themes/default.css" rel="stylesheet" type="text/css">
<link href="images/themes/alert.css" rel="stylesheet" type="text/css">
<link href="images/themes/alphacube.css" rel="stylesheet" type="text/css">
<script src="TreeMenu.js" language="JavaScript" type="text/javascript"></script>
<link href="TreeMenu.css" rel="stylesheet" type="text/css">
<?php
// Include dynamic style sheet.
echo '<style type="text/css">'."\n <!--\n";
if (file_exists( 'ccSiteStyle.css.php' )) {
include_once( 'ccSiteStyle.css.php' );
}
else {
include_once( $_SERVER['DOCUMENT_ROOT'] . '/ccSiteStyle.css.php' );
}
echo "\n -->\n</style>\n";
if (false) {
?>
<link href="/ccSiteStyle.css" rel="stylesheet" type="text/css">
<?php } ?>
</head>
<noscript>
<div id="noscript"><?php echo TXT_NO_SCRIPT; ?></div>
</noscript>
<body onLoad="<?php if (isset($network_ident)) { echo "addnetworkinfo(document.getElementById('network').form,document.getElementById('network').value);calcamountsubnet('add_subnet');opt.init(document.forms[0]);";} else if (isset($network_ident2)) { echo "calcaddress(document.getElementById('network').options[document.getElementById('network').selectedIndex].value);calcnode('add_subnet');calcbroadcastaddress('add_subnet');calciprange('add_subnet');A_SLIDERS[0].f_setValue(document.getElementById('snmbits').value);"; } else echo "opt.init(document.forms[0])";?>">
<a name="top"></a>
<div id="container">
<div id="header">
<div id="usernav"><b><?php echo TXT_WELCOME; ?> <?php echo $_SESSION['login']; ?></b> | <img src="images/user.png" alt="USER" align="top"> <a href="index.php?include=myaccount"><?php echo TXT_MY_ACCOUNT; ?></a> | <img src="images/help.gif" alt="Help" align="top"> <a href="index.php?include=help"><?php echo TXT_HELP; ?></a> | <img src="images/user_go.png" alt="USERGO" align="top"> <a href="logout.php"><?php echo TXT_LOGOUT; ?></a></div>
<div id="logo"><img src="images/logo_odcnms.png" alt="LOGO ODCNMS" align="center"></div>
</div>
<div id="nav">
<ul>
<?php
if (empty($include)) $include = "mainview";
switch($include)
{
case 'mainview':
echo "<li id=\"active\"><a href=\"index.php?include=mainview\"><img src=\"images/mainview.gif\" alt=\"Mainview\" align=\"top\" border=\"0\"> ";
echo TXT_MAINVIEW;
echo "</a></li>
<li><a href=\"index.php?include=search\"><img src=\"images/search.gif\" alt=\"Search\" align=\"top\" border=\"0\"> ";
echo TXT_SEARCH;
echo "</a></li>
<li><a href=\"index.php?include=administration\"><img src=\"images/administration.gif\" alt=\"Administration\" align=\"top\" border=\"0\"> ";
echo TXT_ADMINISTRATION;
echo "</a></li>";
break;
case 'search':
echo "<li><a href=\"index.php?include=mainview\"><img src=\"images/mainview.gif\" alt=\"Mainview\" align=\"top\" border=\"0\"> ";
echo TXT_MAINVIEW;
echo "</a></li>
<li id=\"active\"><a href=\"index.php?include=search\"><img src=\"images/search.gif\" alt=\"Search\" align=\"top\" border=\"0\"> ";
echo TXT_SEARCH;
echo "</a></li>
<li><a href=\"index.php?include=administration\"><img src=\"images/administration.gif\" alt=\"Administration\" align=\"top\" border=\"0\"> ";
echo TXT_ADMINISTRATION;
echo "</a></li>";
break;
case 'administration':
echo "<li><a href=\"index.php?include=mainview\"><img src=\"images/mainview.gif\" alt=\"Mainview\" align=\"top\" border=\"0\"> ";
echo TXT_MAINVIEW;
echo "</a></li>
<li><a href=\"index.php?include=search\"><img src=\"images/search.gif\" alt=\"Search\" align=\"top\" border=\"0\"> ";
echo TXT_SEARCH;
echo "</a></li>
<li id=\"active\"><a href=\"index.php?include=administration\"><img src=\"images/administration.gif\" alt=\"Administration\" align=\"top\" border=\"0\"> ";
echo TXT_ADMINISTRATION;
echo "</a></li>";
break;
case 'help':
echo "<li><a href=\"index.php?include=mainview\"><img src=\"images/mainview.gif\" alt=\"Mainview\" align=\"top\" border=\"0\"> ";
echo TXT_MAINVIEW;
echo "</a></li>
<li><a href=\"index.php?include=search\"><img src=\"images/search.gif\" alt=\"Search\" align=\"top\" border=\"0\"> ";
echo TXT_SEARCH;
echo "</a></li>
<li><a href=\"index.php?include=administration\"><img src=\"images/administration.gif\" alt=\"Administration\" align=\"top\" border=\"0\"> ";
echo TXT_ADMINISTRATION;
echo "</a></li>
<li id=\"active\"><a href=\"index.php?include=help\"><img src=\"images/help.gif\" alt=\"HELP\" align=\"top\" border=\"0\"> Help</a></li>";
break;
case 'myaccount':
echo "<li><a href=\"index.php?include=mainview\"><img src=\"images/mainview.gif\" alt=\"Mainview\" align=\"top\" border=\"0\"> ";
echo TXT_MAINVIEW;
echo "</a></li>
<li><a href=\"index.php?include=search\"><img src=\"images/search.gif\" alt=\"Search\" align=\"top\" border=\"0\"> ";
echo TXT_SEARCH;
echo "</a></li>
<li><a href=\"index.php?include=administration\"><img src=\"images/administration.gif\" alt=\"Administration\" align=\"top\" border=\"0\"> ";
echo TXT_ADMINISTRATION;
echo "</a></li>
<li id=\"active\"><a href=\"index.php?include=myaccount\"><img src=\"images/user.png\" alt=\"USER\" align=\"top\" border=\"0\"> My Account</a></li>";
break;
}
?>
</ul>
</div>
<div id="wrapper">
<?php if (isset($var)) $include = $var; if (empty($include)) $include = "mainview"; if (strlen($include) > 50) $include = "pagenotfound"; else if (!file_exists("include/".$include.".php")) $include = "pagenotfound"; include("include/".$include.".php"); ?>
</div>
<div id="footer">
Open DataCenter Network Management System <b style="font-size:100%;color:black">Version <?php echo "$version"; ?></b>
</div>
</div>
</body>
</html>
<?php
}
else
{
include("include/login.php");
}
}
else
{
header("Location: install.php");
}
?>