Initial revision

This commit is contained in:
Rainer Gerhards 2004-11-02 12:06:34 +00:00
commit 3ba2be96cb
53 changed files with 6139 additions and 0 deletions

586
classes/eventfilter.php Normal file
View File

@ -0,0 +1,586 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
if( !isset($_SESSION['change']) )
$_SESSION['change'] = "Predefined";
/*!
* This is the filter for the events.
*
*/
//error_reporting(E_ALL);
class EventFilter
{
var $TimeInterval; /*!< String coming from the URL describing the selected time interval.
* The variable from the url is "ti"
* Four scenarios are possible:
* Case 1: ti = the string "min" + the number of minutes of the selected
* time interval.
* Case 2: ti = the string "thishour"
* Case 3: ti = the string "today"
* Case 4: ti = the string "yesterday"
*/
var $BeginTime; //!< Timestamp when the interval begins
var $EndTime; //!< Timestamp when the interval ends
var $TimeInMinutes; //!< Actual time interval in minutes
var $UserDefaultTimeInterval; //!< The time interval set as default in the user's options menu
var $SQLWhereTime; //!< Contains the where part of the SQL statement
var $OrderBy; //!< Sorting argument
var $SQLWherePart; //!< Contains the whole SQL where part
var $SQLWhereInfoUnit; //!< Restriction of InfoUnit type
var $SQLWherePriority; //!< Restriction of Priority
var $SQLWhereHost; //!< Restriction of ip/host
var $SQLWhereMsg; //!< Message must contain a certain string
/*! Constructor
*
* Get filter settings form url or if not available, get the user's default filter settings
* from the database.
*/
function EventFilter()
{
// get the selected mode (time period)
$this->TimeInterval = $_SESSION['ti'];
//Order argument
$this->OrderBy = $_SESSION['order'];
if($_SESSION['change'] == 'Predefined')
{
$this->SelectTimeMode();
}
else if ($_SESSION['change'] == 'Manually')
{
$this->ManuallyTime();
}
}
/*!
* Set $BeginTime and $EndTime if the user has selected manually events date
*/
function ManuallyTime()
{
$tmp_endtime = mktime(23, 59, 59, $_SESSION['m2'], $_SESSION['d2'], $_SESSION['y2']);
$tmp_endtime > 0 ? $this->EndTime = $tmp_endtime : 0;
$tmp_begintime = mktime(0, 0, 0, $_SESSION['m1'], $_SESSION['d1'], $_SESSION['y1']);
$tmp_begintime > 0 ? $this->BeginTime = $tmp_begintime : 0;
}
/*!
* Get the default Time Interval from the user profil. This is stored in the database.
*/
function GetDefaultTimeInterval()
{
// instead of this read from session/database-->
$this->UserDefaultTimeInterval = "today";
}
/*!
* SelectMode decide on the TimeInterval variable which functions have to call to set the time interval.
* Possible modes are "thishour", "today" and an indication in minutes. This function also prove if
* TimeInterval valid. If invalid it used the default setting for TimeInterval from the user profil getting from
* the database.
*
*/
function SelectTimeMode()
{
// if TimeInterval is not transmitted by url, get the TimeInterval from the UserProfil
if (empty($this->TimeInterval))
$this->GetDefaultTimeInterval();
switch ($this->TimeInterval)
{
case "thishour":
$this->SetTimeIntervalThisHour();
break;
case "today":
$this->SetTimeIntervalToday();
break;
case "yesterday":
$this->SetTimeIntervalYesterday();
break;
default:
if (substr($this->TimeInterval, 0, 3) == "min")
{
//This is to convert the string after the "min"(from the URL) into an integer
$tmpTi = substr($this->TimeInterval, 3);
if (!is_numeric($tmpTi))
die(" $tmpTi is no number");
//string + int = int! this is required, because is numeric don't prove /-- etc.
$this->TimeInMinutes = $tmpTi+0;
$this->SetTimeIntervalMin($this->TimeInMinutes);
}
else
{
//this occurs only if an invalid value comes from the url
switch ($this->UserDefaultTimeInterval)
{
//if user has thishour set as default
case "thishour":
$this->SetTimeIntervalThisHour();
break;
//if user has today set as default
case "today":
$this->SetTimeIntervalToday();
break;
case "yesterday":
$this->SetTimeIntervalYesterday();
break;
//if user has his own number of minutes(e.g. 60) set as default
default:
$this->SetTimeInterval($this->UserDefaultTimeInterval);
}
}
}
}
/*!
* Calculate the time interval for this hour and set EndTime and EndTime. EndTime of the time interval is now,
* BeginTime is the start time of the current hour. You get the current unix timestamp
* with time(), wich is equel to EndTime. To get the BeginTime, easily take the current timestamp
* and set the minutes and seconds to 0..
*
* \remarks An example: Current time is 2003-05-05 11:53:21. In this case EndTime = 2003-05-05 11:53:21
* and BeginTime = 2003-05-05 11:00:00.
*
*/
function SetTimeIntervalThisHour()
{
$mytime = time();
$y = date("Y", $mytime);
$m = date("m", $mytime);
$d = date("d", $mytime);
$h = date("H", $mytime);
$this->EndTime = $mytime;
$this->BeginTime = mktime($h, 0, 0, $m, $d, $y);
//$this->EndTime = date("Y-m-d H:i:s", time());
//$this->BeginTime = date("Y-m-d H", time()) . ":00:00";
}
/*!
* Calculate the time interval for today and set BeginTime and EndTime. EndTime of the time interval is now,
* BeginTime is the date of today with hour 00:00:00. You get the current unix timestamp
* with time(), which is equal to EndTime. To get the BeginTime take the date of the current
* timestamp and set the hour to 00:00:00.
*
* \remarks An example: Current time is 2003-05-05 11:53:21. In this case EndTime = 2003-05-05 11:53:21
* and BeginTime = 2003-05-05 00:00:00.
*/
function SetTimeIntervalToday()
{
$mytime = time();
$y = date("Y", $mytime);
$m = date("m", $mytime);
$d = date("d", $mytime);
$this->EndTime = $mytime;
$this->BeginTime = mktime(0, 0, 0, $m, $d, $y);
//$this->EndTime = date("Y-m-d H:i:s", time());
//$this->BeginTime = date("Y-m-d ", time()) . "00:00:00";
}
/*!
* Calculate the time interval for yesterday and set BeginTime and EndTime. EndTime of the time interval is now,
* BeginTime is the date of today with hour 00:00:00. You get the current unix timestamp
* with time(), which is equal to EndTime. To get the BeginTime take the date of the current
* timestamp and set the hour to 00:00:00.
*
* \remarks An example: Current time is 2003-05-05 11:53:21. In this case EndTime = 2003-05-04 23:59:59
* and BeginTime = 2003-05-04 00:00:00.
*/
function SetTimeIntervalYesterday()
{
$mytime = time();
$y = date("Y", $mytime);
$m = date("m", $mytime);
$d = date("d", $mytime);
$d--;
$this->EndTime = mktime(23, 59, 59, $m, $d, $y);
$this->BeginTime = mktime(0, 0, 1, $m, $d, $y);
//$this->EndTime = date("Y-m-d H:i:s", time());
//$this->BeginTime = date("Y-m-d ", time()) . "00:00:00";
}
/*!
* Calculates the time in minutes from now to the beginning of the interval and set EndTime and EndTime.
* To do this, get the current timestamp with time(), which is equal to EndTime, and take from it TimeInMinutes off.
*
* \remarks An example: Current time is 2003-05-05 11:53:21 and TimeInMinutes are 60. In this case
* EndTime is 2003-05-05 11:53:21 and BeginTime = 2003-05-05 10:53:21.
*
* \param TimeInMinutes describe how many minutes are between the BeginTime and EndTime
*/
function SetTimeIntervalMin($TimeInMinutes)
{
$mytime = time();
$this->BeginTime = $mytime - $TimeInMinutes*60;
$this->EndTime = $mytime;
}
// generate HTML to display in quick menu bar
// returns: string, html to be displayed
function GetHTMLQuickDisplay()
{
}
/*!
* To calculate the the UTC Timestamp
* \param timestamp of the local system
* \return timestamp, UTC time
*/
function GetUTCtime($iTime)
{
if ( $iTime == 0 ) $iTime = time();
$ar = localtime ( $iTime );
$ar[5] += 1900; $ar[4]++;
$iTztime = gmmktime ( $ar[2], $ar[1], $ar[0],
$ar[4], $ar[3], $ar[5], $ar[8] );
return ( $iTime - ($iTztime - $iTime) );
}
/*!
* Use this to set SQLWhereTime which is part of the sql where clause.
* This is responsilbe for the limitation of the requested data by time.
*/
function SetSQLWhereTime()
{
if (_UTCtime)
$this->SQLWhereTime = _DATE . ' >= ' . dbc_sql_timeformat($this->GetUTCtime($this->BeginTime)) . ' AND ' . _DATE . ' <= ' . dbc_sql_timeformat($this->GetUTCtime($this->EndTime));
else
$this->SQLWhereTime = _DATE . ' >= ' . dbc_sql_timeformat($this->BeginTime) . ' AND ' . _DATE . ' <= ' . dbc_sql_timeformat($this->EndTime);
}
/*!
* Use this to get a part of the sql where clause.
* This is responsilbe for the limitation of the requested data by time.
* \return A string, part of the SQL where clause (time argument)
*/
function GetSQLWhereTime()
{
$this->SetSQLWhereTime();
return $this->SQLWhereTime;
}
/*!
* Use this to set SQLWhereInfoUnit which is part of the sql where clause.
* This set the InfoUnit restriction.
*/
function SetSQLWhereInfoUnit()
{
// sl = 1, er = 3, o
// sl-er-o (matrix)
// 0-0-0 -> all InfoUnit #0
// 0-0-1 -> only o #1
// 0-1-0 -> only er #2
// 0-1-1 -> not sl #3
// 1-0-0 -> only sl #4
// 1-0-1 -> not er #5
// 1-1-0 -> only sl and er#6
// 1-1-1 -> all InfoUnit #7
$tmpSQL[0][0][0]= '';
$tmpSQL[0][0][1]= ' AND (InfoUnitID<>1 AND InfoUnitID<>3) ';
$tmpSQL[0][1][0]= ' AND InfoUnitID=3 ';
$tmpSQL[0][1][1]= ' AND InfoUnitID<>1 ';
$tmpSQL[1][0][0]= ' AND InfoUnitID=1 ';
$tmpSQL[1][0][1]= ' AND InfoUnitID<>3 ';
$tmpSQL[1][1][0]= ' AND (InfoUnitID=1 or InfoUnitID=3) ';
$tmpSQL[1][1][1]= '';
$this->SQLWhereInfoUnit = $tmpSQL[$_SESSION['infounit_sl']][$_SESSION['infounit_er']][$_SESSION['infounit_o']];
/*
if ($_SESSION['infounit_sl'] == 1)
{
if ($_SESSION['infounit_er'] == 1)
{
if ($_SESSION['infounit_o'] == 1) { $tmpSQL = ''; } // #7
else { $tmpSQL = ' AND (InfoUnitID=1 or InfoUnitID=3) '; } // #6
}
else
{
if ($_SESSION['infounit_o'] == 1)
{ $tmpSQL = ' AND InfoUnitID<>3 '; } // #5
else
{ $tmpSQL = ' AND InfoUnitID=1 '; } // #4
}
}
else
{
if ($_SESSION['infounit_er'] == 1)
{
if ($_SESSION['infounit_o'] == 1) { $tmpSQL = ' AND InfoUnitID<>1 '; } // #3
else { $tmpSQL = ' AND InfoUnitID=3 '; } // #2
}
else
{
if ($_SESSION['infounit_o'] == 1) { $tmpSQL = ' AND (InfoUnitID<>1 AND InfoUnitID<>3) '; } // #1
else { $tmpSQL = ''; } // #0
}
}
*/
}
/*!
* Use this to get a part of the sql where clause.
* This sort out the InfoUnit type.
* \return A string, part of the SQL where clause (InfoUnit type restriction)
*/
function GetSQLWhereInfoUnit()
{
$this->SetSQLWhereInfoUnit();
return $this->SQLWhereInfoUnit;
}
function SetSQLWherePriority()
{
//Optimizing Query...
if ($_SESSION['priority_0'] == 1 and $_SESSION['priority_1'] == 1 and $_SESSION['priority_2'] == 1 and $_SESSION['priority_3'] == 1 and $_SESSION['priority_4'] == 1 and $_SESSION['priority_5'] == 1 and $_SESSION['priority_6'] == 1 and $_SESSION['priority_7'] == 1)
{
$this->SQLWherePriority = "";
}
else
{
if ($_SESSION['priority_0'] == 1 or $_SESSION['priority_1'] == 1 or $_SESSION['priority_2'] == 1 or $_SESSION['priority_3'] == 1 or $_SESSION['priority_4'] == 1 or $_SESSION['priority_5'] == 1 or $_SESSION['priority_6'] == 1 or $_SESSION['priority_7'] == 1)
{
$tmpSQL = ' AND (';
$orFlag = false;
if ($_SESSION['priority_0'] == 1)
{
$tmpSQL.='Priority=0';
$orFlag=true;
}
if ($_SESSION['priority_1'] == 1)
{
if ($orFlag)
$tmpSQL.=' or ';
$tmpSQL.='Priority=1';
$orFlag=true;
}
if ($_SESSION['priority_2'] == 1)
{
if ($orFlag)
$tmpSQL.=' or ';
$tmpSQL.='Priority=2';
$orFlag=true;
}
if ($_SESSION['priority_3'] == 1)
{
if ($orFlag)
$tmpSQL.=' or ';
$tmpSQL.='Priority=3';
$orFlag=true;
}
if ($_SESSION['priority_4'] == 1)
{
if ($orFlag)
$tmpSQL.=' or ';
$tmpSQL.='Priority=4';
$orFlag=true;
}
if ($_SESSION['priority_5'] == 1)
{
if ($orFlag)
$tmpSQL.=' or ';
$tmpSQL.='Priority=5';
$orFlag=true;
}
if ($_SESSION['priority_6'] == 1)
{
if ($orFlag)
$tmpSQL.=' or ';
$tmpSQL.='Priority=6';
$orFlag=true;
}
if ($_SESSION['priority_7'] == 1)
{
if ($orFlag)
$tmpSQL.=' or ';
$tmpSQL.='Priority=7';
$orFlag=true;
}
$tmpSQL.=')';
}
else
{
$tmpSQL = '';
}
$this->SQLWherePriority = $tmpSQL;
}
}
/*!
* Use this to get a part of the sql where clause.
* This sort out the priority.
* \return A string, part of the SQL where clause (Priority restriction)
*/
function GetSQLWherePriority()
{
$this->SetSQLWherePriority();
return $this->SQLWherePriority;
}
/*!
* Use this to get a part of the sql where clause.
* This search only for a single ip or host.
* \return A string, part of the SQL where clause (Host restriction)
*/
function GetSQLWhereHost()
{
$this->SetSQLWhereHost();
return $this->SQLWhereHost;
}
/*!
* Use this to get a part of the sql where clause.
* This is responsilbe for the limitation of the requested data by ip/host.
*/
function SetSQLWhereHost()
{
$tmpSQL='';
// filhost must be validate in include!
if (isset($_SESSION['filhost']))
{
if (!empty($_SESSION['filhost']))
$tmpSQL.=" AND FromHost='".$_SESSION['filhost']."'";
}
$this->SQLWhereHost = $tmpSQL;
}
/*!
* Use this to get a part of the sql where clause.
* This search only for a single ip or host.
* \return A string, part of the SQL where clause (Host restriction)
*/
function GetSQLWhereMsg()
{
$this->SetSQLWhereMsg();
return $this->SQLWhereMsg;
}
/*!
* Use this to get a part of the sql where clause.
* This is responsilbe for the limitation of the requested data by ip/host.
*/
function SetSQLWhereMsg()
{
$tmpSQL='';
// filhost must be validate in include!
if (isset($_SESSION['searchmsg']))
{
if (!empty($_SESSION['searchmsg']))
$tmpSQL.=" AND Message like '".db_get_wildcut().$_SESSION['searchmsg'].db_get_wildcut()."'";
}
$this->SQLWhereMsg = $tmpSQL;
}
/*!
* Use this to get a part of the sql where clause.
* This is responsilbe for the limitation of the requested data by time.
*/
function SetSQLWherePart($time_only)
{
if($time_only == 1)
{
$this->SQLWherePart = $this->GetSQLWhereTime();
}
else
{
$this->SQLWherePart = $this->GetSQLWhereTime().$this->GetSQLWhereInfoUnit().$this->GetSQLWherePriority().$this->GetSQLWhereHost().$this->GetSQLWhereMsg();
}
}
/*!
* Use this to get a part of the sql where clause.
* This is responsilbe for the limitation of the requested data by time.
* \return A string, the SQL where part
*/
function GetSQLWherePart($time_only)
{
if($time_only == 1)
{
$this->SetSQLWherePart(1);
}
else
{
$this->SetSQLWherePart(0);
}
return $this->SQLWherePart;
}
/*!
* Use this to get the part of the sql part, responsible for the sorting argument.
* \return A string, part of the SQL where clause (sorting argument)
*/
function GetSQLSort()
{
switch ($this->OrderBy)
{
case "Date":
$tmpSQL = ' ORDER BY '._DATE.' DESC';
break;
case "Facility":
$tmpSQL = ' ORDER BY Facility';
break;
case "Priority":
$tmpSQL = ' ORDER BY Priority';
break;
case "FacilityDate":
$tmpSQL = ' ORDER BY Facility, '._DATE.' DESC';
break;
case "PriorityDate":
$tmpSQL = ' ORDER BY Priority, '._DATE.' DESC';
break;
case "Host":
$tmpSQL = ' ORDER BY FromHost';
break;
default:
$tmpSQL = ' ORDER BY '._DATE.' DESC';
break;
}
return $tmpSQL;
}
}
?>

View File

@ -0,0 +1,157 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*!
* EventsNavigation Class gernerates a navigation menu to handle the
* result output.
*
* Tasks:
* - distribute the result output on several sides
* - generate navigation elements (menu) to walk through the sides
*/
class EventsNavigation
{
var $PageSize; //! number of lines to be displayed
var $PageNumber; //! number of current page
var $PageBegin; //! 1st recordset of page
var $PageEnd; //! last recordset of page
var $EventCount; //! total number of pages
var $NavigationLeftArrow; //! << link to the previous page
var $NavigationRightArrow; //! >> link to the next page
var $NavigationFirstPage; //! <<<< link to the start page
var $NavigationLastPage; //! >>>> link to the last page
//! Constructor
function EventsNavigation($size)
{
$this->PageSize=$size;
$this->PageNumber = (!isset($_GET["pagenum"]) || $_GET["pagenum"] == 0 || empty($_GET["pagenum"])) ? 1 : $_GET["pagenum"];
$this->EventCount = 0;
}
//! Returns how many lines to be displayed per page
function GetPageSize()
{
return $this->PageSize;
}
//! points to the first line, which is to be indicated on the current side
function GetLimitLower()
{
$limitlower = ($this->PageNumber-1) * $this->PageSize + 1;
$limitlower = ($limitlower > $this->EventCount) ? $this->EventCount - $this->PageSize : $limitlower;
$limitlower = ($limitlower <= 0) ? $limitlower = 1 : $limitlower;
return $limitlower;
}
//! points to the last line, which is to be indicated on the current side
function GetLimitUpper()
{
$limitupper = $this->PageNumber * $this->PageSize;
$limitupper = ($limitupper > $this->EventCount) ? $this->EventCount : $limitupper;
return $limitupper;
}
//! get the number of the current page
function GetPageNumber()
{
return $this->PageNumber;
}
//! genreate the html output to display the ne
function SetNavigation($url_query)
{
//for displaying purposes ( page list )
$page = ($this->EventCount < $this->GetPageSize()) ? 1 : ceil($this->EventCount / $this->GetPageSize());
if($this->GetPageNumber() > 1)
{
$this->NavigationLeftArrow = "<a href=\"" .$_SERVER['PHP_SELF']."?".$url_query."&pagenum=".($this->GetPageNumber()-1)."\" class=\"searchlink\"> &laquo; </a>";
$this->NavigationFirstPage = "<a href=\"" .$_SERVER['PHP_SELF']."?".$url_query."&pagenum=1\" class=\"searchlink\"> &laquo;&laquo; </a>";
}
else
{
$this->NavigationLeftArrow = "<span class=\"diseablesearchlink\"> &laquo; </span>";//unable
$this->NavigationFirstPage = "<span class=\"diseablesearchlink\"> &laquo;&laquo; </span>";//enable
}
if($this->GetPageNumber() < $page)
{
$this->NavigationRightArrow = "<a href=\"" .$_SERVER['PHP_SELF']."?".$url_query."&pagenum=".($this->GetPageNumber()+1)."\" class=\"searchlink\"> &raquo; </a>";
$this->NavigationLastPage = "<a href=\"" .$_SERVER['PHP_SELF']."?".$url_query."&pagenum=".$page."\" class=\"searchlink\"> &raquo;&raquo; </a>";
}
else
{
$this->NavigationRightArrow = "<span class=\"diseablesearchlink\"> &raquo; </span>";
$this->NavigationLastPage = "<span class=\"diseablesearchlink\"> &raquo;&raquo; </span>";
}
return $page;
}
//! genreate the navigation menu output
function ShowNavigation()
{
//query string without pagenum
$url_para = RemoveArgFromURL($_SERVER['QUERY_STRING'], "pagenum");
$page = $this->SetNavigation($url_para);
echo $this->NavigationFirstPage." ".$this->NavigationLeftArrow;
for($a=$this->GetPageNumber()-3;$a<=$this->GetPageNumber()+3;$a++)
{
if($a > 0 && $a <= $page)
{
if($a==$this->GetPageNumber())
echo "&nbsp;<span class=\"thissite\">$a</span>";
else
echo "&nbsp;<a href=\"" .$_SERVER['PHP_SELF']."?".$url_para."&pagenum=".$a."\" class=\"searchlink\">".$a."</a>";
}
}
echo $this->NavigationRightArrow." ".$this->NavigationLastPage;
}
//! send a database query to get the total number of events which are available
//! save the result in $EventCount
function SetEventCount($db_con, $restriction)
{
//get the counter result without limitation
$result = db_exec($db_con, db_num_count($restriction));
$result = db_fetch_array($result);
$this->EventCount = $result[0]; //so many data records were found
}
//! returns the total number of available events
function GetEventCount()
{
return $this->EventCount;
}
function SetPageNumber($val)
{
$this->PageNumber = $val;
}
}
?>

