Location: PHPKode > projects > SnortCenter 2.x > snortcenter-release/top.inc.php
<?php
    /*
    ** SnortCenter Copyright (C) 2001,2002,2003 Stefan Dens
    **
    ** Author: Stefan Dens <hide@address.com>
    **
    ** This program 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.
    **
    ** This program 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 this program; if not, write to the Free Software
    ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    */
?>
<?php

    include("config.php");
    if (($User_authentication == 1) || (($User_authentication == 2) && (strpos($PHP_SELF, 'db_pars.php') === false) && ($source  != "net"))) {
        $db_user = NewACIDDBConnection($DBlib_path, $DBtype);
        $db_user->acidConnect($DB_dbname, $DB_host, $DB_port, $DB_user, $DB_password);
        $tblUsers_present = $db_user->acidTableExists("users");
        $fldACL_present = $db_user->acidFieldExists ("users", "acl");
        if ($tblUsers_present && $fldACL_present) {
            include("login.inc.php");
        }
        $db_user->acidClose();
    }
    include('layout_class.php');

    if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE")  !== false) {
        $menu_height = 82;
    } else {
        $menu_height = 75;
    }
?>

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<!-- SnortCenter -->
<HTML>
<HEAD>
<META name="Author" content="Stefan Dens">
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<?php
    if ((strpos($PHP_SELF, 'sensor.php')  !== false) && (strpos($PHP_SELF, 'add_sensor.php') === false) && ($sensor_ctl  != 'stop') && ($sensor_ctl  != 'start') && ($sensor_ctl  != 'restart') && ($sensor_ctl  != 'push') && ($sensor_ctl  != 'view') && ($sensor_ctl  != 'download') && ($sensor_ctl  != 'test')) {
        echo '<META HTTP-EQUIV="REFRESH" CONTENT="180"; URL="'.$PHP_SELF.'";>'."\n";
    }