143
config.php Normal file
View File

@ -0,0 +1,143 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
// Set some defaults
ini_set("register_globals", "1");
/*
**************************************************
* Begin of config variables *
* * ** * *
* You can change these settings to your need *
* * ** * *
* Only change if you know what you are doing *
**************************************************
*/
/*
***** BEGIN DATABASE SETTINGS *****
*/
//Server name (only needed if you not use ODBC)
define('_DBSERVER', 'localhost');
// DSN (ODBC) or database name (Mysql)
define('_DBNAME', 'phplogcon');
// Userid for database connection ***
define('_DBUSERID', 'root');
// Password for database connection ***
define('_DBPWD', '');
// table name
define('_DBTABLENAME', 'systemevents');
// Switch for connection mode
// Currently only odbc and native works
define('_CON_MODE', 'native');
// Defines the Database Application you are using,
// because for example thx ODBC syntax of MySQL
// and Microsoft Access/SQL Server/etc are different
// Currently available are:
// with native: mysql
// with ODBC: mysql and mssql are available
define('_DB_APP', 'mysql');
/*
***** END DATABASE SETTINGS *****
*/
/*
***** BEGIN FOLDER SETTINGS *****
*/
//The folder where the classes are stored
define('_CLASSES', 'classes/');
//The folder where the forms are stored
define('_FORMS', 'forms/');
//The folder where the database drivers are stored
define('_DB_DRV', 'db-drv/');
//The folder where the language files are stored
define('_LANG', 'lang/');
//your image folder
define('_ADLibPathImage', 'images/');
//folder for scripts i.g. extern javascript
define('_ADLibPathScript', 'layout/');
/*
***** END FOLDER SETTINGS *****
*/
/*
***** BEGIN VARIOUS SETTINGS *****
*/
//Set to 1 and User Interface will be used! Set 0 to disable it.
define('_ENABLEUI', 0);
//This sets the default language that will be used.
define('_DEFLANG', 'en');
// Use UTC time
define('_UTCtime', 1);
// Get messages date by ReceivedAt or DeviceReportedTime
define('_DATE', 'ReceivedAt');
// Coloring priority
define('_COLPriority', 1);
/*
***** END VARIOUS SETTINGS *****
*/
/*
******************************************************
* * ** * *
* From this point you shouldn't change something *
* * ** * *
* Only change if it is really required *
******************************************************
*/
// Show quick filter enabled = 1, disabled = 0:
define('_FilterInfoUnit', 1);
define('_FilterOrderby', 1);
define('_FilterRefresh', 1);
define('_FilterColExp', 1);
define('_FilterHost', 1);
define('_FilterMsg', 1);
//Session expire time. Unix-Timestamp. To set this value:
//call time(), that returns the seconds from 1.1.1970 (begin Unix-epoch) and add the
//time in seconds when the cookie should expire.
$session_time = (time()+(60*10));
//Cookie expire time. Unix-Timestamp. How to set this value, see "session_time".
define('_COOKIE_EXPIRE', (time()+60*60*24*30));
?>

194
db-drv/mysql.php Normal file
View File

@ -0,0 +1,194 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*
* This file contains the function for database connection
* via mysql
*/
/*! \addtogroup DB Converter
*
* All converter functions using to prepare things to work with database queries
* use the prefix "dbc_"
* @{
*/
/*
* Generate the tags for a time argument using in a sql statment
* \param timestamp which need tags
* \return timestamp_with_tags returns the timestamp with tags in the nesessary format
*/
function dbc_sql_timeformat($times)
{
return "'".date("Y-m-d H:i:s", $times)."'";
}
/*! @} */
/*
* Database driver
*/
/*
* Attempts to establish a connection to the database.
* /return the connection handle if the connection was successful, NULL if the connection was unsuccessful.
*/
function db_connection()
{
$db = mysql_connect(_DBSERVER, _DBUSERID, _DBPWD) or db_die_with_error(_MSGNoDBCon);
mysql_select_db(_DBNAME) or db_die_with_error(_MSGChDB);
return $db;
}
function db_own_connection($host, $port, $user, $pass, $dbname)
{
if($port != 0)
$db = mysql_connect($host . ":" . $port, $user, $pass) or db_die_with_error(_MSGNoDBCon);
else
$db = mysql_connect($host, $user, $pass) or db_die_with_error(_MSGNoDBCon);
mysql_select_db($dbname) or db_die_with_error(_MSGChDB);
return $db;
}
/*
* Executes the SQL.
* /param db Database connection handle
* /param cmdSQL SQL statement
*
* /return Resource handle
*/
function db_exec($db, $cmdSQL)
{
//echo "<br><br><b>" . $cmdSQL . "</b><br><br>";
$result = mysql_query($cmdSQL, $db) or db_die_with_error(_MSGInvQur);
return $result;
}
/*
* Executes the SQL.
* /param res Rescource hanndle
*
* /return The number of rows in the result set.
*/
function db_num_rows($res)
{
$result = mysql_num_rows($res) or db_die_with_error(_MSGNoRes);
return $result;
}
/*
* Fetch a result row as an associative array, a numeric array, or both.
* /param res Rescource hanndle
*
* /return Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.
*/
function db_fetch_array($res)
{
$result = mysql_fetch_array($res);// or db_die_with_error(_MSGNoRes);
return $result;
}
/*
* db_fetch_singleresult is need in ODBC mode, so db_fetch_singleresult and db_fetch_array
* are the same in MySQL
*/
function db_fetch_singleresult($result)
{
$result = mysql_fetch_array($result) or db_die_with_error(_MSGNoRes);
return $result;
}
/*
* Get the result data.
* /param res Rescource hanndle
* /param res_name either be an integer containing the column number of the field you want;
or it can be a string containing the name of the field. For example:
*
* /return the contents of one cell from the result set.
*/
function db_result($res, $res_name)
{
$result = mysql_result($res, 1, $res_name) or db_die_with_error(_MSGNoRes);
return $result;
}
function db_close($db)
{
mysql_close($db) or db_die_with_error(_MSGNoDBHan);
}
function db_num_count($cmdSQLwhere_part)
{
return 'SELECT COUNT(*) AS num FROM ' . _DBTABLENAME . $cmdSQLwhere_part;
}
/*
* fetch a result row as an a numeric array
* the array points to the first data record you want to display
* at current page. You need it for paging.
*/
function db_exec_limit($db, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLwhere_part, $limitlower, $perpage)
{
$cmdSQL = $cmdSQLfirst_part . $cmdSQLmain_part . $cmdSQLwhere_part . " limit ".($limitlower-1)."," . $perpage;
return db_exec($db, $cmdSQL);
}
function db_free_result($result)
{
return mysql_free_result($result);
}
function db_errno()
{
return mysql_errno();
}
function db_error()
{
return mysql_error();
}
function db_die_with_error($MyErrorMsg)
{
$errdesc = mysql_error();
$errno = mysql_errno();
$errormsg="<br>Database error: $MyErrorMsg <br>";
$errormsg.="mysql error: $errdesc <br>";
$errormsg.="mysql error number: $errno<br>";
$errormsg.="Date: ".date("d.m.Y @ H:i")."<br>";
$errormsg.="Script: ".getenv("REQUEST_URI")."<br>";
$errormsg.="Referer: ".getenv("HTTP_REFERER")."<br><br>";
echo $errormsg;
exit;
}
/*
* Returns what wildcut the database use (e.g. %, *, ...)
*/
function db_get_wildcut()
{
return '%';
}
?>

161
db-drv/odbc_mssql.php Normal file
View File

@ -0,0 +1,161 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*
SQL_CURSOR_TYPE (integer)
SQL_CURSOR_FORWARD_ONLY (integer)
SQL_CURSOR_KEYSET_DRIVEN (integer)
SQL_CURSOR_DYNAMIC (integer)
SQL_CURSOR_STATIC (integer)
*/
/*
* This file contains the function for database connection
* via odbc
*/
// Converter
function dbc_sql_timeformat($timestamp)
{
//use '#' for MS Access
//return "#".date("Y-m-d H:i:s", $timestamp)."#";
//return "#".date("m/d/Y H:i:s", $timestamp)."#";
return "{ ts '".date("Y-m-d H:i:s", $timestamp)."' }";
}
// Driver
function db_connection()
{
return odbc_connect(_DBNAME, _DBUSERID, _DBPWD, SQL_CUR_USE_ODBC);
}
function db_own_connection($host, $port, $user, $pass, $dbname)
{
$db = odbc_connect($dbname, $user, $pass, SQL_CUR_USE_ODBC) or db_die_with_error(_MSGNoDBCon);
return $db;
}
function db_exec($db, $cmdSQL)
{
// echo "<br><br><b>" . $cmdSQL . "</b><br><br>";
return odbc_exec($db, $cmdSQL);
}
function db_num_rows($res)
{
return odbc_num_rows($res);
}
function db_fetch_row($res)
{
return odbc_fetch_row($res);
}
function db_fetch_singleresult($res)
{
return odbc_fetch_array($res);
}
function db_fetch_array($res)
{
//odbc_fetch_into replaced odbc_fetch_array, because
//in various php version the fetch_array doesnt work
//odbc_fetch_into($res, $myarray);
odbc_fetch_into($res, $myarray);
return $myarray;
}
function db_result($res, $res_name)
{
return odbc_result($res, $res_name);
}
function db_close($db)
{
odbc_close($db);
}
function db_num_count($cmdSQLwhere_part)
{
return 'SELECT DISTINCT COUNT(*) AS num FROM ' . _DBTABLENAME . substr($cmdSQLwhere_part, 0, strpos($cmdSQLwhere_part, 'ORDER BY'));
}
/*
* fetch a result row as an a numeric array,
* the array points to the first data record you want to display
* at current page. You need it for paging.
*/
function db_exec_limit($db, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLwhere_part, $limitlower, $perpage)
{
//you must move through the recordset
//until you reach the data record you want
//***if you know a better and more efficent methode, please let us know, too!
$tmp = $perpage + $limitlower - 1;
$cmdSQL = $cmdSQLfirst_part . "TOP " . $tmp . " " . $cmdSQLmain_part . $cmdSQLwhere_part;
return db_exec($db, $cmdSQL);
/*
for($i = 1; $i < $limitlower; $i++)
$row = odbc_fetch_row($result);
return $result;
*/
}
function db_free_result($result)
{
return odbc_free_result($result);
}
function db_errno()
{
return odbc_error();
}
function db_error()
{
return odbc_errormsg();
}
function db_die_with_error($MyErrorMsg)
{
$errdesc = odbc_errormsg();
$errno = odbc_error();
$errormsg="<br>Database error: $MyErrorMsg <br>";
$errormsg.="mysql error: $errdesc <br>";
$errormsg.="mysql error number: $errno<br>";
$errormsg.="Date: ".date("d.m.Y @ H:i")."<br>";
$errormsg.="Script: ".getenv("REQUEST_URI")."<br>";
$errormsg.="Referer: ".getenv("HTTP_REFERER")."<br><br>";
echo $errormsg;
exit;
}
function db_get_wildcut()
{
return '%';
}
?>

184
db-drv/odbc_mysql.php Normal file
View File

@ -0,0 +1,184 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*
* This file contains the function for database connection
* via mysql
*/
/*! \addtogroup DB Converter
*
* All converter functions using to prepare things to work with database queries
* use the prefix "dbc_"
* @{
*/
/*
* Generate the tags for a time argument using in a sql statment
* \param timestamp which need tags
* \return timestamp_with_tags returns the timestamp with tags in the nesessary format
*/
function dbc_sql_timeformat($times)
{
return "'".date("Y-m-d H:i:s", $times)."'";
}
/*! @} */
/*
* Database driver
*/
/*
* Attempts to establish a connection to the database.
* /return the connection handle if the connection was successful, NULL if the connection was unsuccessful.
*/
function db_connection()
{
return odbc_connect(_DBNAME, _DBUSERID, _DBPWD, SQL_CUR_USE_ODBC);
}
function db_own_connection($host, $port, $user, $pass, $dbname)
{
$db = odbc_connect($dbname, $user, $pass, SQL_CUR_USE_ODBC) or db_die_with_error(_MSGNoDBCon);
return $db;
}
/*
* Executes the SQL.
* /param db Database connection handle
* /param cmdSQL SQL statement
*
* /return Resource handle
*/
function db_exec($db, $cmdSQL)
{
// echo "<br><br><b>" . $cmdSQL . "</b><br><br>";
return odbc_exec($db, $cmdSQL);
}
/*
* Executes the SQL.
* /param res Rescource hanndle
*
* /return The number of rows in the result set.
*/
function db_num_rows($res)
{
return odbc_num_rows($res);
}
/*
* Fetch a result row as an associative array, a numeric array, or both.
* /param res Rescource hanndle
*
* /return Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.
*/
function db_fetch_array($res)
{
odbc_fetch_into($res, $myarray);
return $myarray;
}
/*
* db_fetch_singleresult is need in ODBC mode, so db_fetch_singleresult and db_fetch_array
* are the same in MySQL
*/
function db_fetch_singleresult($result)
{
return odbc_fetch_array($result);
}
/*
* Get the result data.
* /param res Rescource hanndle
* /param res_name either be an integer containing the column number of the field you want;
or it can be a string containing the name of the field. For example:
*
* /return the contents of one cell from the result set.
*/
function db_result($res, $res_name)
{
return odbc_result($res, 1, $res_name);
}
function db_close($db)
{
odbc_close($db);
}
function db_num_count($cmdSQLwhere_part)
{
return 'SELECT COUNT(*) AS num FROM ' . _DBTABLENAME . $cmdSQLwhere_part;
}
/*
* fetch a result row as an a numeric array
* the array points to the first data record you want to display
* at current page. You need it for paging.
*/
function db_exec_limit($db, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLwhere_part, $limitlower, $perpage)
{
$cmdSQL = $cmdSQLfirst_part . $cmdSQLmain_part . $cmdSQLwhere_part . " limit ".($limitlower-1)."," . $perpage;
return db_exec($db, $cmdSQL);
}
function db_free_result($result)
{
return odbc_free_result($result);
}
function db_errno()
{
return odbc_error();
}
function db_error()
{
return odbc_errormsg();
}
function db_die_with_error($MyErrorMsg)
{
$errdesc = odbc_error();
$errno = odbc_errno();
$errormsg="<br>Database error: $MyErrorMsg <br>";
$errormsg.="mysql error: $errdesc <br>";
$errormsg.="mysql error number: $errno<br>";
$errormsg.="Date: ".date("d.m.Y @ H:i")."<br>";
$errormsg.="Script: ".getenv("REQUEST_URI")."<br>";
$errormsg.="Referer: ".getenv("HTTP_REFERER")."<br><br>";
echo $errormsg;
exit;
}
/*
* Returns what wildcut the database use (e.g. %, *, ...)
*/
function db_get_wildcut()
{
return '%';
}
?>

151
db-drv/odbc_mysql_.php Normal file
View File

@ -0,0 +1,151 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*
SQL_CURSOR_TYPE (integer)
SQL_CURSOR_FORWARD_ONLY (integer)
SQL_CURSOR_KEYSET_DRIVEN (integer)
SQL_CURSOR_DYNAMIC (integer)
SQL_CURSOR_STATIC (integer)
*/
/*
* This file contains the function for database connection
* via odbc
*/
// Converter
function dbc_sql_timeformat($timestamp)
{
//use '#' for MS Access
//return "#".date("Y-m-d H:i:s", $timestamp)."#";
//return "#".date("m/d/Y H:i:s", $timestamp)."#";
return "{ ts '".date("Y-m-d H:i:s", $timestamp)."' }";
}
// Driver
function db_connection()
{
return odbc_connect(_DBNAME, _DBUSERID, _DBPWD, SQL_CUR_USE_ODBC);
}
function db_exec($db, $cmdSQL)
{
//echo "<br><br><b>" . $cmdSQL . "</b><br><br>";
return odbc_exec($db, $cmdSQL);
}
function db_num_rows($res)
{
return odbc_num_rows($res);
}
function db_fetch_row($res)
{
return odbc_fetch_row($res);
}
function db_fetch_singleresult($res)
{
return odbc_fetch_array($res);
}
function db_fetch_array($res)
{
//odbc_fetch_into replaced odbc_fetch_array, because
//in various php version the fetch_array doesnt work
odbc_fetch_into($res, $myarray);
return $myarray;
}
function db_result($res, $res_name)
{
return odbc_result($res, $res_name);
}
function db_close($db)
{
odbc_close($db);
}
function db_num_count($cmdSQLwhere_part)
{
return 'SELECT DISTINCT COUNT(*) AS num FROM ' . _DBTABLENAME . substr($cmdSQLwhere_part, 0, strpos($cmdSQLwhere_part, 'ORDER BY'));
}
/*
* fetch a result row as an a numeric array,
* the array points to the first data record you want to display
* at current page. You need it for paging.
*/
function db_exec_limit($db, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLwhere_part, $limitlower, $perpage)
{
//you must move through the recordset
//until you reach the data record you want
//***if you know a better and more efficent methode, please let us know, too!
$cmdSQL = $cmdSQLfirst_part . $cmdSQLmain_part . $cmdSQLwhere_part . " limit ".($limitlower-1)."," . $perpage;
$result = db_exec($db, $cmdSQL);
for($i=1;$i<$limitlower;$i++)
$row = odbc_fetch_row($result);
return $result;
}
function db_free_result($result)
{
return odbc_free_result($result);
}
function db_errno()
{
return odbc_error();
}
function db_error()
{
return odbc_errormsg();
}
function db_die_with_error($MyErrorMsg)
{
$errdesc = odbc_errormsg();
$errno = odbc_error();
$errormsg="<br>Database error: $MyErrorMsg <br>";
$errormsg.="mysql error: $errdesc <br>";
$errormsg.="mysql error number: $errno<br>";
$errormsg.="Date: ".date("d.m.Y @ H:i")."<br>";
$errormsg.="Script: ".getenv("REQUEST_URI")."<br>";
$errormsg.="Referer: ".getenv("HTTP_REFERER")."<br><br>";
echo $errormsg;
exit;
}
function db_get_wildcut()
{
return '*';
}
?>

187
details.php Normal file
View File

@ -0,0 +1,187 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
require("include.php");
WriteStandardHeader(_MSGShwEvnDet);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<br /><a href="<? echo $_SERVER['HTTP_REFERER']; ?>">&lt;&lt; <?php echo _MSGBck; ?></a><br />
<?php
//SQL statement
//Row Index
//EventLogType 0, EventSource 1, EventID 2, EventCategory 3, EventUser 4, FromHost 5, NTSeverity 6, ReceivedAt 7, DeviceReportedTime 8, Message 9, Facility 10, Priority 11, Importance 12
$lid = is_numeric($_GET['lid']) ? $_GET['lid']+0 : 0; // prevent manipulation
$sql = 'SELECT * FROM '._DBTABLENAME.' WHERE id='.$lid;
$res = db_exec($global_Con, $sql);
$row = db_fetch_singleresult($res);
function NTSeverityText($ntseverity)
{
switch ($ntseverity) //NTSeverity
{
case 0:
$ntseverity_txt = 'Success';
break;
case 1:
$ntseverity_txt = 'Error';
break;
case 2:
$ntseverity_txt = 'Warning';
break;
case 4:
$ntseverity_txt = 'Informational';
break;
case 8:
$ntseverity_txt = 'Audit Success';
break;
case 16:
$ntseverity_txt = 'Audit Failure';
break;
default:
die('Error Invalid NTSeverity number!');
}
return ($ntseverity_txt);
}
?>
<br>
<table border="0" cellspacing="1" cellpadding="4" CLASS="EventTable">
<?php
if($row['InfoUnitID'] == 3)
{
?>
<tr><td CLASS=TDHEADER><b><?php echo _MSGEvnLogTyp; ?></b></td><td CLASS=TD1><?php echo $row['EventLogType']; ?></td></tr>
<tr><td CLASS=TDHEADER><b><?php echo _MSGEvnSrc; ?></b></td><td CLASS=TD2><?php echo $row['EventSource']; ?></td></tr>
<tr>
<td CLASS=TDHEADER><b><?php echo _MSGEvnID; ?></b></td>
<td CLASS=TD1><a href="http://www.monitorware.com/en/events/details.asp?L2=<?php echo $row['EventLogType']; ?>&L3=<? echo $row['EventSource']; ?>&event_id=<?php echo $row['EventID']; ?>" target="_blank"><?php echo $row['EventID']; ?></a><?php echo _MSGClickBrw; ?><a href="http://groups.google.com/groups?hl=en&lr=&ie=ISO-8859-1&q=<?php echo $row['EventSource'] . " " . $row['EventID']; ?>" target="_blank">Google-Groups</a>)</td>
</tr>
<?php
if (intval($row['EventCategory']) != 0)
{
?>
<tr><td CLASS=TDHEADER><b><?php echo _MSGEvnCat; ?></b></td><td CLASS=TD2><?php echo $row['EventCategory']; ?></td></tr>
<?php
}
?>
<tr><td CLASS=TDHEADER><b><?php echo _MSGEvnUsr; ?></b></td><td CLASS=TD1><?php echo $row['EventUser']; ?></td></tr>
<?php
}
?>
<tr><td CLASS=TDHEADER><b><?php echo _MSGFrmHos; ?></b></td><td CLASS=TD2><?php echo $row['FromHost']; ?></td></tr>
<?php
if($row['InfoUnitID'] == 3)
{
?>
<tr><td CLASS=TDHEADER><b><?php echo _MSGNTSev; ?></b></td><td CLASS=TD1><?php echo NTSeverityText($row['NTSeverity']); ?></td></tr>
<?php
}
?>
<tr><td CLASS=TDHEADER><b><?php echo _MSGRecAt; ?></b></td><td CLASS=TD2><?php echo $row['ReceivedAt']; ?></td></tr>
<tr><td CLASS=TDHEADER><b><?php echo _MSGDevRep; ?></b></td><td CLASS=TD1><?php echo $row['DeviceReportedTime']; ?></td></tr>
<?php
//Read out words from phplogcon.ini which shouldn't be displayed
//and replace them by '*'
if($row['Message'] == "")
$tmpmsg = _MSGNoMsg;
else
$tmpmsg = $row['Message'];
$tmpmsg = htmlspecialchars($tmpmsg);
$file = file("phplogcon.ini");
if($file != FALSE)
{
$numarrayfile = count($file);
for($i = 0; $i < $numarrayfile; $i++)
{
$file[$i] = trim($file[$i]);
if($file[$i] != "#")
{
if($file[$i] == "[phplogcon]")
{
for($j = $i+1; $j < $numarrayfile; $j++)
{
if( stristr($file[$j], "wordsdontshow=") != FALSE )
{
$words = explode("=", $file[$j]);
$words = explode(",", $words[1]);
}
}
}
}
}
$numarraywords = count($words);
for($i = 0; $i < $numarraywords; $i++)
{
$repstr = "";
$words[$i] = trim($words[$i]);
for($j = 0; $j < strlen($words[$i]); $j++) $repstr .= "*";
if($words[$i] != "")
$tmpmsg = eregi_replace($words[$i], $repstr, $tmpmsg);
}
}
?>
<tr><td CLASS=TDHEADER><b><?php echo _MSGMsg; ?></b></td><td CLASS=TD2><?php echo $tmpmsg; ?></td></tr>
<tr><td CLASS=TDHEADER><?php echo _MSGFac; ?></td><td CLASS=TD1><?php echo $row['Facility']; ?></td></tr>
<tr><td CLASS=TDHEADER><?php echo _MSGPri; ?></td><td CLASS=TD2><?php echo $row['Priority']; ?></td></tr>
<tr><td CLASS=TDHEADER><?php echo _MSGImp; ?></td><td CLASS=TD1><?php echo $row['Importance']; ?></td></tr>
</table>
<?php
echo "</table>";
WriteFood();
?>

18
doc/credits.htm Normal file
View File

@ -0,0 +1,18 @@
<html>
<head>
<title>Credits</title>
<body>
<h1>Credits</h1>
<p>This project is funded by <a href="http://www.adiscon.com/en/">Adiscon</a>
and initiated by <a href="mailto:rgerhards@adiscon.com">Rainer Gerhards</a>.</p>
<p>The core development team is:</p>
<ul>
<li>Andre Lorbach <a href="mailto:(alorbach@adiscon.com">(alorbach@adiscon.com</a>)</li>
<li>Michael Meckelein <a href="mailto:(mmeckelein@adiscon.com">(mmeckelein@adiscon.com</a>)</li>
<li>Rainer Gerhards <a href="mailto:(rgerhards@adiscon.com">(rgerhards@adiscon.com</a>)</li>
</ul>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>.
Initiated by <a href="rgerhards@adiscon.com">Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

52
doc/design.htm Normal file
View File

@ -0,0 +1,52 @@
<html>
<head>
<title>phpLogCon Design Goals</title></head>
<body>
<h1>Design Goals</h1>
<p>phpLogCon&nbsp;enables the system administrator to quickly and easily review his
central log repository. It provides views typically used on log data. It
integrates with web resources for easy analysis of data found in the logs.</p>
<h2>Main Usage Points</h2>
<p>phpLogCon&nbsp;is primarily being used for</p>
<ul>
<li>
quick overview over current system activity
<li>
accessing the log data while not being able to access the admin workstation
(e.g. being on the road or roaming through the enterprise)</li>
</ul>
<p>For in-depth analysis, we recommend using the MonitorWare Console. It provides
advanced analysis capabilities not found inside phpLogCon.</p>
<h2>Portability</h2>
<p>phpLogCon&nbsp;is being implemented as a set of PHP scripts to ensure
portability between different platforms. Target platforms for&nbsp;phpLogCon
are:</p>
<ul>
<li>
Windows with IIS
<li>
Windows with Apache
<li>
Linux / *nix with Apache</li>
</ul>
<p>The standard set of database systems is supported, that is</p>
<ul>
<li>
Microsoft SQL Server (via ODBC)
<li>
Microsoft Jet (aka Access, via ODBC)
<li>
MySQL (via ODBC and via native classes)
<span style="BACKGROUND-COLOR: #ffff00">to be determined! Native
mysql is recommended for the
best performance!</span></li>
</ul>
<p>Of course, other database systems can most likely be used with&nbsp;phpLogCon -
we just can't guarantee that it will work (and we are also unable to reproduce
any issues in our lab, thus the need for limitation).&nbsp;</p>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare
Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>. Initiated by <a href="mailto:rgerhards@adiscon.com">
Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

39
doc/developer-notes.htm Normal file
View File

@ -0,0 +1,39 @@
<html>
<head>
<title>phpLogCon - Developer notes</title></head>
<body>
<h1>Developer notes</h1>
<p>
phpLogCon is an open source project. Feel free to change what you want. Here
you will find some hints and background knowledge about phpLogCon.</p>
<h2>Gernarel database connection functions</h2>
<p>The database function in phpLogCon are called similar to well-know commands from
e.g. php mysql functions. All database functions beginn with "db_" and
then a word that best describes the instruction. Sample: db_connect() -
should open a connection to the database. This is according to mysql_connect().
So you know if you find db_fetch_array in phpLogCon for example, that this
function should fetch a result row as an associative array, a numeric array, or
both.</p>
<H2>ODBC functions</H2>
<P>phpLogCon support also database connection via ODBC. You can find the functions in
db-drv\odbc.php. The most functions are in a very low basic level. The
reason, a lot of the php ODBC functions don't work with all
versions of php. Also the usability often depends on the ODBC driver.</P>
<p><b>Known Issues</b><br />At the moment you can only use ODBC for query Microsoft databases like MSSQL,
Jet, ... A second database layer which can handle different sql formats should be implement in the future!</p>
<H2>Include files</H2>
<H2>include.php</H2>
<P>This file is very important. There, all other files to
include are embedded (e. g. config files and so on). So if you
include include.php you have always include automatically all genral "include
files". Also you can find useful function in include.php. All functions
which should reachable at the whole program, you find there (or there
included).</P>
<P>Note: At each page of phpLogCon, include.php should be included!</P>
<P>&nbsp;</P>
<P><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare
Web Site]</a></small></P>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>. Initiated by <a href="mailto:rgerhards@adiscon.com">
Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

24
doc/getting-started.htm Normal file
View File

@ -0,0 +1,24 @@
<html>
<head>
<title>MonitorWare Web Interface - Getting Started</title></head>
<body>
<h1>
phpLogCon&nbsp;- Getting Started</h1>
<p>Getting started with&nbsp;phpLogCon is just a few simple steps:</p>
<ul>
<li>
make sure your system meets the minimum requirements
<li>
under windows, run the supplied setup program - under other environments,
extract the archive to a proper location
<li>
point your browser to the root of the phpLogCon
<li>
configure&nbsp;phpLogCon via the browser-based dialog that pops up</li>
</ul>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare
Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>. Initiated by <a href="mailto:rgerhards@adiscon.com">
Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

11
doc/history.htm Normal file
View File

@ -0,0 +1,11 @@
<html>
<head>
<title>phpLogCon - History</title>
<body>
<h1>MonitorWare Web Interface - Release History</h1>
<p>2003-03-05&nbsp;&nbsp;&nbsp; Actual project was started</p>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>.
Initiated by <a href="mailto:rgerhards@adiscon.com">Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

33
doc/index.htm Normal file
View File

@ -0,0 +1,33 @@
<html>
<head>
<title>phpLogCon 1.0</title></head>
<body>
<h1>phpLogCon 1.0</h1>
<p>phpLogCon is an easy to use solution for browsing syslog messages, Windows event log data and other network
events over the web. While originally initiated to work in conjunction with
Adiscon's MonitorWare product line, it can easily be modified to work with
other solutions as well.</p>
<ul>
<li>
<a href="design.htm">Design</a>
<li>
<a href="getting-started.htm">Getting Started</a>
<li>
<a href="using.htm">Using the Interface</a>
<li>
<a href="setup.htm">Setup</a>
<li>
<a href="credits.htm">Credits</a>
<li>
<a href="history.htm">release history</a>
<LI>
<A href="developer-notes.htm">developer notes</A></LI>
</ul>
<p>See <a href="http://www.monitorware.com/en/">http://www.monitorware.com/en/</a> for
further details about the MonitorWare solution.</p>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare
Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>. Initiated by <a href="mailto:rgerhards@adiscon.com">
Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

12
doc/license.htm Normal file
View File

@ -0,0 +1,12 @@
<html>
<head>
<title>MonitorWare Web Interface - License</title>
<body>
<h1>MonitorWare Web Interface - License</h1>
<p>MWWeb is currently under development. No license has yet been selected. Use
at your sole risk.</p>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>.
Initiated by <a href="mailto:rgerhards@adiscon.com">Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

34
doc/setup.htm Normal file
View File

@ -0,0 +1,34 @@
<html>
<head>
<title>phpLogCon - Setup</title></head>
<body>
<h1>
phpLogCon&nbsp;Setup</h1>
<ul>
<li>
For Windows installations, a setup program is included. Please note that the
product is also being installed by running either the WinSyslog or MonitorWare
Agent Setup programs.
<li>
For other environments, there is a zip file containing the full project
(including all pages and full documentation)
<li>
It is assumed that the MonitorWare database is already existing
-&nbsp;phpLogCon will NOT create it</li>
</ul>
<p>If you intend to use phpLogCon with a non-MonitorWare generated database, you
can easily do so. The key point is to make sure that the database contains all
necessary data at the right locations. You might want to look up the
MonitorWare schema to see what is needed. For syslog events, this should be
fairly simple to acomplish as only a limited set of fields is to be provided.
If you purchase our low-priced support contract, we will gladly assist you in
getting this going ;). Currently, the link to the schema is missing. This is
not by intention. If it is missing by the time you read us, contact <a href="mailto:support@adiscon.com">
support@adiscon.com</a>. The schema is of course provided freely, was just
not at hand while writing this...</p>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare
Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>. Initiated by <a href="mailto:rgerhards@adiscon.com">
Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

76
doc/using.htm Normal file
View File

@ -0,0 +1,76 @@
<html>
<head>
<title>phpLogCon - Using</title></head>
<body>
<h1>Using the Web Interface</h1>
<h2>General concepts</h2>
<h3>Overall Event Filter</h3>
<p>
All processing done by&nbsp;phpLogCon is relative to a user-selected filter.
That is, only events that match the applicable filter condition will be show.
In the initial release, the filter condition will be solely time-based. The
default filter is "today". Other filters are "the last nn minutes",
"the last nn hours", "today", "this week" and "from date ... to date ...".
The filter can always be set by following a link on top
of each web page.<h3>Page Layout</h3>
<p>Every page will follow a standard layout. It has three areas
<ul>
<li>
header
<li>
main work area
<li>
footer</li>
</ul>
<p>The <b>header</b> holds the top menu items and the current date and time. It
also has quick links to:</p>
<ul>
<li>
MonitorWare's Event Repository
<li>
MonitorWare's Event Discussion Groups
<li>
a text box with buttons to search Google and Google Groups
<li>
... other things may come up during developmen ...
<li>
a short description of the current filter as well as a way to change it (in the
initial release, a drop down list will do)</li>
</ul>
<p>When we have the notation of a user inside phpLogCon, this should probably come
out of the user profile. Over time, we may also provide dynamic links based on
what the user did last.</p>
<p>The <b>main work area </b>is the primary display/work space. Obviously its
content is depending on the called function.</p>
<p>The <b>footer</b> holds some general information:</p>
<ul>
<li>
copyright notice, credits to authors &amp; links to license</li>
</ul>
<h2>Homepage</h2>
<p>The main work area of the home displays statistical information:
<ul>
<li>
number of syslog events
<li>
number of event log events
<li>
top 5 devices reporting</li>
</ul>
<p>Of course, all of this in respect to the current filter.</p>
<h2>Utility functions</h2>
<h3>Configuration Page</h3>
<p>The configuration page allows the user to specify settings important for the
overall operation of phpLogCon. So far, it will allow to configure:
<UL>
<li>
connection string for the database (please note that passwords will be stored
unencrypted as of now)
<span style="BACKGROUND-COLOR: #ffff00">Question:
any easy way to avoid this?&nbsp;</span></li></UL>
<p><small><a href="index.htm">[Doc Home]</a> <a href="http://www.monitorware.com">[MonitorWare
Web Site]</a></small></p>
<p>Copyright &copy; 2003 by <a href="http://www.adiscon.com">Adiscon</a>. Initiated by <a href="mailto:rgerhards@adiscon.com">
Rainer Gerhards</a>. See <a href="license.htm">license</a> for details.</p>
</body>
</html>

224
events-display.php Normal file
View File

@ -0,0 +1,224 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
require('include.php');
WriteStandardHeader(_MSGShwEvn);
//classes
include _CLASSES . 'eventsnavigation.php';
include _CLASSES . 'eventfilter.php';
//the splitted sql statement
$cmdSQLfirst_part = 'SELECT ';
$cmdSQLmain_part = 'ID, '._DATE.', Facility, Priority, FromHost, Message, InfoUnitID FROM '._DBTABLENAME;
$cmdSQLlast_part = ' WHERE ';
//define the last part of the sql statment, e.g. the where part, ordery by, etc.
$myFilter = New EventFilter;
$cmdSQLlast_part .= $myFilter->GetSQLWherePart(0);
$cmdSQLlast_part .= $myFilter->GetSQLSort();
//Set Priority Filter if activated
/*if ($Priority!=0) {
$cmdSQLlast_part .= " where Priority = ".$Priority;
}
*/
//amount of data records displayed
if($_SESSION['epp'] < 1 || $_SESSION['epp'] > 100)
$myEventsNavigation = new EventsNavigation(20);
else
$myEventsNavigation = new EventsNavigation($_SESSION['epp']);
$myEventsNavigation->SetEventCount($global_Con, $cmdSQLlast_part);
$num = $myEventsNavigation->GetEventCount();
include "quick-filter.php";
/*
echo "<form method='POST' action=''>";
echo _MSGSrcExp . ": <input type='text' name='search' size='30'>\t";
echo "<input type='submit' value='" . _MSGSrc . "'>";
echo "\t<font color=red>Temporally UNAVAIBLE!!</font>";
echo "</form>";
*/
echo '<br><table>';
//SQL statement to get result with limitation
$res = db_exec_limit($global_Con, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLlast_part, $myEventsNavigation->GetLimitLower(), $myEventsNavigation->GetPageSize());
if($num == 0)
{
//output if no data exit for the search string
echo '<br><b>', _MSGNoData, '</b>';
}
else
{
echo '<tr><td align="left">';
echo _MSGEvn, ' ', $myEventsNavigation->GetLimitLower(), ' ', _MSGTo, ' ', $myEventsNavigation->GetLimitUpper(), ' ', _MSGFrm, ' ', $myEventsNavigation->GetEventCount();
echo '</td><td align="right">';
$myEventsNavigation->ShowNavigation();
?>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" CLASS="EventTable">
<tr CLASS=TDHEADER>
<td><?php echo _MSGDate; ?></td>
<td><?php echo _MSGFac; ?></td>
<td><?php echo _MSGPri; ?></td>
<td><?php echo _MSGInfUI; ?></td>
<td><?php echo _MSGHost; ?></td>
<td><?php echo _MSGMsg; ?></td>
</tr>
<?php
//Read out words from phplogcon.ini which shouldn't
//be displayed and replaced by '*'
$file = file('phplogcon.ini');
if($file != FALSE)
{
$numarrayfile = count($file);
for($i = 0; $i < $numarrayfile; $i++)
{
$file[$i] = trim($file[$i]);
if($file[$i] != '#')
{
if($file[$i] == '[phplogcon]')
{
for($j = $i+1; $j < $numarrayfile; $j++)
{
if( stristr($file[$j], 'wordsdontshow=') != FALSE )
{
$words = explode("=", $file[$j]);
$words = explode(",", $words[1]);
}
}
}
}
}
$numarraywords = count($words);
}
while($row = db_fetch_array($res))
{
if (db_errno() != 0)
{
echo db_errno() . ': ' . db_error(). '\n';
}
//choose InfoUnitdType 1 = SL = Syslog, 3 = Eventreporter, O = Other
switch ($row[6])
{
case 1:
$infounit = 'SL';
break;
case 3:
$infounit = 'ER';
break;
default:
$infounit = 'O';
}
static $tc = 1;
if($row[5] == "")
$message = _MSGNoMsg;
else
$message = $row[5];
echo '<tr>';
echo '<td CLASS=TD' . $tc . '><nobr>'.$row[1].'</nobr></td>'; //date
echo '<td CLASS=TD' . $tc . '>'.$row[2].'</td>'; //facility
// get the description of priority (and get the the right color, if enabled)
$pricol = 'TD' . $tc;
$priword = FormatPriority($row[3], $pricol);
echo '<td CLASS=', $pricol, '>', $priword, '</td>';
echo '<td CLASS=TD' . $tc . '>'.$infounit.'</td>'; //InfoUnit
echo '<td CLASS=TD' . $tc . '>'.$row[4].'</td>'; //host
$message = htmlspecialchars($message);
if(isset($_POST['regexp']) && $_POST['regexp'] != "")
{
$_POST['regexp'] = trim($_POST['regexp']);
$messageUp = strtoupper($message);
$regexpUp = strtoupper($_POST['regexp']);
$search_pos = strpos($messageUp, $regexpUp);
if($search_pos !== FALSE)
{
$regexpLng = strlen($_POST['regexp']);
$strCount = substr_count($messageUp, $regexpUp);
$strTmp = $message;
$message = "";
for($i = 0; $i < $strCount; $i++)
{
$messageUp = strtoupper($strTmp);
$search_pos = strpos($messageUp, $regexpUp);
$subStrSt = substr($strTmp, 0 , $search_pos);
$subStrExp = substr($strTmp, $search_pos, $regexpLng);
$subStrEnd = substr($strTmp, ($search_pos + $regexpLng));
$message .= $subStrSt . '<font color="' . $_POST['color'] . '">' . $subStrExp . '</font>';
if($i == ($strCount - 1))
$message .= $subStrEnd;
$strTmp = $subStrEnd;
}
}
}
//Replace the words that had been read out from the ini file
if($file != FALSE)
{
for($i = 0; $i < $numarraywords; $i++)
{
$repstr = '';
$words[$i] = trim($words[$i]);
for($j = 0; $j < strlen($words[$i]); $j++) $repstr .= '*';
if($words[$i] != '')
$message = eregi_replace($words[$i], $repstr, $message);
}
}
echo '<td CLASS=TD', $tc, '><a CLASS="Msg" href="details.php?lid=', $row[0] , '">', $message, '</a></td>'; //message
//for changing colors
if($tc == 1) $tc = 2;
else $tc = 1;
/*
echo "<td>".$row['Priority']."</td>";
*/
echo '</tr>';
}
}
echo '</table>';
WriteFood();
?>

174
filter-config-process.php Normal file
View File

@ -0,0 +1,174 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
include 'include.php';
/*
* Read all settings from cookie. If it not set, display a login screen.
* If the user authentified, read the settings from database. The user can
* also alter it's oven personal settings. For security reaseon the password
* is not store in the cookie. Therefore you must enter your password each time,
* if you want to change the settings.
*/
// General variables
$szRedirectLink = "";
$szDescription = "";
global $global_Con;
/*
// Get Action
if ( !isset($_POST['action'] ) )
$_POST['action'] = "";
if ($_POST['action'] == "ChangeGeneralConfig")
{
if ( !isset($_POST["enableui"]) )
$_POST["enableui"] = 0;
setcookie("connection_mode", $_POST['connection_mode'], time()+(60*60*24*365*10), "/");
*/
/* if( strcmp($_POST["enableui"], $_COOKIE["enable_ui"]) != 0)
{
if($_POST["enableui"] == "0")
{
setcookie("usr", "standard", _COOKIE_EXPIRE, "/");
setcookie("sesid", "0", _COOKIE_EXPIRE, "/");
}
else
{
setcookie("usr", "|", _COOKIE_EXPIRE, "/");
setcookie("sesid", "|", _COOKIE_EXPIRE, "/");
}
setcookie("enable_ui", $_POST['enableui'], time()+(60*60*24*365*10), "/");
}
$szRedirectLink = "index.php";
$szDescription = "General settings have been updated";
*/
if( !isset($_POST['filConf']) )
$_POST['filConf'] = "";
if($_POST['filConf'] == "FilterConfig")
{
// configure filter settings
$_SESSION['ti'] = $_POST['ti'];
$_SESSION['order'] = $_POST['order'];
$_SESSION['refresh'] = $_POST['refresh']+0; // +0 make sure that is numeric
// enable/disable quick filter options
$_SESSION['FilterInfoUnit'] = (isset($_POST['FilterInfoUnit'])) ? 1 : 0;
$_SESSION['FilterOrderby'] = (isset($_POST['FilterOrderby'])) ? 1 : 0;
$_SESSION['FilterRefresh'] = (isset($_POST['FilterRefresh'])) ? 1 : 0;
$_SESSION['FilterColExp'] = (isset($_POST['FilterColExp'])) ? 1 : 0;
$_SESSION['FilterHost'] = (isset($_POST['FilterHost'])) ? 1 : 0;
$_SESSION['FilterMsg'] = (isset($_POST['FilterMsg'])) ? 1 : 0;
// Set new info unit filter options
if ($_SESSION['FilterInfoUnit'] == 1 or isset($_POST['fromConfig']))
{
$_SESSION['infounit_sl'] = (isset($_POST['infounit_sl'])) ? 1 : 0;
$_SESSION['infounit_er'] = (isset($_POST['infounit_er'])) ? 1 : 0;
$_SESSION['infounit_o'] = (isset($_POST['infounit_o'])) ? 1 : 0;
}
// Set new priority filter options
$_SESSION['priority_0'] = (isset($_POST['priority_0'])) ? 1 : 0;
$_SESSION['priority_1'] = (isset($_POST['priority_1'])) ? 1 : 0;
$_SESSION['priority_2'] = (isset($_POST['priority_2'])) ? 1 : 0;
$_SESSION['priority_3'] = (isset($_POST['priority_3'])) ? 1 : 0;
$_SESSION['priority_4'] = (isset($_POST['priority_4'])) ? 1 : 0;
$_SESSION['priority_5'] = (isset($_POST['priority_5'])) ? 1 : 0;
$_SESSION['priority_6'] = (isset($_POST['priority_6'])) ? 1 : 0;
$_SESSION['priority_7'] = (isset($_POST['priority_7'])) ? 1 : 0;
// If all infounits are unchecked it makes no sense,
// because in this case, no messages were displayed.
// So, activate all infounit types
if($_SESSION['infounit_sl'] == 0 && $_SESSION['infounit_er'] == 0 & $_SESSION['infounit_o'] == 0)
{
$_SESSION['infounit_sl'] = 1;
$_SESSION['infounit_er'] = 1;
$_SESSION['infounit_o'] = 1;
}
// If all priorities are unchecked it makes no sense,
// because in this case, no messages were displayed.
// So, activate all priority types
if($_SESSION['priority_0'] == 0 and $_SESSION['priority_1'] == 0 and $_SESSION['priority_2'] == 0 and $_SESSION['priority_3'] == 0 and $_SESSION['priority_4'] == 0 and $_SESSION['priority_5'] == 0 and $_SESSION['priority_6'] == 0 and $_SESSION['priority_7'] == 0)
{
$_SESSION['priority_0'] = 1;
$_SESSION['priority_1'] = 1;
$_SESSION['priority_2'] = 1;
$_SESSION['priority_3'] = 1;
$_SESSION['priority_4'] = 1;
$_SESSION['priority_5'] = 1;
$_SESSION['priority_6'] = 1;
$_SESSION['priority_7'] = 1;
}
if(_ENABLEUI == 1)
{
//Save filter settings to database
if($_SESSION['savefiltersettings'])
{
$query = GetFilterConfigArray();
for($i = 0; $i < count($query); $i++)
db_exec($global_Con, $query[$i]);
}
}
}
$szRedirectLink = "filter-config.php";
$szDescription = "Your Personal filter settings have been updated";
?>
<html>
<head>
<?php
echo "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=".$szRedirectLink."\">";
?>
</head>
<title>Redirecting</title>
<Body>
<br><br><br><br>
<center>
<?php
echo "<h3>".$szDescription."</h3><br><br>";
echo "You will be redirected to <A HREF=\"$szRedirectLink\">this page</A> in 1 second.";
?>
</center>
</body>
</html>