?>
<TITLE>SnortCenter</TITLE>
<SCRIPT Language=Javascript>
function SelectAll()
{
    for(var i=0;i<document.ruleform.elements.length;i++)
    {
	if(document.ruleform.elements[i].type == "checkbox")
	{
	    document.ruleform.elements[i].checked = true;
        }
    }
}
function UnselectAll()
{
    for(var i=0;i<document.ruleform.elements.length;i++)
    {
        if(document.ruleform.elements[i].type == "checkbox")
    	{
	    document.ruleform.elements[i].checked = false;
	}
    }
}
function Invers()
{
   temp = document.ruleform.elements.length ;
   for (i=0; i < temp; i++)
    {
	if(document.ruleform.elements[i].checked == 1)
	{
	    document.ruleform.elements[i].checked = 0;
	}
	else {document.ruleform.elements[i].checked = 1}
   }
}
</SCRIPT>
<script language="JavaScript1.2" src="images/fw_menu.js"></script>
<style>  		           
A:link { text-decoration: none; color: #000000}
A:visited { text-decoration: none; color: #000000}  
A:hover { text-decoration: underline;}
body {scrollbar-face-color: #BBBBBB; scrollbar-shadow-color: #BBBBBB; scrollbar-highlight-color: #CCCCCC; scrollbar-3dlight-color: #666666 ; scrollbar-darkshadow-color: #666666 ; scrollbar-track-color: #CCCCCC ; scrollbar-arrow-color: #666666 }
textarea,
input,
select
 { font-family: Times; font-size: 12px; color: #003366; border-width : 1; background-color: #FFFFFF; border-color: black; }	
</style>
</HEAD>

<body bgcolor="#3b577a" leftmargin=0 rightmargin=0>

<div align="center"> 
<table width="98%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr> 
<td> 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#006699"> 
<td width="100%" colspan="3" height="24" style="background :url(./images/topbar_back.png);">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="24" style="background :url(./images/topbar_left.png) no-repeat;">&nbsp;<font color="#FFFFFF" face="Times, Verdana, Arial, Helvetica, sans-serif" size="1"><b><font face="Trebuchet MS" size="2">&nbsp;<!-- #BeginEditable "Title%20Bar" --><font color="#FFFFFF" face="Times,Verdana, Arial, Helvetica, sans-serif" size="1"><b><font face="Times, Trebuchet MS" size="2">
<?php echo "$snortcenter_ver"; ?>
</font></b></font></font></b></font> 
</td><td>&nbsp;</td><td height="24" style="background :url(./images/topbar_right.png) no-repeat right;">
<div align="right"><a href="" onclick="window.close()"><img alt="Close Window" align=middle height="15" border="0" src="./images/shut_button.png"></a>&nbsp;</div>
</td></tr></table></td></tr>

<?php
    
    if(!$sensor_id) {
	$db = NewACIDDBConnection($DBlib_path, $DBtype);
	$db->acidConnect($DB_dbname, $DB_host, $DB_port, $DB_user, $DB_password);
	if($db->acidTableExists("schema")){
	    $result = $db->acidExecute("SELECT id FROM sensor ORDER BY sensor_name");
            $myrow = $result->acidFetchRow();
    	    $sensor_id = $myrow[0];
	}
    }
    include("menu.php");
    $bar = new layout;
    $bar->menu_item('<script language="JavaScript1.2">fwLoadMenus();</script>');
    $bar->menu_item("<a href=\"sensor.php?sensor_id=$sensor_id\" onMouseOut=\"MM_swapImgRestore(); FW_startTimeout()\" onMouseOver=\"window.FW_showMenu(window.sensors,$menu_pos[sensors],$menu_height); MM_displayStatusMsg('Sensor Console Page'); MM_swapImage('sensor_console','','$lang_images_dir/sensor_console_y.png',1); return document.MM_returnValue\" ><img name=\"sensor_console\" src=\"$lang_images_dir/sensor_console_w.png\" height=\"39\" border=\"0\"></a>");
    $bar->menu_item("<a href=\"sensor_rules.php?sensor_id=$sensor_id&category=$category&s_pos=$s_pos\" onMouseOut=\"MM_swapImgRestore(); FW_startTimeout()\" onMouseOver=\"window.FW_showMenu(window.sensor_config,$menu_pos[rules],$menu_height); MM_displayStatusMsg('Sensor Configuration Page'); MM_swapImage('rules','','$lang_images_dir/sensor_config_y.png',1); return document.MM_returnValue\" ><img name=\"rules\" src=\"$lang_images_dir/sensor_config_w.png\" height=\"39\" border=\"0\"></a>");
    $bar->menu_item("<a onMouseOut=\"MM_swapImgRestore(); FW_startTimeout()\" onMouseOver=\"window.FW_showMenu(window.config,$menu_pos[config],$menu_height); MM_displayStatusMsg('Config Page'); MM_swapImage('config_types','','$lang_images_dir/resources_y.png',1); return document.MM_returnValue\" ><img name='config_types' src=\"$lang_images_dir/resources_w.png\" height=\"39\" border=\"0\"></a>");
    $bar->menu_item("<a onMouseOut=\"MM_swapImgRestore(); FW_startTimeout()\" onMouseOver=\"window.FW_showMenu(window.admin,$menu_pos[admin],$menu_height); MM_displayStatusMsg('Admin Configuration Page'); MM_swapImage('admin','','$lang_images_dir/admin_y.png',1); return document.MM_returnValue\" ><img name=\"admin\" src=\"$lang_images_dir/admin_w.png\" height=\"39\" border=\"0\"></a>");
    #$bar->banner('&nbsp;&nbsp;<FONT size=6px><b>SnortCenter</b></font>');
    $bar->display_top();
     
    // begin hoofd scherm
    echo '<tr>
        <td width="1" bgcolor="#006699" background="./images/leftside.gif">&nbsp;</td>';
    echo '<td width="100%">';
    echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center">';
    echo '<tr>';
    // begin van middel
     
    echo'<td style="color: #FFFFFF" bgcolor="#OOOOOO" valign="top">';
    
    if (!$sensor_id) {
        $db_check = NewACIDDBConnection($DBlib_path, $DBtype);
	$db_check->acidConnect($DB_dbname, $DB_host, $DB_port, $DB_user, $DB_password);
        if(!$db_check->acidTableExists("schema")){
            echo "<BR><CENTER>Creating Database Tables ...<p>";
	    include('database.php');
	    echo "<BR>Done.<BR><BR></CENTER>";
	    include('bottom.inc.php');
	    exit;
	}
    }
?>
Return current item: SnortCenter 2.x