203
filter-config.php Normal file
View File

@ -0,0 +1,203 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
require("include.php");
WriteStandardHeader(_MSGFilConf);
// If filter settings have been changed in quick filter, reload the old settings
if(isset($_SESSION['ti_old']))
{
$_SESSION['ti'] = $_SESSION['ti_old'];
$_SESSION['infounit_sl'] = $_SESSION['infounit_sl_old'];
$_SESSION['infounit_er'] = $_SESSION['infounit_er_old'];
$_SESSION['infounit_o'] = $_SESSION['infounit_o_old'];
$_SESSION['order'] = $_SESSION['order_old'];
$_SESSION['refresh'] = $_SESSION['refresh_old'];
session_unregister('ti_old');
session_unregister('infounit_sl_old');
session_unregister('infounit_er_old');
session_unregister('infounit_o_old');
session_unregister('order_old');
session_unregister('refresh_old');
}
?>
<?php /* Disabled!?>
<br>
<form method="POST" action="configuration-page-process.php" name="ConnectionConfig">
<input type="hidden" name="conConf" value="ConnectionConfig">
<center><h3>..:: <?php echo _MSGBscSet; ?> ::..</h3></center>
<center>
<table border="0" cellpadding="2" cellspacing="0" width="700" align="center" Class="ConfigTable">
<tr>
<td Class="Header1" colspan="2"><b><?php echo _MSGConSet; ?>:</b></td>
</tr>
<tr>
<td width="200" nowrap"><?php echo _MSGConMod; ?>:</td>
<td width="100%" align="right">
<?php
ComboBoxWithFilenames(_DB_DRV, "connection_mode");
?>
</td>
</tr>
<tr>
<td colspan="2"><font color="red">This function has been turned off! Set this in config.php!</font></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?php echo _MSGChg; ?>">
</td>
<td></td>
</tr>
</table>
</form>
</center>
<?php End Disabled*/ ?>
<br>
<form method="POST" action="filter-config-process.php" name="FilterConfig">
<input type="hidden" name="filConf" value="FilterConfig">
<center><h3>..:: <?php echo _MSGFilSet; ?> ::..</h3></td></center>
<center>
<table border="" cellpadding="2" cellspacing="0" width="700" align="center" Class="ConfigTable">
<tr>
<td colspan="3" Class="Header1">
<?php echo _MSGFilCon; ?>:
</td>
</tr>
<tr>
<td><?php echo _MSGEvnDat; ?>:</td>
<td>
<?php include _FORMS.'events-date.php'; ?>
</td>
</tr>
<tr>
<td><?php echo _MSGOrdBy; ?>:</td>
<td>
<?php include _FORMS.'order-by.php'; ?>
</td>
</tr>
<tr>
<td><?php echo _MSGRef; ?>:</td>
<td>
<?php include _FORMS.'refresh.php'; ?>
</td>
</tr>
<tr>
<td><?php echo _MSGInfUI; ?>:</td>
<td>
<input type=checkbox name="infounit_sl" value="1" <?php if ($_SESSION['infounit_sl'] == 1) echo 'checked'; ?>>SysLog<br>
<input type=checkbox name="infounit_er" value="1" <?php if ($_SESSION['infounit_er'] == 1) echo 'checked'; ?>>EventReporter<br>
<input type=checkbox name="infounit_o" value="1" <?php if ($_SESSION['infounit_o'] == 1) echo 'checked'; ?>><?php echo _MSGOth; ?>
</td>
</tr>
<tr>
<td><?php echo _MSGPri; ?>:</td>
<td>
<!-- 0=>Emergency ; 1=>Alert ; 2=>Critical ; 3=>Error ; 4=>Warning ; 5=>Notice ; 6=>Info ; 7=>Debug -->
<input type=checkbox name="priority_0" value="1" <?php if ($_SESSION['priority_0'] == 1) echo 'checked'; ?>>Emergency (0)<br>
<input type=checkbox name="priority_1" value="1" <?php if ($_SESSION['priority_1'] == 1) echo 'checked'; ?>>Alert (1)<br>
<input type=checkbox name="priority_2" value="1" <?php if ($_SESSION['priority_2'] == 1) echo 'checked'; ?>>Critical (2)<br>
<input type=checkbox name="priority_3" value="1" <?php if ($_SESSION['priority_3'] == 1) echo 'checked'; ?>>Error (3)<br>
<input type=checkbox name="priority_4" value="1" <?php if ($_SESSION['priority_4'] == 1) echo 'checked'; ?>>Warning (4)<br>
<input type=checkbox name="priority_5" value="1" <?php if ($_SESSION['priority_5'] == 1) echo 'checked'; ?>>Notice (5)<br>
<input type=checkbox name="priority_6" value="1" <?php if ($_SESSION['priority_6'] == 1) echo 'checked'; ?>>Info (6)<br>
<input type=checkbox name="priority_7" value="1" <?php if ($_SESSION['priority_7'] == 1) echo 'checked'; ?>>Debug (7)<br>
</td>
<td>
<?php /* This is not implemented yet!
<select name='color'>
<option value='red' style="background-color:red"<?php if ($_GET["color"] == "red") echo " selected";?>><?php echo $msg105;?></option>
<option value='blue' style="background-color:blue"<?php if ($_GET["color"] == "blue") echo " selected";?>><?php echo $msg106;?></option>
<option value='green' style="background-color:green"<?php if ($_GET["color"] == "green") echo " selected";?>><?php echo $msg107;?></option>
<option value='yellow' style="background-color:yellow"<?php if ($_GET["color"] == "yellow") echo " selected";?>><?php echo $msg108;?></option>
<option value='orange' style="background-color:orange"<?php if ($_GET["color"] == "orange") echo " selected";?>><?php echo $msg109;?></option>
</select>
End this is not implemented yet! */ ?>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<td colspan="2" Class="Header1">
<?php echo _MSGEnbQF; ?>:
</td>
<td Class="Header1">&nbsp;</td>
<tr>
<td><?php echo _MSGDisIU; ?>:</td>
<td>
<input type="checkbox" name="FilterInfoUnit" value="1" <?php if ($_SESSION['FilterInfoUnit'] == 1) echo 'checked'; ?>>
</td>
</tr>
<tr>
<td><?php echo _MSGOrdBy; ?>:</td>
<td>
<input type="checkbox" name="FilterOrderby" value="1" <?php if ($_SESSION['FilterOrderby'] == 1) echo 'checked'; ?>>
</td>
</tr>
<tr>
<td><?php echo _MSGRef; ?>:</td>
<td>
<input type="checkbox" name="FilterRefresh" value="1" <?php if ($_SESSION['FilterRefresh'] == 1) echo 'checked'; ?>>
</td>
</tr>
<tr>
<td><?php echo _MSGColExp; ?>:</td>
<td>
<input type="checkbox" name="FilterColExp" value="1" <?php if ($_SESSION['FilterColExp'] == 1) echo 'checked'; ?>>
</td>
</tr>
<tr>
<td><?php echo _MSGFilHost; ?>:</td>
<td>
<input type="checkbox" name="FilterHost" value="1" <?php if ($_SESSION['FilterHost'] == 1) echo 'checked'; ?>>
</td>
</tr>
<tr>
<td><?php echo _MSGSearchMsg; ?>:</td>
<td>
<input type="checkbox" name="FilterMsg" value="1" <?php if ($_SESSION['FilterMsg'] == 1) echo 'checked'; ?>>
</td>
</tr>
</table>
<input type="submit" name="form" value="Update Config">
</form>
</center>
<?php
WriteFood();
?>

View File

@ -0,0 +1,39 @@
<?php
echo '<input type="text" name="regexp" size="30" value="';
if( isset($_POST['regexp']) )
echo PreStrFromTxt4Out($_POST['regexp']);
echo '">', _MSGinCol, '<select name="color">';
echo '<option value="red" style="background-color:red"';
if (isset($_POST['color']) AND $_POST['color'] == 'red')
echo ' selected';
echo '>', _MSGRed, '</option>';
echo '<option value="blue" style="background-color:blue"';
if (isset($_POST['color']) AND $_POST['color'] == 'blue')
echo ' selected';
echo '>', _MSGBlue, '</option>';
echo '<option value="green" style="background-color:green"';
if (isset($_POST['color']) AND $_POST['color'] == 'green')
echo ' selected';
echo '>', _MSGGreen, '</option>';
echo '<option value="yellow" style="background-color:yellow"';
if (isset($_POST['color']) AND $_POST['color'] == 'yellow')
echo ' selected';
echo '>', _MSGYel, '</option>';
echo '<option value="orange" style="background-color:orange"';
if (isset($_POST['color']) AND $_POST['color'] == 'orange')
echo ' selected';
echo '>', _MSGOra, '</option>';
echo '</select>';
?>

View File

@ -0,0 +1,3 @@
SL<INPUT TYPE=CHECKBOX NAME="infounit_sl" value="1" <?php if ($_SESSION['infounit_sl'] == 1) echo "checked"; ?>>
ER<INPUT TYPE=CHECKBOX NAME="infounit_er" value="1" <?php if ($_SESSION['infounit_er'] == 1) echo "checked"; ?>>
O<INPUT TYPE=CHECKBOX NAME="infounit_o" value="1" <?php if ($_SESSION['infounit_o'] == 1) echo "checked"; ?>>

12
forms/events-date.php Normal file
View File

@ -0,0 +1,12 @@
<Select name="ti">
<option value="today" <?php if ($_SESSION['ti'] == 'today') echo 'selected'; ?>><?php echo _MSG2dy; ?></option>
<option value="yesterday" <?php if ($_SESSION['ti'] == 'yesterday') echo 'selected'; ?>><?php echo _MSGYester; ?></option>
<option value="thishour" <?php if ($_SESSION['ti'] == 'thishour') echo 'selected'; ?>><?php echo _MSGThsH; ?></option>
<option value="min60" <?php if ($_SESSION['ti'] == 'min60') echo 'selected'; ?>><?php echo _MSGLstH; ?></option>
<option value="min120" <?php if ($_SESSION['ti'] == "min120") echo 'selected'; ?>><?php echo _MSGL2stH; ?></option>
<option value="min300" <?php if ($_SESSION['ti'] == "min300") echo 'selected'; ?>><?php echo _MSGL5stH; ?></option>
<option value="min720" <?php if ($_SESSION['ti'] == "min720") echo 'selected'; ?>><?php echo _MSGL12stH; ?></option>
<option value="min1440" <?php if ($_SESSION['ti'] == "min1440") echo 'selected'; ?>><?php echo _MSGL2d; ?></option>
<option value="min2880" <?php if ($_SESSION['ti'] == "min2880") echo 'selected'; ?>><?php echo _MSGL3d; ?></option>
<option value="min8640" <?php if ($_SESSION['ti'] == "min8640") echo 'selected'; ?>><?php echo _MSGLw; ?></option>
</Select>

7
forms/filter-host.php Normal file
View File

@ -0,0 +1,7 @@
<?php
echo '<input type="text" name="filhost" size="30" value="';
if( isset($_POST['filhost']) )
echo $_POST['filhost'];
echo '">';
?>

31
forms/logs-per-page.php Normal file
View File

@ -0,0 +1,31 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
?>
<Select name="epp">
<option value="5" <?php if ($_SESSION["epp"] == 5) echo "selected"; ?>>5 per page</option>
<option value="10" <?php if ($_SESSION["epp"] == 10) echo "selected"; ?>>10 per page</option>
<option value="15" <?php if ($_SESSION["epp"] == 15) echo "selected"; ?>>15 per page</option>
<option value="20" <?php if ($_SESSION["epp"] == 20) echo "selected"; ?>>20 per page</option>
<option value="25" <?php if ($_SESSION["epp"] == 25) echo "selected"; ?>>25 per page</option>
<option value="50" <?php if ($_SESSION["epp"] == 50) echo "selected"; ?>>50 per page</option>
<option value="100" <?php if ($_SESSION["epp"] == 100) echo "selected"; ?>>100 per page</option>
</Select>

115
forms/manually-date.php Normal file
View File

@ -0,0 +1,115 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
?>
All Events between:
<Select name="y1">
<?php
FOR ($i=2000;$i<=2012;$i++)
{
echo '<option value="'.$i.'"';
if ($_SESSION['y1']==$i)
echo " selected";
echo '>'.$i.'</option>';
}
?>
</select>&nbsp;
<Select name="m1">
<?php
FOR ($i=1;$i<=12;$i++)
{
echo '<option value="'.$i.'"';
if ($_SESSION['m1']==$i)
echo " selected";
echo '>'.$i.'</option>';
}
?>
</select>&nbsp;
<Select name="d1">
<?php
FOR ($i=1;$i<=31;$i++)
{
echo '<option value="'.$i.'"';
if ($_SESSION['d1']==$i)
echo " selected";
echo '>'.$i.'</option>';
}
?>
</select>&nbsp;and &nbsp;
<Select name="y2">
<?php
FOR ($i=2000;$i<=2012;$i++)
{
echo '<option value="'.$i.'"';
if ($_SESSION['y2']==$i)
echo " selected";
echo '>'.$i.'</option>';
}
?>
</select>&nbsp;
<Select name="m2">
<?php
FOR ($i=1;$i<=12;$i++)
{
echo '<option value="'.$i.'"';
if ($_SESSION['m2']==$i)
echo " selected";
echo '>'.$i.'</option>';
}
?>
<% FOR P = 1 TO 12 %>
</select>&nbsp;
<Select name="d2">
<?php
FOR ($i=1;$i<=31;$i++)
{
echo '<option value="'.$i.'"';
if ($_SESSION['d2']==$i)
echo " selected";
echo '>'.$i.'</option>';
}
?>
</select>

8
forms/order-by.php Normal file
View File

@ -0,0 +1,8 @@
<Select name="order">
<option value="Date" <?php if ($_SESSION['order'] == "Date") echo 'selected'; ?>><?php echo _MSGDate; ?></Option>
<option value="Facility" <?php if ($_SESSION['order'] == "Facility") echo 'selected'; ?>><?php echo _MSGFac; ?></option>
<option value="Priority" <?php if ($_SESSION['order'] == "Priority") echo 'selected'; ?>><?php echo _MSGPri; ?></option>
<option value="FacilityDate" <?php if ($_SESSION['order'] == "FacilityDate") echo 'selected'; ?>><?php echo _MSGFacDat; ?></Option>
<option value="PriorityDate" <?php if ($_SESSION['order'] == "PriorityDate") echo 'selected'; ?>><?php echo _MSGPriDat; ?></Option>
<option value="Host" <?php if ($_SESSION['order'] == "Host") echo 'selected'; ?>><?php echo _MSGHost; ?></Option>
</Select>

10
forms/refresh.php Normal file
View File

@ -0,0 +1,10 @@
<Select name="refresh">
<option value="0" <?php if($_SESSION['refresh'] == "0") echo 'selected'; ?>><?php echo _MSGNoRef; ?></Option>
<option value="5" <?php if($_SESSION['refresh'] == "5") echo 'selected'; ?>><?php echo _MSGE5Sec; ?></Option>
<option value="10" <?php if ($_SESSION['refresh'] == "10") echo 'selected'; ?>><?php echo _MSGE10s; ?></Option>
<option value="20" <?php if($_SESSION['refresh'] == "20") echo 'selected'; ?>><?php echo _MSGE20Sec; ?></Option>
<option value="30" <?php if ($_SESSION['refresh'] == "30") echo 'selected'; ?>><?php echo _MSGE30s; ?></option>
<option value="60" <?php if ($_SESSION['refresh'] == "60") echo 'selected'; ?>><?php echo _MSGEm; ?></option>
<option value="120" <?php if ($_SESSION['refresh'] == "120") echo 'selected'; ?>><?php echo _MSGE2m; ?></Option>
<option value="900" <?php if ($_SESSION['refresh'] == "900") echo 'selected'; ?>><?php echo _MSGE15m; ?></Option>
</Select>

8
forms/search-msg.php Normal file
View File

@ -0,0 +1,8 @@
<?php
// search the message fild for a string
echo '<input type="text" name="searchmsg" size="30" value="';
if( isset($_POST['searchmsg']) )
echo $_POST['searchmsg'];
echo '">';
?>

BIN
images/Head-Line.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

BIN
images/phplogcon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

740
include.php Normal file
View File

@ -0,0 +1,740 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*
* This file validate all variable comming from the web,
* also it includes all necessary files (e.g. config, db-drv, ...)
* and provide some usefull functions
*/
// disable error reporting
error_reporting(E_ALL);
header("Pragma: no-cache");
// very important to include config settings at beginning!
include 'config.php';
session_cache_expire($session_time);
session_start();
//*** Begin Validate var input and/or default values ***
//The following is required for IIS! Otherwise it will cause an error "undefined index"
$_SERVER['QUERY_STRING'] = '';
if( !isset($_SESSION['save_cookies']) )
session_register('save_cookies');
// select the language
// use the language code, only two letters are permitted
if (!isset($_SESSION['language']))
{
$_SESSION['language'] = _DEFLANG;
}
/*
* get the stylesheet to use
* only letters are permitted
*/
if (!isset($_SESSION['stylesheet']))
{
$_SESSION['stylesheet'] = 'phplogcon'; // default
}
if (!isset($_SESSION['debug']))
{
$_SESSION['debug'] = 0; // default
}
if (!isset($_SESSION['savefiltersettings']))
{
$_SESSION['savefiltersettings'] = 0; // default
}
/*
* Load the default quick filter settings,
* if the quick filter settings not configured yet.
*/
if (!isset($_SESSION['FilterInfoUnit']))
$_SESSION['FilterInfoUnit'] = _FilterInfoUnit;
if (!isset($_SESSION['FilterOrderby']))
$_SESSION['FilterOrderby'] = _FilterOrderby;
if (!isset($_SESSION['FilterRefresh']))
$_SESSION['FilterRefresh'] = _FilterRefresh;
if (!isset($_SESSION['FilterColExp']))
$_SESSION['FilterColExp'] = _FilterColExp;
if (!isset($_SESSION['FilterHost']))
$_SESSION['FilterHost'] = _FilterHost;
if (!isset($_SESSION['FilterMsg']))
$_SESSION['FilterMsg'] = _FilterMsg;
/*
* Function prepare strings from textboxes for using it for db queries.
*/
function PreStrFromTxt4DB($var)
{
if (get_magic_quotes_gpc())
$var = stripslashes($var);
return str_replace("'", "''", trim($var));
}
/*
* Function prepare strings from textboxes for output
*/
function PreStrFromTxt4Out($var)
{
if (get_magic_quotes_gpc())
$var = stripslashes($var);
return htmlspecialchars(trim($var));
}
/*
* Filtering by ip/host
* if a string for filter host submitted, check this string.
*/
if (isset($_POST['filhost']))
{
$_SESSION['filhost'] = PreStrFromTxt4DB($_POST['filhost']);
$_POST['filhost'] = PreStrFromTxt4Out($_POST['filhost']);
}
else
$_SESSION['filhost'] = '';
/*
* Filtering the message, msg must contain a certain string.
* if a string submitted, check this string.
*/
if (isset($_POST['searchmsg']))
{
$_SESSION['searchmsg'] = PreStrFromTxt4DB($_POST['searchmsg']);
$_POST['searchmsg'] = PreStrFromTxt4Out($_POST['searchmsg']);
}
else
$_SESSION['searchmsg'] = '';
/*
* For CLASS EventFilter (classes/eventfilter.php)
* get/set the "manually events date"
* only numbers are permitted
*/
function SetManuallyDateDefault()
{
$_SESSION['d1'] = 1;
$_SESSION['m1'] = 1;
$_SESSION['y1'] = 2004;
$_SESSION['d2'] = date("d");
$_SESSION['m2'] = date("m");
$_SESSION['y2'] = date("Y");
}
if (isset($_POST['d1']))
{
$tmp = true;
if (!is_numeric($_POST['d1'])) { $tmp = false; }
if (!is_numeric($_POST['m1'])) { $tmp = false; }
if (!is_numeric($_POST['y1'])) { $tmp = false; }
if (!is_numeric($_POST['d2'])) { $tmp = false; }
if (!is_numeric($_POST['m2'])) { $tmp = false; }
if (!is_numeric($_POST['y2'])) { $tmp = false; }
if ($tmp)
{
//is ok, but add a int to ensure that it is now handled as an integer
$_SESSION['d1'] = $_POST['d1']+0;
$_SESSION['m1'] = $_POST['m1']+0;
$_SESSION['y1'] = $_POST['y1']+0;
$_SESSION['d2'] = $_POST['d2']+0;
$_SESSION['m2'] = $_POST['m2']+0;
$_SESSION['y2'] = $_POST['y2']+0;
}
else
SetManuallyDateDefault();
}
elseif (!isset($_SESSION['d1']))
SetManuallyDateDefault();
// quick-filter.php
// manually or predefined
if (isset($_POST['change']))
{
if ($_POST['change'] == 'Predefined')
$_SESSION['change'] = 'Predefined';
else
$_SESSION['change'] = 'Manually';
}
elseif (!isset($_SESSION['change']))
$_SESSION['change'] = 'Predefined';
// Apply changed quick filter settings
if( isset($_POST['quickFilter']) && $_POST['quickFilter'] == 'change' )
{
// save current settings. Because:
// the quick filter and the filter config are using the same variables.
// when you change the quick filter settings, the filter settings
// would be changed to.
// settings must be reloaded in filter-config.php
$_SESSION['ti_old'] = $_SESSION['ti'];
$_SESSION['infounit_sl_old'] = $_SESSION['infounit_sl'];
$_SESSION['infounit_er_old'] = $_SESSION['infounit_er'];
$_SESSION['infounit_o_old'] = $_SESSION['infounit_o'];
$_SESSION['order_old'] = $_SESSION['order'];
$_SESSION['refresh_old'] = $_SESSION['refresh'];
$_SESSION['ti'] = $_POST['ti'];
$_SESSION['infounit_sl'] = (isset($_POST['infounit_sl'])) ? 1 : 0;
$_SESSION['infounit_er'] = (isset($_POST['infounit_er'])) ? 1 : 0;
$_SESSION['infounit_o'] = (isset($_POST['infounit_o'])) ? 1 : 0;
$_SESSION['order'] = $_POST['order'];
$_SESSION['refresh'] = $_POST['refresh'];
}
//events-display.php
// InitVariable(2, "search", "");
// InitVariable(1, "regexp", "");
// implement this
//InitVariable(1, "color", "red");
if (!isset($_SESSION['infounit_sl']))
$_SESSION['infounit_sl'] = 1;
if (!isset($_SESSION['infounit_er']))
$_SESSION['infounit_er'] = 1;
if (!isset($_SESSION['infounit_o']))
$_SESSION['infounit_o'] = 1;
if (!isset($_SESSION['priority_0']))
$_SESSION['priority_0'] = 1;
if (!isset($_SESSION['priority_1']))
$_SESSION['priority_1'] = 1;
if (!isset($_SESSION['priority_2']))
$_SESSION['priority_2'] = 1;
if (!isset($_SESSION['priority_3']))
$_SESSION['priority_3'] = 1;
if (!isset($_SESSION['priority_4']))
$_SESSION['priority_4'] = 1;
if (!isset($_SESSION['priority_5']))
$_SESSION['priority_5'] = 1;
if (!isset($_SESSION['priority_6']))
$_SESSION['priority_6'] = 1;
if (!isset($_SESSION['priority_7']))
$_SESSION['priority_7'] = 1;
// forms/events-date.php
// selected time interval, validation check of ti in eventfilter.php
if (!isset($_SESSION['ti']))
$_SESSION['ti'] = 'today'; // default
// forms/order-by.php
// validation in eventfilter.php
if (!isset($_SESSION['order']))
$_SESSION['order'] = 'date';
// forms/refresh.php
if (!isset($_SESSION['refresh']))
$_SESSION['refresh'] = 0; // default
/*
* forms/logs-per-page.php
* number of lines to be displayed, only numbers are allowed
*/
if (isset($_POST['epp']))
{
if (is_numeric($_POST['epp']))
$_SESSION['epp'] = $_POST['epp']+0; //+0 makes sure that is an int
else
$_SESSION['epp'] = 20;
}
elseif (!isset($_SESSION['epp']))
$_SESSION['epp'] = 20;
//*** End Validate var input and/or default values ***
//***Begin including extern files***
// include the language file
include _LANG . $_SESSION['language'] . '.php';
//design things
include 'layout/theme.php';
//include required database driver
if(strtolower(_CON_MODE) == "native")
include _DB_DRV . _DB_APP . ".php";
else
include _DB_DRV . _CON_MODE . "_" . _DB_APP . ".php";
//***End including extern files***
//***Global used variables
// Used to hold the global connection handle
$global_Con = db_connection();
//***Begin usefull functions***
/************************************************************************/
/* expect a path to a folder ('.' for current) and return all */
/* filenames order by name
/************************************************************************/
function GetFilenames($dir)
{
$handle = @opendir($dir);
while ($file = @readdir ($handle))
{
if (eregi("^\.{1,2}$",$file))
{
continue;
}
if(!is_dir($dir.$file))
{
$info[] = $file;
}
}
@closedir($handle);
sort($info);
return $info;
}
/*!
* Remove the parameter $Arg from the given $URL
* \r Returns the url without the $Arg parameter
*/
function RemoveArgFromURL($URL,$Arg)
{
while($Pos = strpos($URL,"$Arg="))
{
if ($Pos)
{
if ($URL[$Pos-1] == "&")
{
$Pos--;
}
$nMax = strlen($URL);
$nEndPos = strpos($URL,"&",$Pos+1);
if ($nEndPos === false)
{
$URL = substr($URL,0,$Pos);
}
else
{
$URL = str_replace(substr($URL,$Pos,$nEndPos-$Pos), '', $URL);
}
}
}
return $URL;
}
//***End usefull functions***
// encodes a string one way
function encrypt($txt)
{
return crypt($txt,"vI").crc32($txt);
}
// returns current date and time
function now()
{
$dat = getdate(strtotime("now"));
return "$dat[year]-$dat[mon]-$dat[mday] $dat[hours]:$dat[minutes]:00";
}
// it makes the authentification
function auth()
{
global $session_time;
// if no session is available, but a cookie => the session will be set and the settings loaded
// if no session and no cookie is available => link to index.php to login will be displayed
if( !isset($_SESSION['usr']) )
{
if( !isset($_COOKIE['valid']) || $_COOKIE['valid'] == "0" )
{
WriteHead("phpLogCon :: " . _MSGAccDen, "", "", _MSGAccDen, 0);
echo "<br><b>..:: " . _MSGAccDen . " ::..</b>";
echo "<br><br>..:: <a href='index.php'>" . _MSGBac2Ind . "</a> ::..";
exit;
}
else
{
session_register('usr');
$_SESSION['usr'] = $_COOKIE['usr'];
LoadUserConfig();
}
}
/*
//*** FOR SESSION EXPIRE ***
//if(diff("now", $result["phplogcon_dtime"]) > $session_time)
if( !isset($_COOKIE["valid"]) )
{
WriteHead("phpLogCon :: " . $msg030, "", "", $msg030, 0);
echo "<br><b>..:: " . _MSGSesExp . " ::..</b><br>";
echo "<br>..:: <a href='index.php'>" . _MSGReLog . "</a> ::..";
exit;
}
*/
//refresh cookies
if($_SESSION['save_cookies'])
{
setcookie("valid", $_COOKIE["valid"], _COOKIE_EXPIRE, "/");
setcookie("usr", $_COOKIE["usr"], _COOKIE_EXPIRE, "/");
}
}
/*
// generates a unique string
function gen()
{
mt_srand((double)microtime() * 1000000);
return mt_rand(1000, 9999) . "-" . mt_rand(1000, 9999) . "-" . mt_rand(1000, 9999) . "-" . mt_rand(1000, 9999);
}
*/
// Calculates the different between the given times
function diff($date1, $date2)
{
$a1 = getdate(strtotime($date1));
$a2 = getdate(strtotime($date2));
return ($a1["year"]-$a2["year"])*525600 + ($a1["mon"]-$a2["mon"])*43200 + ($a1["mday"]-$a2["mday"])*1440 + ($a1["hours"]-$a2["hours"])*60 + ($a1["minutes"]-$a2["minutes"]);
}
/*!
* This function create a combobox with all filenames (without extension
* if it '.php') from the given folder. Firt param is the path to the
* folder, second is the name of of the combobox.
*/
function ComboBoxWithFilenames($dir, $combobox)
{
$handle = @opendir($dir);
while ($file = @readdir($handle))
{
if (eregi("^\.{1,2}$",$file))
continue;
if(!is_dir($dir.$file))
$info[] = ereg_replace(".php","",$file);
}
@closedir($handle);
sort($info);
echo "<select name=".$combobox.">";
foreach($info as $name)
{
if($_COOKIE["connection_mode"] == $name)
echo "<option value='" . $name . "' selected>".$name."</option>";
else
echo "<option value='" . $name . "'>".$name."</option>";
}
echo "</select>";
}
function CheckSQL($SQLcmd)
{
if( stristr($SQLcmd, "'") || stristr($SQLcmd, "&quot;"))
return FALSE;
else
return TRUE;
}
function WriteStandardHeader($myMsg)
{
if(_ENABLEUI == 1)
{
// *** AUTH ID | WHEN TRUE, LOGOUT USER ***
auth();
if(isset($_GET["do"]))
{
if ($_GET["do"] == "logout")
{
setcookie("usr", "|", _COOKIE_EXPIRE, "/");
setcookie("valid", "0", _COOKIE_EXPIRE, "/");
session_unset();
header("Location: index.php");
}
}
// ****************************************
/*
if( !isset($_COOKIE["valid"]) || $_COOKIE["valid"] == "0" )
WriteHead("phpLogCon :: " . $myMsg , "", "", $myMsg, 0);
else
WriteHead("phpLogCon :: " . $myMsg, "", "", $myMsg, $_COOKIE["valid"]);
*/
WriteHead("phpLogCon :: " . $myMsg , "", "", $myMsg);
echo "<br>";
// If a user is logged in, display logout text
if( isset($_COOKIE["usr"]) || $_COOKIE["usr"] != "|")
{
echo '<table align="right">';
echo '<tr>';
echo '<td><a href="index.php?do=logout">' . _MSGLogout . '</a></td>';
echo '</tr>';
echo '</table>';
}
}
else
{
/*
if(isset($_COOKIE["valid"]))
WriteHead("phpLogCon :: " . $myMsg, "", "", $myMsg, $_COOKIE["sesid"]);
else
WriteHead("phpLogCon :: " . $myMsg, "", "", $myMsg, 0);
*/
WriteHead("phpLogCon :: " . $myMsg , "", "", $myMsg);
}
}
/*!
* Format the priority for displaying purposes.
* Get the number of the priority and change it to a word,
* also the default css style for design format is required.
* If coloring priority enabled, this function change the given
* param to the right color of the priority.
*
* /param pri - priority (number!)
* /param col - css style class (as a reference!)
* /ret priword - returns priority as a word
*/
function FormatPriority($pri, &$col)
{
$priword ='';
$tmpcol = '';
switch($pri){
case 0:
$priword = _MSGPRI0;
$tmpcol = 'PriorityEmergency';
break;
case 1:
$priword = _MSGPRI1;
$tmpcol = 'PriorityAlert';
break;
case 2:
$priword = _MSGPRI2;
$tmpcol = 'PriorityCrit';
break;
case 3:
$priword = _MSGPRI3;
$tmpcol = 'PriorityError';
break;
case 4:
$priword = _MSGPRI4;
$tmpcol = 'PriorityWarning';
break;
case 5:
$priword = _MSGPRI5;
$tmpcol = 'PriorityNotice';
break;
case 6:
$priword = _MSGPRI6;
$tmpcol = 'PriorityInfo';
break;
case 7:
$priword = _MSGPRI7;
$tmpcol = 'PriorityDebug';
break;
default:
die('priority is false');
}
// if coloring enabled
if (_COLPriority) {
$col = $tmpcol;
}
return $priword;
}
/*!
Gets Args from the active URL and returns them.
!*/
function GetSortedArgs()
{
$arCount = count($_SERVER["argv"]);
$sArgs = "?";
if($arCount == 0)
$sArgs = "";
else
{
for($i = 0; $i < $arCount; $i++)
{
if($i > 0)
$sArgs .= "&" . $_SERVER["argv"][$i];
else
$sArgs .= $_SERVER["argv"][$i];
}
}
return $sArgs;
}
/*!
Loads the Users Filter Configuration from database
!*/
function LoadFilterConfig()
{
global $global_Con;
$query = "SELECT Name, PropValue FROM UserPrefs WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_%'";
$result = db_exec($global_Con, $query);
while($value = db_fetch_array($result))
{
$sValName = explode("PHPLOGCON_", $value['Name']);
$_SESSION["$sValName[1]"] = $value['PropValue'];
}
}
function LoadUserConfig()
{
global $global_Con;
$query = "SELECT Name, PropValue FROM userprefs WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_u%'";
$result = db_exec($global_Con, $query);
while($value = db_fetch_array($result))
{
$sValName = explode("PHPLOGCON_u", $value['Name']);
$_SESSION[strtolower($sValName[1])] = $value['PropValue'];
}
}
/*!
Creates the array for saving the Filter Settings to database
!*/
function GetFilterConfigArray()
{
if( !isset($_POST['infounit_sl']) )
$query[0] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_sl'";
else
$query[0] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_sl'";
if( !isset($_POST['infounit_er']) )
$query[1] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_er'";
else
$query[1] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_er'";
if( !isset($_POST['infounit_o']) )
$query[2] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_o'";
else
$query[2] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_o'";
if( !isset($_POST['priority_0']) )
$query[3] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_0'";
else
$query[3] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_0'";
if( !isset($_POST['priority_1']) )
$query[4] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_1'";
else
$query[4] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_1'";
if( !isset($_POST['priority_2']) )
$query[5] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_2'";
else
$query[5] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_2'";
if( !isset($_POST['priority_3']) )
$query[6] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_3'";
else
$query[6] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_3'";
if( !isset($_POST['priority_4']) )
$query[7] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_4'";
else
$query[7] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_4'";
if( !isset($_POST['priority_5']) )
$query[8] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_5'";
else
$query[8] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_5'";
if( !isset($_POST['priority_6']) )
$query[9] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_6'";
else
$query[9] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_6'";
if( !isset($_POST['priority_7']) )
$query[10] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_7'";
else
$query[10] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_7'";
$query[11] = "UPDATE UserPrefs SET PropValue='" . $_POST['ti'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_ti'";
$query[12] = "UPDATE UserPrefs SET PropValue='" . $_POST['order'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_order'";
$query[13] = "UPDATE UserPrefs SET PropValue='" . $_POST['refresh'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_refresh'";
if( !isset($_POST['FilterInfoUnit']) )
$query[14] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterInfoUnit'";
else
$query[14] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterInfoUnit'";
if( !isset($_POST['FilterOrderby']) )
$query[15] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterOrderby'";
else
$query[15] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterOrderby'";
if( !isset($_POST['FilterRefresh']) )
$query[16] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterRefresh'";
else
$query[16] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterRefresh'";
if( !isset($_POST['FilterColExp']) )
$query[17] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterColExp'";
else
$query[17] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterColExp'";
if( !isset($_POST['FilterHost']) )
$query[18] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterHost'";
else
$query[18] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterHost'";
if( !isset($_POST['FilterMsg']) )
$query[19] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterMsg'";
else
$query[19] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterMsg'";
return $query;
}
function GetUserConfigArray()
{
$query[0] = "UPDATE UserPrefs SET PropValue='" . $_POST['stylesheet'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uStylesheet'";
$query[1] = "UPDATE UserPrefs SET PropValue='" . $_POST['language'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uLanguage'";
if( !isset($_POST['savefiltersettings']) )
$query[2] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uSaveFilterSettings'";
else
$query[2] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uSaveFilterSettings'";
if( !isset($_POST['debug']) )
$query[2] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uDebug'";
else
$query[2] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uDebug'";
return $query;
}
?>

208
index.php Normal file
View File

@ -0,0 +1,208 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
include 'include.php';
include _CLASSES . 'eventsnavigation.php';
if(_ENABLEUI == 1)
{
// *** WHEN TRUE, LOGOUT USER ***
if (isset($_GET['do']))
{
if ($_GET['do'] == 'logout')
{
setcookie("usr", "|", _COOKIE_EXPIRE, "/");
setcookie("valid", "0", _COOKIE_EXPIRE, "/");
session_unset();
header("Location: index.php");
exit;
}
}
// ****************************************
}
// if no session is available, but a cookie => the session will be set and the settings loaded
// if no session and no cookie is available => the login screen will be displayed
if( _ENABLEUI && !isset($_SESSION['usr']) )
{
if(!isset($_COOKIE['valid']) || $_COOKIE['valid'] == "0")
{
WriteHead("phpLogCon :: Index", "", "", "phpLogCon");
echo "<br>";
echo '<font><b>', _MSG001, '.</b></font>';
echo '<form action="submit.php" method="POST">';
echo _MSGUsrnam, ': <input type="text" name="usr" size="15"><br>';
echo _MSGpas, ': <input type="password" name="pass" size="15"><br>';
echo _MSGSavCook, '<input type=checkbox name="save_cookies" value="1"><br>';
echo '<input type="submit" value="Login">';
echo '</form>';
exit;
}
else
{
// reload
session_register('usr');
$_SESSION['usr'] = $_COOKIE['usr'];
LoadUserConfig();
header("Location: index.php");
exit;
}
if($_SESSION['save_cookies'])
{
setcookie("valid", $_COOKIE["valid"], _COOKIE_EXPIRE, "/");
setcookie("usr", $_COOKIE["usr"], _COOKIE_EXPIRE, "/");
}
}
WriteHead("phpLogCon :: Index", "", "", "phpLogCon");
echo "<br>";
include _CLASSES . 'eventfilter.php';
//the splitted sql statement
$cmdSQLfirst_part = "SELECT ";
//$cmdSQLmain_part = "* FROM "._DBTABLENAME;
$cmdSQLmain_part = 'ID, '._DATE.', Facility, Priority, FromHost, Message, InfoUnitID FROM '._DBTABLENAME;
$cmdSQLlast_part = " WHERE ";
//define the last part of the sql statment, e.g. the where part, ordery by, etc.
$myFilter = New EventFilter;
$cmdSQLlast_part .= $myFilter->GetSQLWherePart(1);
$cmdSQLlast_part .= $myFilter->GetSQLSort();
$myEventsNavigation = new EventsNavigation(5);
$myEventsNavigation->SetPageNumber(1);
$myEventsNavigation->SetEventCount($global_Con, $cmdSQLlast_part);
$num = $myEventsNavigation->GetEventCount();
if(_ENABLEUI)
{
echo '<table align="right">';
echo '<tr>';
echo '<td><a href="index.php?do=logout">' . _MSGLogout . '</a></td>';
echo '</tr>';
echo '</table>';
echo '..:: ', _MSGLogSuc , ' ::..<br><br>';
}
if(_ENABLEUI)
echo _MSGWel . ", <font color=\"blue\">" . $_SESSION["usr"] . "</font>" . _MSGChoOpt;
else
echo _MSGWel . _MSGChoOpt;
$SQLcmdfirst_part = "SELECT DISTINCT ";
$SQLcmdmain_part = "(*) FROM "._DBTABLENAME;
$SQLcmdlast_part = " WHERE ";
$myFilter = New EventFilter;
$SQLcmdlast_part .= $myFilter->GetSQLWherePart(1);
$result_sl = db_exec($global_Con, "SELECT DISTINCT COUNT(*) as num" . " FROM "._DBTABLENAME . $SQLcmdlast_part . " AND InfoUnitID=1");
$row_sl = db_fetch_array($result_sl);
db_free_result($result_sl);
$result_er = db_exec($global_Con, "SELECT DISTINCT COUNT(*) as num" . " FROM "._DBTABLENAME . $SQLcmdlast_part . " AND InfoUnitID=3");
$row_er = db_fetch_array($result_er);
db_free_result($result_er);
echo "<br><br><b>" . _MSGQuiInf . "</b>:";
echo "<table border='0' cellspacing='0' class=\"EventTable\"><br>";
echo "<tr><td CLASS=TDHEADER>" . _MSGNumSLE . "</td><td CLASS=TD1>" . $row_sl[0] . "</td></tr>";
echo "<tr><td CLASS=TDHEADER>" . _MSGNumERE . "</td><td CLASS=TD2>" . $row_er[0] . "</td></tr>";
echo "</table>";
echo "<br><b>" . _MSGTop5 . ":</b><br><br>";
if($num == 0)
{
//output if no data exists for the search string
echo "<br><b>" . _MSGNoData . "!</b>";
}
else
{
echo '<table class="EventTable">';
echo "<tr CLASS=TDHEADER>";
echo "<td>" . _MSGDate . "</td>";
echo "<td>" . _MSGFac . "</td>";
echo "<td>" . _MSGPri . "</td>";
echo "<td>" . _MSGInfUI . "</td>";
echo "<td>" . _MSGHost . "</td>";
echo "<td>" . _MSGMsg . "</td>";
echo "</tr>";
$res = db_exec_limit($global_Con, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLlast_part, 1, 5);
while($row = db_fetch_array($res))
{
if (db_errno() != 0)
{
echo db_errno() . ": " . db_error(). "\n";
}
//choose InfoUnitdType 1 = SL = Syslog, 3 = Eventreport, O = Other
switch ($row[6])
{
case 1:
$infounit = "SL";
break;
case 3:
$infounit = "ER";
break;
default:
$infounit = "O";
}
static $tc = 1;
echo '<tr>';
echo '<td CLASS=TD', $tc, '><nobr>',$row[1],'</nobr></td>'; //date
echo '<td CLASS=TD', $tc, '>',$row[2],'</td>'; //facility
// get the description of priority (and get the the right color, if enabled)
$pricol = 'TD' . $tc;
$priword = FormatPriority($row[3], $pricol);
echo '<td CLASS=', $pricol, '>', $priword, '</td>';
echo "<td CLASS=TD" . $tc . ">".$infounit."</td>"; //InfoUnit
echo "<td CLASS=TD" . $tc . ">".$row[4]."</td>"; //host
$message = $row[5];
$message = str_replace("<", "&lt;", $message);
$message = str_replace(">", "&gt;", $message);
echo '<td CLASS=TD', $tc, '><a CLASS="Msg" href="details.php?lid=', $row[0], '">', $message, '</a></td>'; //message
//for changing colors
if($tc == 1) $tc = 2;
else $tc = 1;
/*
echo "<tr bgcolor=\"#ffffcc\"><td>".$row['ReceivedAt']."</td>";
echo "<td>".$row['Facility']."</td>";
echo "<td>".$row['Priority']."</td>";
echo "<td>".$row['FromHost']."</td>";
echo "<td>".$row['Message']."</td>";
*/
echo "</tr>";
}
echo "</table>";
}
WriteFood();
?>

91
install/include.php Normal file
View File

@ -0,0 +1,91 @@
<?php
function WriteHead($title)
{
?>
<!-- Head creation -->
<html>
<head>
<title><?php echo $title; ?></title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META NAME="copyright" CONTENT="Copyright (C) 2003 Adiscon GmbH, Erftstadt - www.adiscon.com">
<META name="Keywords" content="sql server win NT windows 7 2000 replication merge nt transactional date time resolver">
<META http-equiv="pragma" CONTENT="no-cache">
<META name="Description" content="">
<link rel="stylesheet" href="../layout/phplogcon.css" type="text/css">
</head>
<body>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" CLASS="EventTable">
<tr>
<td width="220" align="left"><img src="../images/phplogcon.gif" border="0"></td>
<td align="left">
<h1>phpLogCon monitoring</h1>
</td>
</tr>
</table>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" CLASS="EventTable">
<tr>
<td align="center"><font size="3"><b>.: phpLogCon Installation :.</b></font></td>
</tr>
</table>
<br><br>
<?php
}
function WriteFoot()
{
?>
<!-- Foot creation -->
<center>
<table>
<tr>
<td>
<br /><br />
<small><i><a href="http://www.phplogcon.com/" target="phplogcon">phpLogCon</a>, Copyright &copy; 2003 - 2004 <a href="http://www.adiscon.com" target="Adiscon">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>
<?php
}
function GetSQLQueries($strFilePath)
{
// Get SQL queries from file
$arQueryFile = file("scripts/" . $strFilePath);
for($i = 0, $j = 0; $i < count($arQueryFile); $i++)
{
if( !strstr($arQueryFile[$i], "#") && $arQueryFile != "")
{
if( isset($arQueries[$j]) )
$arQueries[$j] .= $arQueryFile[$i];
else
$arQueries[$j] = $arQueryFile[$i];
if( strstr($arQueryFile[$i], ";") )
$j++;
}
}
return $arQueries;
}
function GetUTCtime($iTime)
{
if ( $iTime == 0 ) $iTime = time();
$ar = localtime ( $iTime );
$ar[5] += 1900; $ar[4]++;
$iTztime = gmmktime ( $ar[2], $ar[1], $ar[0],
$ar[4], $ar[3], $ar[5], $ar[8] );
return ( $iTime - ($iTztime - $iTime) );
}

169
install/install.php Normal file
View File

@ -0,0 +1,169 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
include "include.php";
WriteHead("phpLogCon :: Installation");
?>
<!-- Body creation -->
<center><b>Welcome to the installation of phpLogCon, the WebInterface to log data.<br>The following steps will guide you through the installation and help you to install and configure phpLogCon correctly.<br><i><font color="red">Note: Fields marked with a * MUST be filled out! 'Host/IP' can be leaved blank in ODBC mode.</font></i></b></center>
<br><br>
<center>First we have to check your database structure, because phpLogCon needs some tables. If the tables don't exist, they will be created.<br>For this, phpLogCon Installation needs some information about your database Server:</center>
<br>
<form method="POST" action="perform.php" name="Installation">
<input type="hidden" name="install" value="Installation">
<table border="" cellpadding="2" cellspacing="0" width="600" align="center" Class="ConfigTable">
<tr>
<td colspan="2" align="center" Class="Header1">.: Database Settings :.</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td>Connection Type: <font color="red">*</font></td>
<td>
<select name="dbcon">
<option value="native" selected>Native</Option>
<option value="odbc">ODBC</Option>
</select>
</td>
</tr>
<tr>
<td>Database application: <font color="red">*</font></td>
<td>
<select name="dbapp">
<option value="mysql" selected>MySql</Option>
<option value="mssql">MSSql</Option>
</select>
</td>
</tr>
<tr>
<td>Host/IP: <font color="red">*</font></td>
<td><input type="text" name="dbhost" size="25"></td>
</tr>
<tr>
<td>Port (If standard, leave blank):</td>
<td><input type="text" name="dbport" size="25"></td>
</tr>
<tr>
<td>User (User must have "INSERT" and "CREATE" rights!): <font color="red">*</font></td>
<td><input type="text" name="dbuser" size="25"></td>
</tr>
<tr>
<td>Password: <font color="red">*</font></td>
<td><input type="password" name="dbpass" size="25"></td>
</tr>
<tr>
<td>Re-type password: <font color="red">*</font></td>
<td><input type="password" name="dbpassre" size="25"></td>
</tr>
<tr>
<td>Database/DSN name: <font color="red">*</font></td>
<td><input type="text" name="dbname" size="25"></td>
</tr>
<tr>
<td>Database time format: <font color="red">*</font></td>
<td>
<select name="dbtime">
<option value="utc" selected>UTC</Option>
<option value="local">Localtime</Option>
</select>
</td>
</tr>
</table>
<br><br>
<center>Now we have to do some settings for phpLogCon to run clearly and user optimized.<br><i>Note: If you now select the UserInterface not to be installed, you can install it through a SQL-script file! See the manual for help.</center>
<br>
<table border="" cellpadding="2" cellspacing="0" width="600" align="center" Class="ConfigTable">
<tr>
<td colspan="2" align="center" Class="Header1">.: phpLogCon General Settings :.</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td>Default language:</td>
<td>
<select name="lang">
<option value="en" selected>English</Option>
<option value="de">German</Option>
</select>
</td>
</tr>
<tr>
<td>User Interface:</td>
<td>
<input type="checkbox" name="ui" value="1"> Configure?
</td>
</tr>
<tr>
<td colspan="2" align="left" Class="Header1">Create a User:</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td colspan="2">Here you can create a user for the User Interface. If you already have some users in your database or you have unselected the UserInterface, you can leave these fields!<br><i>Note: You only have to fill out the fields marked with a <font color="red">*</font> if you have entered a username!</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="uiuser" size="25"></td>
</tr>
<tr>
<td>Display name: <font color="red">*</font></td>
<td><input type="text" name="uidisname" size="25"></td>
</tr>
<tr>
<td>Password: <font color="red">*</font></td>
<td><input type="password" name="uipass" size="25"></td>
</tr>
<tr>
<td>Re-type password: <font color="red">*</font></td>
<td><input type="password" name="uipassre" size="25"></td>
</tr>
<tr>
<td>Desired language:</td>
<td>
<select name="uilang">
<option value="en" selected>English</Option>
<option value="de">German</Option>
</select>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="right"><input type="submit" value="Install phpLogCon"></td>
</tr>
</table>
</form>
<?php
WriteFoot();
?>

277
install/perform.php Normal file
View File

@ -0,0 +1,277 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
include "include.php";
include "../lang/" . $_POST['lang'] . ".php";
WriteHead("phpLogCon :: Installation Progress");
?>
<center>Checking users input...
<?php
// if there are fields missing, create an error message
$strErrorMsg = "";
if($_POST["dbhost"] == "" && $_POST['dbcon'] != "odbc")
$strErrorMsg .= "Host/IP";
if($_POST["dbport"] == "")
$_POST["dbport"] = 0;
if($_POST["dbuser"] == "")
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "User";
}
if($_POST["dbpass"] == "")
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Password";
}
if($_POST["dbpassre"] == "")
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Re-type Password";
}
if($_POST["dbname"] == "")
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Database/DSN name";
}
if($_POST["dbpass"] != "" && $_POST["dbpassre"] != "")
{
if(strcmp($_POST["dbpass"], $_POST["dbpassre"]) != 0)
{
if($strErrorMsg != "")
$strErrorMsg .= "! Also the ";
$strErrorMsg .= "Password and Re-typed Password aren't the same";
}
}
if($strErrorMsg != "")
$strDbErrMsg = "Database Settings: <i>" . $strErrorMsg . "</i>";
else
$strDbErrMsg = "";
if( isset($_POST["ui"]) )
$_POST["ui"] = 1;
else
$_POST["ui"] = 0;
$strErrorMsg = "";
if($_POST["ui"] == 1 )
{
if($_POST["uiuser"] != "")
{
if($_POST["uidisname"] == "")
$strErrorMsg .= "Display name";
if($_POST["uipass"] == "")
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Password";
}
if($_POST["uipassre"] == "")
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Re-type Password";
}
if($_POST["uipass"] != "" && $_POST["uipassre"] != "")
{
if(strcmp($_POST["uipass"], $_POST["uipassre"]) != 0)
$strErrorMsg .= "Password and Re-typed Password aren't the same";
}
if($strErrorMsg != "")
$strUiErrMsg = "User Interface Settings: <i>" . $strErrorMsg . "</i>";
else
$strUiErrMsg = "";
}
}
if($strDbErrMsg != "" || $strUiErrMsg != "")
{
echo "</center>";
echo "While installing phpLogCon, there caused an error (Date: ".date("d.m.Y @ H:i")."):<br><br>";
echo "<u><b>Operation:</b></u> Check user's input!<br>";
echo "<u><b>Error:</b></u> <font color=red>You have to fill out following fields: <b>" . $strDbErrMsg . "<br>" . $strUiErrMsg . "</b></font><br><br>Go back and correct this!<br>..:: <a href='install.php'>Go back to installation</a> ::..<br>";
echo "<br><br>";
exit;
}
?>
<b><font color="red">Done!</font></b></center>
<center>Creating required tables...
<?php
// include database driver
if($_POST['dbcon'] == "odbc")
include "../db-drv/odbc_" . $_POST["dbapp"] . ".php";
else
include "../db-drv/mysql.php";
// connect to database
$installCon = db_own_connection($_POST["dbhost"], $_POST["dbport"], $_POST["dbuser"], $_POST["dbpass"], $_POST["dbname"]);
// ***********************
// BEGIN CREATING TABLES
// ***********************
// Get SQL Queries from File
$strQueryFile = "EventTables.sql";
$arQueries = GetSQLQueries($strQueryFile);
// Execute Queries
for($i = 0; $i < count($arQueries); $i++)
db_exec($installCon, $arQueries[$i]);
// If user interface is enabled, create tables
if($_POST["ui"] == 1 )
{
$strQueryFile = "UserTables.sql";
$arQueries = GetSQLQueries($strQueryFile);
for($i = 0; $i < count($arQueries); $i++)
db_exec($installCon, $arQueries[$i]);
}
?>
<b><font color="red">Done!</font></b></center>
<center>Inserting values into tables...
<?php
// ***************************
// BEGIN INSERTS INTO TABLES
// ***************************
//If User Interface should be installed and a user should be created:
if($_POST["ui"] == 1 && $_POST["uiuser"] != "")
{
$strQueryFile = "UserInserts.sql";
$arQueries = GetSQLQueries($strQueryFile);
// Find line which inserts a user into 'Users'-table and replace placeholders with values
for($i = 0; $i < count($arQueries); $i++)
{
if( stristr($arQueries[$i], "INSERT INTO Users") )
{
if($_POST['dbtime'] == "utc")
$now = dbc_sql_timeformat(GetUTCtime(time()));
else
$now = dbc_sql_timeformat(time());
// Edit SQL User-Query - Replace placeholders in query with values from the code
$arQueries[$i] = ereg_replace("<username>", $_POST['uiuser'], $arQueries[$i]);
$arQueries[$i] = ereg_replace("<password>", $_POST['uipass'], $arQueries[$i]);
$arQueries[$i] = ereg_replace("<realname>", $_POST['uidisname'], $arQueries[$i]);
$arQueries[$i] = ereg_replace("<date>", $now, $arQueries[$i]);
$arQueries[$i] = ereg_replace("<lang>", $_POST['uilang'], $arQueries[$i]);
db_exec($installCon, $arQueries[$i]);
}
elseif( stristr($arQueries[$i], "INSERT INTO UserPrefs") )
{
$arQueries[$i] = ereg_replace("<username>", $_POST['uiuser'], $arQueries[$i]);
db_exec($installCon, $arQueries[$i]);
}
}
}
//close database connection
db_close($installCon);
?>
<b><font color="red">Done!</font></b></center>
<center>Creating your config file (config.php)...
<?php
// ***************************
// BEGIN EDITING CONFIG.PHP
// ***************************
//open file handle
$hConfigSrc = fopen("scripts/config.php.ex", "r");
$hConfigDes = fopen("../config.php", "w");
while (!feof($hConfigSrc))
{
$strLine = fgets($hConfigSrc);
//if the current line contains the searchstring, insert values and write line
if(stristr($strLine, "define('_DBSERVER'"))
{
if($_POST['dbport'] != "")
fwrite($hConfigDes, " define('_DBSERVER', '" . $_POST["dbhost"] . ":" . $_POST['dbport'] . "');\r\n");
else
fwrite($hConfigDes, " define('_DBSERVER', '" . $_POST["dbhost"] . "');\r\n");
}
elseif(stristr($strLine, "define('_DBNAME'"))
fwrite($hConfigDes, " define('_DBNAME', '" . $_POST["dbname"] . "');\r\n");
elseif(stristr($strLine, "define('_DBUSERID'"))
fwrite($hConfigDes, " define('_DBUSERID', '" . $_POST["dbuser"] . "');\r\n");
elseif(stristr($strLine, "define('_DBPWD'"))
fwrite($hConfigDes, " define('_DBPWD', '" . $_POST["dbpass"] . "');\r\n");
elseif(stristr($strLine, "define('_CON_MODE'"))
fwrite($hConfigDes, " define('_CON_MODE', '" . $_POST["dbcon"] . "');\r\n");
elseif(stristr($strLine, "define('_DB_APP'"))
fwrite($hConfigDes, " define('_DB_APP', '" . $_POST["dbapp"] . "');\r\n");
elseif(stristr($strLine, "define('_ENABLEUI'"))
fwrite($hConfigDes, " define('_ENABLEUI', " . $_POST["ui"] . ");\r\n");
elseif(stristr($strLine, "define('_DEFLANG'"))
fwrite($hConfigDes, " define('_DEFLANG', '" . $_POST["lang"] . "');\r\n");
elseif(stristr($strLine, "define('_UTCtime'"))
{
if($_POST["dbtime"] == "utc")
$dbTime = 1;
else
$dbTime = 0;
fwrite($hConfigDes, " define('_UTCtime', " . $dbTime . ");\r\n");
}
else
fwrite($hConfigDes, $strLine);
}
fclose($hConfigSrc);
fclose($hConfigDes);
?>
<b><font color="red">Done!</font></b></center>
<br>
<center><b>All processes have been done clearly!<br>Congratulations! You've successfully installed phpLogCon!<br>A file named 'config.php' is stored in the root directory of phpLogCon. In this file there are the whole information you have entered before! You can edit it to your needs if you want to.<br><br>Move to 'index.php' in root directory to start working with phpLogCon!<br><br><font color="red">Don't forget to delete 'install.php', 'progress.php' and 'include.php' (NOT from root directory) from the 'install'-directory!<br>These files could be user for a DoS on your phpLogCon!</font></b></center>
<br><br>
<?php
WriteFoot();
?>

View File

@ -0,0 +1,41 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates all required tables
CREATE TABLE IF NOT EXISTS SystemEvents (
ID int(10) unsigned NOT NULL auto_increment,
CustomerID int(11) NOT NULL default '0',
ReceivedAt datetime NOT NULL default '0000-00-00 00:00:00',
DeviceReportedTime datetime NOT NULL default '0000-00-00 00:00:00',
Facility int(11) NOT NULL default '0',
Priority int(11) NOT NULL default '0',
FromHost varchar(60) NOT NULL default '',
Message text NOT NULL,
NTSeverity char(3) NOT NULL default '',
Importance char(3) NOT NULL default '',
EventSource varchar(60) default NULL,
EventUser varchar(60) NOT NULL default '',
EventCategory int(11) NOT NULL default '0',
EventID int(11) NOT NULL default '0',
EventBinaryData text NOT NULL,
MaxAvailable int(11) NOT NULL default '0',
CurrUsage int(11) NOT NULL default '0',
MinUsage int(11) NOT NULL default '0',
MaxUsage int(11) NOT NULL default '0',
InfoUnitID int(11) NOT NULL default '0',
SysLogTag varchar(60) default NULL,
EventLogType varchar(60) default NULL,
GenericFileName varchar(60) default NULL,
SystemID int(11) NOT NULL default '0',
Checksum int(11) NOT NULL default '0',
PRIMARY KEY (ID)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS SystemEventsProperties (
ID int unsigned not null auto_increment primary key,
SystemEventID int NULL ,
ParamName varchar (255) NULL ,
ParamValue varchar (255) NULL
);

View File

@ -0,0 +1,32 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file inserts values into 'Users' and 'UserPrefs' tables
INSERT INTO Users VALUES ('', '<username>', '<password>', '<realname>', <date>, 1, 100026, '<lang>');
INSERT INTO userprefs VALUES (1, '<username>', 'PHPLOGCON_infounit_sl', '1');
INSERT INTO userprefs VALUES (2, '<username>', 'PHPLOGCON_infounit_er', '1');
INSERT INTO userprefs VALUES (3, '<username>', 'PHPLOGCON_infounit_o', '1');
INSERT INTO userprefs VALUES (4, '<username>', 'PHPLOGCON_priority_0', '1');
INSERT INTO userprefs VALUES (5, '<username>', 'PHPLOGCON_priority_1', '1');
INSERT INTO userprefs VALUES (6, '<username>', 'PHPLOGCON_priority_2', '1');
INSERT INTO userprefs VALUES (7, '<username>', 'PHPLOGCON_priority_3', '1');
INSERT INTO userprefs VALUES (8, '<username>', 'PHPLOGCON_priority_4', '1');
INSERT INTO userprefs VALUES (9, '<username>', 'PHPLOGCON_priority_5', '1');
INSERT INTO userprefs VALUES (10, '<username>', 'PHPLOGCON_priority_6', '1');
INSERT INTO userprefs VALUES (11, '<username>', 'PHPLOGCON_priority_7', '1');
INSERT INTO userprefs VALUES (12, '<username>', 'PHPLOGCON_ti', 'today');
INSERT INTO userprefs VALUES (13, '<username>', 'PHPLOGCON_order', 'Date');
INSERT INTO userprefs VALUES (14, '<username>', 'PHPLOGCON_refresh', '0');
INSERT INTO userprefs VALUES (15, '<username>', 'PHPLOGCON_FilterInfoUnit', '1');
INSERT INTO userprefs VALUES (16, '<username>', 'PHPLOGCON_FilterOrderby', '1');
INSERT INTO userprefs VALUES (17, '<username>', 'PHPLOGCON_FilterRefresh', '1');
INSERT INTO userprefs VALUES (18, '<username>', 'PHPLOGCON_FilterColExp', '1');
INSERT INTO userprefs VALUES (19, '<username>', 'PHPLOGCON_FilterHost', '1');
INSERT INTO userprefs VALUES (20, '<username>', 'PHPLOGCON_FilterMsg', '1');
INSERT INTO userprefs VALUES (24, '<username>', 'PHPLOGCON_favorites', 'www.adiscon.com|Adiscon,www.monitorware.com|MonitorWare,www.winsyslog.com|WinSysLog');
INSERT INTO userprefs VALUES (21, '<username>', 'PHPLOGCON_uStylesheet', 'matrix');
INSERT INTO userprefs VALUES (22, '<username>', 'PHPLOGCON_uLanguage', 'en');
INSERT INTO userprefs VALUES (23, '<username>', 'PHPLOGCON_uSaveFilterSettings', '1');
INSERT INTO userprefs VALUES (25, '<username>', 'PHPLOGCON_uDebug', '0');

View File

@ -0,0 +1,25 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the 'Users' and 'UserPrefs' tables
CREATE TABLE IF NOT EXISTS Users (
UserID int(10) unsigned NOT NULL auto_increment,
UserIDText varchar(20) NOT NULL default '',
Password varchar(50) NOT NULL default '',
DisplayName varchar(50) NOT NULL default '',
LastLogon datetime NOT NULL default '0000-00-00 00:00:00',
UserType int(11) NOT NULL default '0',
HomeTZ int(11) NOT NULL default '0',
PrefCulture varchar(5) NOT NULL default '',
PRIMARY KEY (UserID)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS UserPrefs (
ID int(10) unsigned NOT NULL auto_increment,
UserLogin varchar(50) NOT NULL default '',
Name varchar(255) NOT NULL default '',
PropValue varchar(200) NOT NULL default '0',
PRIMARY KEY (ID)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

View File

@ -0,0 +1,143 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
// Set some defaults
ini_set("register_globals", "1");
/*
**************************************************
* Begin of config variables *
* * ** * *
* You can change these settings to your need *
* * ** * *
* Only change if you know what you are doing *
**************************************************
*/
/*
***** BEGIN DATABASE SETTINGS *****
*/
//Server name (only needed if you not use ODBC)
define('_DBSERVER', 'localhost');
// DSN (ODBC) or database name (Mysql)
define('_DBNAME', 'monitorware');
// Userid for database connection ***
define('_DBUSERID', 'root');
// Password for database connection ***
define('_DBPWD', '');
// table name
define('_DBTABLENAME', 'systemevents');
// Switch for connection mode
// Currently only odbc and native works
define('_CON_MODE', 'native');
// Defines the Database Application you are using,
// because for example thx ODBC syntax of MySQL
// and Microsoft Access/SQL Server/etc are different
// Currently available are:
// with native: mysql
// with ODBC: mysql and mssql are available
define('_DB_APP', 'mysql');
/*
***** END DATABASE SETTINGS *****
*/
/*
***** BEGIN FOLDER SETTINGS *****
*/
//The folder where the classes are stored
define('_CLASSES', 'classes/');
//The folder where the forms are stored
define('_FORMS', 'forms/');
//The folder where the database drivers are stored
define('_DB_DRV', 'db-drv/');
//The folder where the language files are stored
define('_LANG', 'lang/');
//your image folder
define('_ADLibPathImage', 'images/');
//folder for scripts i.g. extern javascript
define('_ADLibPathScript', 'layout/');
/*
***** END FOLDER SETTINGS *****
*/
/*
***** BEGIN VARIOUS SETTINGS *****
*/
//Set to 1 and User Interface will be used! Set 0 to disable it.
define('_ENABLEUI', 0);
//This sets the default language that will be used.
define('_DEFLANG', 'en');
// Use UTC time
define('_UTCtime', 0);
// Get messages date by ReceivedAt or DeviceReportedTime
define('_DATE', 'ReceivedAt');
// Coloring priority
define('_COLPriority', 1);
/*
***** END VARIOUS SETTINGS *****
*/
/*
******************************************************
* * ** * *
* From this point you shouldn't change something *
* * ** * *
* Only change if it is really required *
******************************************************
*/
// Show quick filter enabled = 1, disabled = 0:
define('_FilterInfoUnit', 1);
define('_FilterOrderby', 1);
define('_FilterRefresh', 1);
define('_FilterColExp', 1);
define('_FilterHost', 1);
define('_FilterMsg', 1);
//Session expire time. Unix-Timestamp. To set this value:
//call time(), that returns the seconds from 1.1.1970 (begin Unix-epoch) and add the
//time in seconds when the cookie should expire.
$session_time = (time()+(60*10));
//Cookie expire time. Unix-Timestamp. How to set this value, see "session_time".
define('_COOKIE_EXPIRE', (time()+60*60*24*30));
?>

166
lang/de.php Normal file
View File

@ -0,0 +1,166 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*
* German language file for phpLogCon
*/
define('_MSG001', 'Willkommen bei phpLogCon! Bittle loggen Sie sich zuerst mit Ihrem benutzernamen und Passwort ein');
define('_MSGUsrnam', 'Benutzername');
define('_MSGpas', 'Passwort');
define('_MSGLogSuc', 'Login erfolgreich');
define('_MSGWel', 'Willkommen bei phpLogCon');
define('_MSGChoOpt', '! Wählen sie unter den Optionen aus dem obrigen Menü aus');
define('_MSGQuiInf', 'Kurz-Info (Unter Berücksichtigung der Filtereinstellungen)');
define('_MSGTop5', 'Top fünf Logs (Unter Berücksichtigung der Filtereinstellungen)');
define('_MSGNoData', 'Keine Daten gefunden');
define('_MSGDate', 'Datum');
define('_MSGFac', 'Facility');
define('_MSGMsg', 'Nachricht');
define('_MSGAccDen', 'Zugang nicht gestattet');
define('_MSGFalLog', 'Sie sind kein registrierter Benutzer oder Sie haben ein falsches Passwort eingegeben');
define('_MSGBac2Ind', 'Zurück zum Index');
define('_MSGSesExp', 'Session abgelaufen');
define('_MSGSesExpQue', 'Session abgelaufen. Haben Sie vielleicht das letzte mal vergessen sich auszuloggen');
define('_MSGReLog', 'Zurück zum Index um sich neu neu einzuloggen');
define('_MSGShwEvn', 'Zeige Events');
define('_MSGNoDBCon', 'Verbindung zum Datenbank-Server fehlgeschlagen');
define('_MSGChDB', 'Auswahl der Datenbank fehlgeschlagen');
define('_MSGInvQur', 'Ungültige Abfrage');
define('_MSGNoRes', 'Kein gültiges Datenbank-Ergebnis');
define('_MSGNoDBHan', 'Kein gültiger Datenbank-Verbindungs-Handle');
define('_MSGLogout', 'LogOut');
define('_MSGSrcExp', 'Nach Ausdruck suchen');
define('_MSGSrc', 'Suche');
define('_MSGColExp', 'Ausdruck färben');
define('_MSGinCol', ' in dieser Farbe: ');
define('_MSGBrw', 'Durchsuchen');
define('_MSGFilConf', 'Filter Konfiguration');
define('_MSGUsrConf', 'Benutzer Konfiguration');
define('_MSGBscSet', 'Generelle Einstellungen');
define('_MSGConSet', 'Verbindungs Einstellungen');
define('_MSGConMod', 'Verbindungsmodus');
define('_MSGFilCon', 'Filter Bedingungen');
define('_MSGEvnDat', 'Event Datum');
define('_MSGOrdBy', 'Sortieren nach');
define('_MSGRef', 'Aktualisierung');
define('_MSGInfUI', 'InfoEinheit');
define('_MSGOth', 'Andere');
define('_MSGPri', 'Priorität');
define('_MSGFilSet', 'Filter Einstellungen');
define('_MSGUsrSet', 'Benutzer Einstellungen');
define('_MSGFilOpt', 'Filter Optionen');
define('_MSGSwiEvnMan', 'Event Datum manuell auswählen');
define('_MSGSwiEvnPre', 'Event Datum vordefiniert auswählen');
define('_MSGShwEvnDet', 'Zeige Event Details');
define('_MSGBck', 'zurück');
define('_MSGEvnID', 'EventID');
define('_MSGClickBrw', ' (Klick um die MonitorWare Datenbank zu durchsuchen) :: (Oder durchsuche ');
define('_MSGEvnCat', 'EventKategorie');
define('_MSGEvnUsr', 'EventBenutzer');
define('_MSGFrmHos', 'VonHost');
define('_MSGNTSev', 'NTSeverity');
define('_MSGRecAt', 'EmpfangenAm');
define('_MSGDevRep', 'VomGerätGemeldeteZeit');
define('_MSGImp', 'Wichtigkeit');
define('_MSGEvn', 'Event');
define('_MSGTo', 'bis');
define('_MSGFrm', 'von');
define('_MSGLogPg', 'Logs pro Seite');
define('_MSGHom', 'Startseite');
define('_MSGHlp', 'Hilfe');
define('_MSGFOpt', 'Filter Optionen');
define('_MSGUOpt', 'Benutzer Optionen');
define('_MSGEvnLogTyp', 'EventLogArt');
define('_MSGEvnSrc', 'EventQuelle');
define('_MSG2dy', 'heute');
define('_MSGYester', 'nur gestern');
define('_MSGThsH', 'aktuelle Stunde');
define('_MSGLstH', 'letzte Stunde');
define('_MSGL2stH', 'letzten 2 Stunden');
define('_MSGL5stH', 'letzten 5 Stunden');
define('_MSGL12stH', 'letzten 12 Stunden');
define('_MSGL2d', 'letzten 2 Tage');
define('_MSGL3d', 'letzten 3 Tage');
define('_MSGLw', 'letzte Woche');
define('_MSGFacDat', 'Facility und Datum');
define('_MSGPriDat', 'Priorität und Datum');
define('_MSGNoRef', 'nicht aktualisieren');
define('_MSGE10s', 'alle 10 sek');
define('_MSGE30s', 'alle 30 sek');
define('_MSGEm', 'jede min');
define('_MSGE2m', 'alle 2 min');
define('_MSGE15m', 'alle 15 min');
define('_MSGEn', 'Englisch');
define('_MSGDe', 'Deutsch');
define('_MSGFav', 'Favoriten');
define('_MSGDel', 'Löschen');
define('_MSGNoFav', 'Keine Favoriten gefunden');
define('_MSGNewFav', 'Neuer Favorit');
define('_MSGSiten', 'Seitenname');
define('_MSGAdd', 'Hinzufügen');
define('_MSGChg', 'Ändern');
define('_MSGEnv', 'Umgebung');
define('_MSGUsrInt', 'Benutzer Maske');
define('_MSGUEna', 'Aktiviert');
define('_MSGUDsa', 'Deaktiviert');
define('_MSGNamInvChr', 'Name und/oder Passwort enthielten ungültige Zeichen');
define('_MSGSitInvChr', 'Seitenname und/oder Adresse enthielten ungültige Zeichen');
define('_MSGESec', 'jede Sekunde');
define('_MSGE5Sec', 'alle 5 Sek');
define('_MSGE20Sec', 'alle 20 Sek');
define('_MSGRed', 'Rot');
define('_MSGBlue', 'Blau');
define('_MSGGreen', 'Grün');
define('_MSGYel', 'Gelb');
define('_MSGOra', 'Orange');
define('_MSGFilHost', 'Suchen nach IP/Computer');
define('_MSGSearchMsg', 'Nachricht muss folgendes enthalten');
define('_MSGDisIU', 'Zeige Info Einheiten');
define('_MSGEnbQF', 'Anzeigen von Quick-Filtern');
define('_MSGSty', 'Aussehen');
define('_MSGHost', 'Computer');
define('_MSGPRI0', 'EMERGENCY');
define('_MSGPRI1', 'ALERT');
define('_MSGPRI2', 'CRITICAL');
define('_MSGPRI3', 'ERROR');
define('_MSGPRI4', 'WARNING');
define('_MSGPRI5', 'NOTICE');
define('_MSGPRI6', 'INFO');
define('_MSGPRI7', 'DEBUG');
define('_MSGNumSLE', 'Anzahl der Syslog Events');
define('_MSGNumERE', 'Anzahl der EventReporter Events');
define('_MSGNoMsg', '[Keine Nachricht vorhanden]');
define('_MSGMenInf1', '- Sie befinden sich zur Zeit im ');
define('_MSGMenInf2', ' Modus auf ');
define('_MSGMenInf3', '. Datenbank: ');
define('_MSGLang', 'Sprache:');
define('_MSGStyle', 'Stylesheet:');
define('_MSGAddInfo', 'Zusätzliche Informationen:');
define('_MSGDebug1', 'Debug:');
define('_MSGDebug2', 'Zeige Debug Ausgaben');
define('_MSGSave', 'Speicher/- Ladeoptionen:');
define('_MSGFilSave1', 'Filter Einstellungen:');
define('_MSGFilSave2', 'Filter Einstellungen in Datenbank speichern und beim Einloggen auslesen');
define('_MSGDBOpt', 'Datenbankoptionen:');
define('_MSGUTC1', 'UTC-Zeit:');
define('_MSGUTC2', 'Wenn Ihr Datenbank-Server keine UTC-Zeit verwendet, entfernen Sie das Häckchen!');
define('_MSGSavCook', 'Login behalten (Cookie)?');

166
lang/en.php Normal file
View File

@ -0,0 +1,166 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*
* English language file for phpLogCon
*/
define('_MSG001', 'Welcome to phpLogCon! Please login with your username and password first');
define('_MSGUsrnam', 'Username');
define('_MSGpas', 'Password');
define('_MSGLogSuc', 'Login successfully');
define('_MSGWel', 'Welcome to phpLogCon');
define('_MSGChoOpt', '! Choose an option from the menu above');
define('_MSGQuiInf', 'Quick info (under respect of filter settings)');
define('_MSGTop5', 'Top five logs (under respect of filter settings)');
define('_MSGNoData', 'No data found');
define('_MSGDate', 'Date');
define('_MSGFac', 'Facility');
define('_MSGPri', 'Priority');
define('_MSGInfUI', 'InfoUnit');
define('_MSGMsg', 'Message');
define('_MSGAccDen', 'Access denied');
define('_MSGFalLog', 'You are not a subscribed user or Invalid Password');
define('_MSGBac2Ind', 'Back to Index');
define('_MSGSesExp', 'Session Expired');
define('_MSGSesExpQue', 'Session Expired. Maybe you forgot to log out');
define('_MSGReLog', 'Back to Index to re-login');
define('_MSGShwEvn', 'Show Events');
define('_MSGNoDBCon', 'Cannot connect to database-server');
define('_MSGChDB', 'Failed to changing database');
define('_MSGInvQur', 'Invalid query');
define('_MSGNoRes', 'No valid Database-Result');
define('_MSGNoDBHan', 'No valid Database-Connection-Handle');
define('_MSGLogout', 'Logout');
define('_MSGSrcExp', 'Search for Expression');
define('_MSGSrc', 'Search');
define('_MSGinCol', ' in this color: ');
define('_MSGBrw', 'Browse');
define('_MSGBscSet', 'Basic Settings');
define('_MSGConSet', 'Connection Settings');
define('_MSGConMod', 'Connection Mode');
define('_MSGFilCon', 'Filter conditions');
define('_MSGEvnDat', 'Event&acute;s Date');
define('_MSGOrdBy', 'Order by');
define('_MSGRef', 'Refresh');
define('_MSGOth', 'Other');
define('_MSGFilSet', 'Filter Settings');
define('_MSGUsrSet', 'User Settings');
define('_MSGFilOpt', 'Filter Options');
define('_MSGSwiEvnMan', 'Switch to select events date manually');
define('_MSGSwiEvnPre', 'Switch to select events date predefined');
define('_MSGShwEvnDet', 'Show Events Details');
define('_MSGBck', 'back');
define('_MSGEvnID', 'EventID');
define('_MSGClickBrw', ' (Click for browsing MonitorWare database) :: (Or browse ');
define('_MSG2dy', 'today');
define('_MSGYester', 'only yesterday');
define('_MSGThsH', 'this hour');
define('_MSGLstH', 'last 1 hour');
define('_MSGL2stH', 'last 2 hours');
define('_MSGL5stH', 'last 5 hours');
define('_MSGL12stH', 'last 12 hours');
define('_MSGL2d', 'last 2 days');
define('_MSGL3d', 'last 3 days');
define('_MSGLw', 'last week');
define('_MSGFacDat', 'Facility and Date');
define('_MSGPriDat', 'Priority and Date');
define('_MSGNoRef', 'no refresh');
define('_MSGE10s', 'every 10 sec');
define('_MSGE30s', 'every 30 sec');
define('_MSGEm', 'every min');
define('_MSGE2m', 'every 2 min');
define('_MSGE15m', 'every 15 min');
define('_MSGEn', 'English');
define('_MSGDe', 'German');
define('_MSGFav', 'Favorites');
define('_MSGDel', 'Delete');
define('_MSGNoFav', 'No favorites found');
define('_MSGNewFav', 'New favorite');
define('_MSGSiten', 'Sitename');
define('_MSGAdd', 'Add');
define('_MSGChg', 'Change');
define('_MSGEnv', 'Environment');
define('_MSGUsrInt', 'User Interface');
define('_MSGUEna', 'Enabled');
define('_MSGUDsa', '"Disabled');
define('_MSGNamInvChr', 'Name and/or password contained invalid characters');
define('_MSGSitInvChr', 'Sitename and/or address contained invalid characters');
define('_MSGESec', 'every second');
define('_MSGE5Sec', 'every 5 sec');
define('_MSGE20Sec', 'every 20 sec');
define('_MSGRed', 'Red');
define('_MSGBlue', 'Blue');
define('_MSGGreen', 'Green');
define('_MSGYel', 'Yellow');
define('_MSGOra', 'Orange');
define('_MSGSty', 'Style');
define('_MSGEnbQF', 'Enable Quick Filters:');
define('_MSGDisIU', 'Display Info Unit');
define('_MSGColExp', 'Color an Expression');
define('_MSGFilConf', 'Filter Configuration');
define('_MSGUsrConf', 'User Configuration');
define('_MSGHost', 'Host');
define('_MSGEvnCat', 'EventCategory');
define('_MSGEvnUsr', 'EventUser');
define('_MSGFrmHos', 'FromHost');
define('_MSGNTSev', 'NTSeverity');
define('_MSGRecAt', 'ReceivedAt');
define('_MSGDevRep', 'DeviceReportedTime');
define('_MSGImp', 'Importance');
define('_MSGEvn', 'Event');
define('_MSGTo', 'to');
define('_MSGFrm', 'from');
define('_MSGLogPg', 'Logs per page');
define('_MSGHom', 'Home');
define('_MSGHlp', 'Help');
define('_MSGFOpt', 'Filter Options');
define('_MSGUOpt', 'User Options');
define('_MSGEvnLogTyp', 'EventLogType');
define('_MSGEvnSrc', 'EventSource');
define('_MSGFilHost', 'Search only for IP/Host');
define('_MSGSearchMsg', 'Message must contain');
define('_MSGPRI0', 'EMERGENCY');
define('_MSGPRI1', 'ALERT');
define('_MSGPRI2', 'CRITICAL');
define('_MSGPRI3', 'ERROR');
define('_MSGPRI4', 'WARNING');
define('_MSGPRI5', 'NOTICE');
define('_MSGPRI6', 'INFO');
define('_MSGPRI7', 'DEBUG');
define('_MSGNumSLE', 'Number of Syslog Events');
define('_MSGNumERE', 'Number of EventReporter Events');
define('_MSGNoMsg', '[No message available]');
define('_MSGMenInf1', '- You are currenty in ');
define('_MSGMenInf2', ' mode on ');
define('_MSGMenInf3', '. Database: ');
define('_MSGLang', 'Language:');
define('_MSGStyle', 'Stylesheet:');
define('_MSGAddInfo', 'Additional Informations:');
define('_MSGDebug1', 'Debug:');
define('_MSGDebug2', 'Show Debug Output');
define('_MSGSave', 'Save/- Loadoptions:');
define('_MSGFilSave1', 'Filter Settings:');
define('_MSGFilSave2', 'Save filter settings in database and load them while logging in');
define('_MSGDBOpt', 'Databaseoptions:');
define('_MSGUTC1', 'UTC Time:');
define('_MSGUTC2', 'When your database-server doesn\'t use UTC time, uncheck this!');
define('_MSGSavCook', 'Keep you logged in (Cookie)?');

19
layout/common.js Normal file
View File

@ -0,0 +1,19 @@
function NewWindow(WindowName,X_width,Y_height,Option)
{
var Addressbar = "location=NO"; //Default
var OptAddressBar = "AddressBar"; //Default adress bar
if (Option == OptAddressBar)
{
Addressbar = "location=YES";
}
window.open('',WindowName,
'toolbar=no,' + Addressbar + ',directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + X_width +
',height=' + Y_height);
}
function GotoSite()
{
var szUrl = "";
szUrl = document.BookmarkConfiguration.favorites.options.selectedIndex;
window.open(szUrl,"","");
}

219
layout/matrix.css Normal file
View File

@ -0,0 +1,219 @@
P
{
font-family: Tahoma, Arial;
font-size: 10pt
}
TD
{
border-width:0;
border-right: black 0px solid;
border-left: black 0px solid;
border-style:solid;
border-color:#000055;
}
H1
{
font-weight: bold;
color: #0AAD79;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
letter-spacing: 3px;
}
a:link,a:active,a:visited
{
text-decoration: underline;
color : #78DBF7;
}
a:hover
{
text-decoration: underline;
color : #5B4CF5;
}
body
{
background-color: #000000;
margin: 0px;
padding: 0px;
scrollbar-face-color: #DEE3E7;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #DEE3E7;
scrollbar-3dlight-color: #D1D7DC;
scrollbar-arrow-color: #006699;
scrollbar-track-color: #EFEFEF;
scrollbar-darkshadow-color: #98AAB1;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
color: #FFFFFF;
}
table
{
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
color: #FFFFFF;
}
/*
padding-right: 0px;
padding-left: 0px;
padding-bottom: 0px;
padding-top: 0px;
border-collapse: collapse;
*/
.ConfigTable
{
border: 1px solid;
border-color:#00FF00;
margin: 1px;
padding-left: 5px;
}
.EventTable
{
border: black 0px solid;
padding: 5px;
border-spacing: 2px;
}
.TDHEADER
{
background-color: #1D3D33;
border-right: black 0px solid;
border-left: black 0px solid;
border-top: black 0px solid;
border-bottom: black 0px solid;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
font-weight : bold;
color: #FFFFFF;
text-decoration: none;
}
.TD1
{
background-color: #0D7B5A;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
font-weight : bold;
color: #FFFFFF;
text-decoration: none;
}
.TD1:link,.TD1:active,.TD1:visited
{
color : #FFFFFF ;
}
.TD1:hover
{
background-color: #DCEEE8;
color: #000000;
}
.TD2
{
background-color: #2BBA8E;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
font-weight : bold;
color: #FFFFFF;
text-decoration: none;
}
.TD2:link,.TD2:active,.TD2:visited
{
color : #000000 ;
}
.TD2:hover
{
background-color: #DCEEE8;
color: #000000;
}
.Header1
{
background-color: #BCC1C5;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
font-weight : bold;
}
.PriorityEmergency
{
color: #FFFFFF;
background-color: #ff4444;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityAlert
{
color: #FFFFFF;
background-color: #dd00dd;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityCrit
{
color: #FFFFFF;
background-color: #dd9900;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityError
{
color: #FFFFFF;
background-color: #CC0000;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityWarning
{
color: #FFFFFF;
background-color: #FFAA00;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityNotice
{
color: #FFFFFF;
background-color: #66CC33;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityInfo
{
color: #000000;
background-color: #ABF1FF;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityDebug
{
color: #FFFFFF;
background-color: #3333ff;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.Msg
{
}
.Msg:link,.Msg:active,.Msg:visited
{
}
.Msg:hover
{
}

48
layout/matrix.js Normal file
View File

@ -0,0 +1,48 @@
//Matrix Script
var density=0.2;
var colors=new Array('#030','#060','#393','#6C6','#fff');
var minL=5; var maxL=30;
var minS=30; var maxS=80;
var cW=11; var cH=11;
var ascSt=33; var ascEnd=126;
var DOM=(document.getElementById)?true:false;
var scrW,scrH;
var cl=new Array;
function init()
{
scrW=document.body.clientWidth-25-cW;
scrH=document.body.clientHeight;
if (!scrW)
{
scrW = 750;
scrH = 550;
}
for (var clN=0;clN<Math.round(scrW/cW*density);clN++)
{
cl[cl.length]=[getX(),Math.round(Math.random()*scrH/cH),Math.round(Math.random()*(maxL-minL))+minL,getS()];
document.write('<div id="c'+clN+'" style="position:absolute;z-index=1;font-family: Tahoma, Verdana, Arial, Helvetica;font-size: 8pt;width:'+cW+'px;left:'+(cl[clN][0]*cW)+'px">');
for (var cN=0;cN<=cl[clN][2];cN++) document.write('<span style="color:'+colors[Math.round(cN/cl[clN][2]*(colors.length-1))]+'">'+String.fromCharCode(Math.round(Math.random()*(ascEnd-ascSt)+ascSt))+'</span><br>');
document.write('</div>');
cl[clN][5]=document.getElementById('c'+clN).style;
cl[clN][4]=setI(clN);
}
}
function move(n) {
cl[n][1]++;
if (Math.round(scrH/cH)+cl[n][2]<cl[n][1]) {
clearInterval(cl[n][4]);
cl[n][0]=getX();
cl[n][1]=-cl[n][2]-1;
cl[n][3]=getS();
cl[n][5].left=cl[n][0]*cW;
cl[n][4]=setI(n);
} else cl[n][5].top=(cl[n][1]-cl[n][2])*cH;
}
function getS() {return Math.round(Math.random()*(maxS-minS))+minS}
function getX() {return Math.round(Math.random()*scrW/cW)}
function setI(n) {return setInterval('move('+n+')',Math.round(3000/cl[n][3]))}
init();

187
layout/phplogcon.css Normal file
View File

@ -0,0 +1,187 @@
body
{
background-color: #E5E5E5;
scrollbar-face-color: #DEE3E7;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #DEE3E7;
scrollbar-3dlight-color: #D1D7DC;
scrollbar-arrow-color: #006699;
scrollbar-track-color: #EFEFEF;
scrollbar-darkshadow-color: #98AAB1;
font-size: 10pt;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-decoration: none;
background-color: #E5E5E5;
}
a:link,a:active,a:visited
{
text-decoration: underline;
color : #FF0000 ;
}
a:hover
{
text-decoration: underline;
color : #000000;
}
table
{
border-collapse: collapse;
font-size: 8pt;
color: #000000;
}
TD
{
border-width:0;
border-style:solid;
border-color:#000055;
padding: 2px;
}
H1
{
font-weight: bold;
color: navy;
letter-spacing: 3px;
}
.ConfigTable
{
border: black 1px solid;
background-color: #F5F5DD;
margin: 1px;
padding-left: 5px;
}
.EventTable
{
border: black 1px solid;
background-color: #F5F5DD;
}
.TDHEADER
{
background-color: gray;
border-bottom: black 1px solid;
font-weight : bold;
color: #FFFFFF;
}
.TD1
{
background-color: #F5F5DD;
border-bottom: black 1px solid;
border-top: black 1px solid;
border-right: gray 1px solid;
font-size: 8pt;
color: #000000;
}
.TD2
{
background-color: #EFEFEB;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
font-size: 8pt;
color: #000000;
text-decoration: none;
}
.Header1
{
background-color: #BCC1C5;
font-size: 10pt;
font-weight : bold;
}
.PriorityEmergency
{
color: #FFFFFF;
background-color: #ff4444;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityAlert
{
color: #FFFFFF;
background-color: #dd00dd;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityCrit
{
color: #FFFFFF;
background-color: #dd9900;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityError
{
color: #FFFFFF;
background-color: #CC0000;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityWarning
{
color: #FFFFFF;
background-color: #FFAA00;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityNotice
{
color: #FFFFFF;
background-color: #66CC33;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityInfo
{
color: #000000;
background-color: #ABF1FF;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.PriorityDebug
{
color: #FFFFFF;
background-color: #3333ff;
border-top: black 1px solid;
border-bottom: black 1px solid;
border-right: gray 1px solid;
}
.Msg
{
color : #000000;
}
.Msg:link,.Msg:active,.Msg:visited
{
color : #000000;
}
.Msg:hover
{
color : #FF0000;
}

0
layout/phplogcon.js Normal file
View File

182
layout/theme.php Normal file
View File

@ -0,0 +1,182 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
/*! \addtogroup Layout
*
* Here you find the basic structure of the page layout. Changes in the
* following function take affect in the hole phpLogCon projeckt. Note,
* the basic structure of each phpLogCon page must be generated by the
* use of the WriteHead() and WriteFood(). If you make a new phpLogCon
* page, first call WriteHead(). This function generate the hole header
* of the page. WriteHead() itself calls functions to generate the top
* menu bar (MenuTop()) and the menu on the left side (MenuLeft()).
* After this function call you are in the main work area. There you
* can provide your content information. To finialize the page, call
* WriteFood(). This generates the footer on the bottom of the page.
* @{
*/
/*!
* Include the stylesheeh
*
*/
/*!
* generate the url for pint version
* /return The Url refer to the pint version of the current page.
*/
function GetPrinterURL()
{
global $PHP_SELF, $QUERY_STRING;
$szURL = $PHP_SELF . "?";
if(strlen($QUERY_STRING) > 0)
$szURL .= $QUERY_STRING . "&";
$szURL .= "PrinterVersion=1";
return($szURL);
} //end function GetPrintUrl()
/*!
* Display logo and provide the link to change to print version. ...
* This things are displayed on the top of the page.
*
* Menu Top is called by WriteHead()
*
* \param SiteName This String is displayed on the top of the page (it is visible output!)
* \sa WriteHead()
*/
function MenuTop($SiteName)
{
global $strBasePath, $strBaseRealPath, $PrinterVersion;
?>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" CLASS="EventTable">
<tr>
<td width="220" align="left"><img src="<? echo _ADLibPathImage; ?>phplogcon.gif" border="0"></td>
<td align="left">
<h1>phpLogCon monitoring</h1>
</td>
</tr>
</table>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" CLASS="EventTable">
<tr>
<td align="left">
<a href="index.php"><?php echo _MSGHom; ?></a> | <a href="events-display.php"><?php echo _MSGShwEvn; ?></a>
| <a href="filter-config.php"><?php echo _MSGFOpt; ?></a> | <a href="user-config.php"><?php echo _MSGUOpt; ?></a> |
<a href="<? echo $_SERVER['PHP_SELF'] . GetSortedArgs(); ?>"><?php echo _MSGRef; ?></a> | <a href="doc/index.htm"><?php echo _MSGHlp; ?></a>
<?php if($_SESSION['debug'] == 1)echo _MSGMenInf1 . "<font color=\"red\">" . strtoupper(_CON_MODE) . "</font>" . _MSGMenInf2 . "<font color=\"red\">" . strtoupper(_DB_APP) . "</font>" . _MSGMenInf3 . "<font color=\"red\">" . strtoupper(_DBNAME) . "</font>";?>
</td>
<td align="left">&nbsp;</td>
<td align="right">
<b><font ID="HeadTitle" class="HeadTitle"><?php echo $SiteName; ?></font></b>
</td>
</tr>
</table>
<?php
} // END MenuTop()
/*!
* It generates the head of the document. All things between the introducing html - Tag and body - Tag
* is generated by this function, e. g. Meta Description, ...
*
* WriteHead call the the functions: MenuTop($SiteName) and MenuLeft()
*
* \param strTitle Title of the current page (used for the title - Tag)
* \param strKeywords Additional keywords, especially for the current page (used for Meta Tag)
* \param strDescr A description of the current page (used for Meta Tag)
* \param SiteName This String is displayed on the top of the page (it is visible output!)
* \sa MenuTop($SiteName), MenuLeft()
*/
function WriteHead($strTitle, $strKeywords, $strDescr, $SiteName)
{
global $stylesheet;
?>
<html>
<head>
<title><? echo $strTitle; ?></title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META NAME="copyright" CONTENT="Copyright (C) 2003 Adiscon GmbH, Erftstadt - www.adiscon.com">
<META name="Keywords" content="<? echo $strKeywords ?> sql server win NT windows 7 2000 replication merge nt transactional date time resolver">
<META http-equiv="pragma" CONTENT="no-cache">
<?php
if(strlen($strDescr) > 0)
{
echo "<meta name=\"Description\" content=\"".$strDescr."\">";
}
// if refresh enabled, make a meta redirect
if ($_SESSION['refresh'] > 0)
echo '<meta HTTP-EQUIV="REFRESH" CONTENT="', $_SESSION['refresh'], '; URL=', $_SERVER['PHP_SELF'], '?', $_SERVER['QUERY_STRING'], '">';
?>
<link rel="stylesheet" href="<?php echo _ADLibPathScript . $_SESSION['stylesheet']; ?>.css" type="text/css">
<?php echo '<script language="JavaScript" src="' . _ADLibPathScript . 'common.js"></script>'; ?>
</head>
<body>
<script src="<?php echo _ADLibPathScript . $_SESSION['stylesheet']; ?>.js"></script>
<?php
MenuTop($SiteName);
} // END of WriteHead() function
/*!
* The footer holds some general information.
*/
function WriteFood()
{
global $strBasePath, $strBaseRealPath, $PrinterVersion, $global_Con;
?>
<center>
<table>
<tr>
<td>
<br /><br />
<small><i><a href="http://www.phplogcon.com/" target="phplogcon">phpLogCon</a>, Copyright &copy; 2003 - 2004 <a href="http://www.adiscon.com" target="Adiscon">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>
<?php
// Close Database connection ONCE
db_close($global_Con);
} // END function WriteFood()
?>

9
phplogcon.ini Normal file
View File

@ -0,0 +1,9 @@
# *********************************************
# This is the external config file of phpLogCon.
# *********************************************
# wordsdontshow: Here you can enter some words that shouldn't be displayed in the events-display.
# case-INsensitive!!
# e.g.: wordsdontshow=Agent, Service, User
[phplogcon]
wordsdontshow=

113
quick-filter.php Normal file
View File

@ -0,0 +1,113 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name="quickFilter" value="change">
<?php
function ShowVarFilter()
{
if ($_SESSION['FilterInfoUnit']==1)
{
echo '&nbsp;', _MSGDisIU, ': ';
include _FORMS.'display-infounit.php';
}
if ($_SESSION['FilterOrderby']==1)
{
echo '&nbsp;', _MSGOrdBy, ': ';
include _FORMS.'order-by.php';
}
if ($_SESSION['FilterRefresh']==1)
{
echo '&nbsp;', _MSGRef, ': ';
include _FORMS.'refresh.php';
}
if ($_SESSION['FilterColExp']==1)
{
echo '&nbsp;', _MSGColExp, '&nbsp;';
include _FORMS.'color-expression.php';
}
if ($_SESSION['FilterHost']==1)
{
echo '&nbsp;', _MSGFilHost, ': ';
include _FORMS.'filter-host.php';
}
if ($_SESSION['FilterMsg']==1)
{
echo '&nbsp;', _MSGSearchMsg, ': ';
include _FORMS.'search-msg.php';
}
}
echo '<b>', _MSGFilOpt, '</b>';
// this switch is only a temporarry solution. Which forms are displayed should be configureable in the user profil in the future!
if ($_SESSION['change'] == 'Predefined')
{
echo '&nbsp;', _MSGEvnDat, '&nbsp;';
include _FORMS.'events-date.php';
echo '&nbsp;', _MSGLogPg, ': ';
include _FORMS.'logs-per-page.php';
ShowVarFilter();
echo '<input type="hidden" name="change" value="Predefined">';
}
else
{
echo '&nbsp;';
include _FORMS.'manually-date.php';
echo '&nbsp;';
include _FORMS.'logs-per-page.php';
ShowVarFilter();
echo '<input type="hidden" name="change" value="Manually">';
}
?>
<table><tr><td>
<input type="submit" name="form" value="Submit"></form></td><td>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<?php
if ($_SESSION['change'] == "Predefined")
echo '<input type="submit" name="change" value="Manually">';
//echo "<a href='events-display.php?change=Manually'>" . _MSGSwiEvnMan . "</a>";
else
echo '<input type="submit" name="change" value="Predefined">';
//echo "<a href='events-display.php?change=Predefined'>" . _MSGSwiEvnPre . '</a>';
?>
</form></td></tr></table>

88
submit.php Normal file
View File

@ -0,0 +1,88 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
// global _DBNAME, _DBUSERID, _DBPWD, _DBSERVER, $session_time;
include 'include.php';
if( !isset($_POST['save_cookies']))
$_POST['save_cookies'] = 0;
if( stristr($_POST['pass'], "'") || stristr($_POST['pass'], '"') || stristr($_POST['usr'], "'") || stristr($_POST['usr'], '"'))
{
WriteHead('phpLogCon :: ' , _MSGAccDen, '', '', _MSGAccDen, 0);
print '<br><b>..:: ' . _MSGNamInvChr . ' ::..</b><br>';
echo '<br>..:: <a href="index.php">', _MSGBac2Ind, '</a> ::..';
db_close($global_Con);
exit;
}
else
{
$query = "SELECT UserIDText, Password FROM Users WHERE UserIDText LIKE '" . $_POST['usr'] . "' AND Password LIKE '" . $_POST['pass'] . "'";
$result = db_exec($global_Con, $query);// or die(db_die_with_error(_MSGInvQur . " :" . $query));
$num = db_num_rows($result);
$result = db_fetch_singleresult($result);
/*
echo $num . "<br>";
echo $result["UserIDText"] . "<br>";
echo $result["phplogcon_lastlogin"] . "<br>";
exit;
*/
if ($num == 0)
{
WriteHead("phpLogCon :: " . _MSGAccDen, "", "", _MSGAccDen, 0);
print "<br><b>..:: " . _MSGFalLog . " ::..</b><br>";
echo "<br>..:: <a href='index.php'>" . _MSGBac2Ind . "</a> ::..";
db_close($global_Con);
exit;
}
else
{
// $dat = now();
// db_exec($global_Con, "UPDATE users SET phplogcon_lastlogin = ".dbc_sql_timeformat($dat)." WHERE UserIDText LIKE '".$_POST["usr"]."'");
session_register('save_cookies');
if($_POST['save_cookies'] == 1)
{
$_SESSION['save_cookies'] = $_POST['save_cookies'];
setcookie("valid", 1, _COOKIE_EXPIRE, "/");
setcookie("usr", $result["UserIDText"], _COOKIE_EXPIRE, "/");
}
else
$_SESSION['save_cookies'] = 0;
session_register("usr");
$_SESSION["usr"] = $result["UserIDText"];
LoadUserConfig();
// Loading Users Config when enabled
if($_SESSION['savefiltersettings'])
LoadFilterConfig();
db_close($global_Con);
header("Location: index.php");
}
}
?>

143
user-config-process.php Normal file
View File

@ -0,0 +1,143 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
include 'include.php';
// General variables
$szRedirectLink = "";
$szDescription = "";
if( !isset($_POST['userConfig']) )
$_POST['userConfig'] = "";
if($_POST['userConfig'] == "UserConfiguration")
{
/*!
* Update language setting
!*/
if ((eregi("^[a-z]+$", $_POST['language'])) and (strlen($_POST['language']) == 2))
$_SESSION['language'] = $_POST['language'];
else
$_SESSION['language'] = 'en'; // default
/*!
* Update style setting
!*/
if ((eregi("^[a-z]+$", $_POST['stylesheet'])))
$_SESSION['stylesheet'] = $_POST['stylesheet'];
else
$_SESSION['stylesheet'] = 'phplogcon'; // default
/*!
* Update debug setting
!*/
$_SESSION['debug'] = (isset($_POST['debug'])) ? 1 : 0;
/*!
* Update filter save setting
!*/
$_SESSION['savefiltersettings'] = (isset($_POST['savefiltersettings'])) ? 1 : 0;
if(_ENABLEUI == 1)
{
//Save filter settings to database
$query = GetUserConfigArray();
for($i = 0; $i < count($query); $i++)
db_exec($global_Con, $query[$i]);
}
}
elseif($_POST['bookmarkConfig'] == "BookmarkDelete")
{
$delstr = explode("//", $_POST["favorites"]);
$result = db_exec($global_Con, "SELECT UserLogin, PropValue FROM UserPrefs WHERE UserLogin LIKE '" . $_SESSION["usr"] . "' AND Name LIKE 'PHPLOGCON_favorites'");
$result = db_fetch_singleresult($result);
$result = explode(",", $result["PropValue"]);
$rowcntr = count($result);
for($i = 0; $i < $rowcntr ; $i++)
{
if(stristr($result[$i], $delstr[1]))
$delval = $i;
}
$delstr = "";
for($j = 0; $j < $rowcntr ; $j++)
{
if($j == $delval)
continue;
else
{
if($rowcntr == 2 || $j == ($rowcntr - 1))
$delstr .= $result[$j];
else
$delstr .= $result[$j] . ",";
}
}
db_exec($global_Con, "UPDATE UserPrefs SET PropValue='" . $delstr . "' WHERE UserLogin LIKE '" . $_SESSION["usr"] . "' AND Name LIKE 'PHPLOGCON_favorites'");
db_close($global_Con);
}
elseif($_POST['bookmarkConfig'] == "BookmarkAdd")
{
if( stristr($_POST["sitename"], "'") || stristr($_POST["sitename"], "&quot;") || stristr($_POST["url"], "'") || stristr($_POST["url"], "&quot;"))
$szDescription = _MSGSitInvChr;
else
{
$addstr = explode("http://", $_POST["url"]);
if(isset($addstr[1]))
$addstr[0] = $addstr[1];
$result = db_exec($global_Con, "SELECT UserLogin, PropValue FROM UserPrefs WHERE UserLogin LIKE '" . $_SESSION["usr"] . "' AND Name LIKE 'PHPLOGCON_favorites'");
$result = db_fetch_singleresult($result);
if($result["PropValue"] == "")
$addstr[0] = $result["PropValue"] . $addstr[0] . "|" . $_POST["sitename"];
else
$addstr[0] = $result["PropValue"] . "," . $addstr[0] . "|" . $_POST["sitename"];
db_exec($global_Con, "UPDATE UserPrefs SET PropValue='" . $addstr[0] . "' WHERE UserLogin LIKE '" . $_SESSION["usr"] . "' AND Name LIKE 'PHPLOGCON_favorites'");
db_close($global_Con);
}
}
$szRedirectLink = "user-config.php";
$szDescription = "Your Personal user settings have been updated";
?>
<html>
<head>
<?php
echo "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=".$szRedirectLink."\">";
?>
</head>
<title>Redirecting</title>
<Body>
<br><br><br><br>
<center>
<?php
echo "<h3>".$szDescription."</h3><br><br>";
echo "You will be redirected to <A HREF=\"$szRedirectLink\">this page</A> in 1 second.";
?>
</center>
</body>
</html>

177
user-config.php Normal file
View File

@ -0,0 +1,177 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2003 Adiscon GmbH
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.
If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit
http://www.phplogcon.com.
This Project was intiated and is maintened by Rainer Gerhards <rgerhards@hq.adiscon.com>. See AUTHORS to learn who helped make
it become a reality.
*/#### #### #### #### #### #### #### #### #### ####
require("include.php");
WriteStandardHeader(_MSGUsrConf);
?>
<br>
<form method="POST" action="user-config-process.php" name="UserConfiguration">
<input type="hidden" name="userConfig" value="UserConfiguration">
<center><h3>..:: <?php echo _MSGUsrSet; ?> ::..</h3></td></center>
<center>
<table border="" cellpadding="2" cellspacing="0" width="700" align="center" Class="ConfigTable">
<tr>
<td colspan="2" Class="Header1">
<?php echo _MSGSty; ?>:
</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td><?php echo _MSGStyle;?></td>
<td>
<Select name="stylesheet">
<option value="phplogcon" <?php if($_SESSION['stylesheet'] == "phplogcon") echo 'selected'; ?>>phpLogCon</Option>
<option value="matrix" <?php if ($_SESSION['stylesheet'] == "matrix") echo 'selected'; ?>>Matrix</Option>
</Select>
</td>
</tr>
<tr>
<td><?php echo _MSGLang;?></td>
<td>
<Select name="language">
<option value="en" <?php if($_SESSION['language'] == "en") echo 'selected'; ?>><?php echo _MSGEn; ?></Option>
<option value="de" <?php if ($_SESSION['language'] == "de") echo 'selected'; ?>><?php echo _MSGDe; ?></Option>
</Select>
</td>
</tr>
<?php
if(_ENABLEUI == 1)
{
?>
<tr>
<td colspan="2" Class="Header1">
<?php echo _MSGSave; ?>
</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td><?php echo _MSGFilSave1;?></td>
<td>
<input type=checkbox name="savefiltersettings" value="1" <?php if ($_SESSION['savefiltersettings'] == 1) echo 'checked'?>><?php echo _MSGFilSave2;?><br>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="2" Class="Header1">
<?php echo _MSGAddInfo; ?>
</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td><?php echo _MSGDebug1;?></td>
<td>
<input type=checkbox name="debug" value="1" <?php if ($_SESSION['debug'] == 1) echo 'checked'?>><?php echo _MSGDebug2;?><br>
</td>
</tr>
</table>
<input type="submit" name="form" value="Update Config">
</form>
</center>
<form method="POST" action="user-config-process.php" name="BookmarkConfiguration">
<input type="hidden" name="bookmarkConfig" value="BookmarkDelete">
<center>
<table border="0" cellpadding="2" cellspacing="0"" width="700" align="center" Class="ConfigTable">
<?php
if(_ENABLEUI == 1)
{
?>
<tr>
<td Class="Header1">
Bookmarks:
</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td width="200" nowrap><?php echo _MSGFav; ?></td>
<td width="100%">
<?php
//Field 'UserID' is selected, because the odbc_fetch_array function has a bug.
//If you select only one field, you will get only empty strings in your array.
//So 'UserID' is only selected to solve this bug!
$result = db_exec($global_Con, "SELECT UserLogin, PropValue FROM UserPrefs WHERE UserLogin LIKE '" . $_SESSION["usr"] . "' AND Name LIKE 'PHPLOGCON_favorites'");
$num = db_num_rows($result);
$result = db_fetch_singleresult($result);
if($num != 0)
{
echo '<select name="favorites">';
$sites = explode(",", $result["PropValue"]);
$sitecntr = count($sites);
for($i = 0; $i < $sitecntr; $i++)
{
$site = explode("|", $sites[$i]);
echo "<option value='http://" . $site[0] . "'>" . $site[1] . "</option>";
}
echo '</select>';
echo "\t<input type=\"button\" value=\"Go to\">\t";
echo "\t<input type=\"submit\" value=\"" . _MSGDel . "\">\t";
echo "Sorry, GoTo Site is disabled at the moment!";
}
else
echo _MSGNoFav
?>
</form>
<form method="POST" action="user-config-process.php" name="BookmarkConfiguration">
<input type="hidden" name="bookmarkConfig" value="BookmarkAdd">
</td>
</tr>
<tr>
<td><?php echo _MSGNewFav; ?>: </td>
<td>
<?php echo _MSGSiten; ?>: <input type="text" name="sitename" size="25"><br>
URL: <input type="text" name="url" size="30">
<input type="submit" name="form" value="Add Bookmark">
</td>
</tr>
<?php
}
?>
</table>
</form>
</center>
<?php
WriteFood();
?>