Initial Remove of all Version 1 files. Version 2 will be a total rewrite.

This commit is contained in:
Andre Lorbach 2008-02-22 14:38:39 +01:00
parent 447b37415b
commit 15badef15f
68 changed files with 0 additions and 8045 deletions

View File

@ -1,633 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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 $GroupBy; //!< Grouping Argument
var $Sort; //!< Ascending/Descending
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()
{
}
/*!
* 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()
{
$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 like '".db_get_wildcut().$_SESSION['filhost'].db_get_wildcut()."'";
}
$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']))
{
// 2005-12-01 by therget:
// expanded search function, allows to search more than one searchstring per query
// start --->
$SearchMsgArray = explode(" ", $_SESSION['searchmsg']);
$SearchMsgCounter = 0;
foreach($SearchMsgArray as $SearchMsgValue)
{
$tmpSQL.=" AND Message LIKE '".db_get_wildcut().$SearchMsgValue.db_get_wildcut()."'";
$SearchMsgCounter++;
}
// <--- end
}
}
$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($whereMode)
{
//Mode 0 => I.e for events-display
if($whereMode == 0)
{
$this->SQLWherePart = $this->GetSQLWhereTime().$this->GetSQLWhereInfoUnit().$this->GetSQLWherePriority().$this->GetSQLWhereHost().$this->GetSQLWhereMsg();
}
elseif($whereMode == 1)
{
$this->SQLWherePart = $this->GetSQLWhereTime().$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;
}
function GetSysLogTagSQLSort()
{
$this->OrderBy = $_SESSION['tag_order'];
switch ($this->OrderBy)
{
case "SysLogTag":
$tmpSQL = ' ORDER BY SysLogTag ' . $_SESSION['tag_sort'];
break;
case "Occurences":
$tmpSQL = ' ORDER BY occurences ' . $_SESSION['tag_sort'];
break;
case "Host":
$tmpSQL = ' ORDER BY FromHost ' . $_SESSION['tag_sort'];
break;
default:
$tmpSQL = ' ORDER BY SysLogTag ' . $_SESSION['tag_sort'];
break;
}
return $tmpSQL;
}
function SetSQLGroup($groupBy)
{
$this->GroupBy = $groupBy;
}
function GetSQLGroup()
{
switch($this->GroupBy)
{
case "SysLogTag":
$tmpSQL = " GROUP BY SysLogTag";
break;
case "SysLogTagHost":
$tmpSQL = " GROUP BY SysLogTag, FromHost";
break;
default:
$tmpSQL = " GROUP BY SysLogTag";
break;
}
return $tmpSQL;
}
}
?>

View File

@ -1,174 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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']."?pagenum=".($this->GetPageNumber()-1)."&" . $url_query . "\" class=\"searchlink\"> &laquo; </a>";
$this->NavigationFirstPage = "<a href=\"" .$_SERVER['PHP_SELF']."?pagenum=1&" . $url_query . "\" 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']."?pagenum=".($this->GetPageNumber()+1)."&" . $url_query . "\" class=\"searchlink\"> &raquo; </a>";
$this->NavigationLastPage = "<a href=\"" .$_SERVER['PHP_SELF']."?pagenum=".$page. "&" . $url_query . "\" 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");
if(isset($_GET['slt']))
$url_para = "slt=" . $_GET['slt'];
$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']."?pagenum=".$a."&" . $url_para . "\" 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));
$row = db_fetch_array($result);
$num = db_num_rows($result);
// If you have a group clause in your query, the COUNT(*) clause doesn't
// calculates the grouped rows; you get the number of all affected rows!
// db_num_rows() gives the correct number in this case!
if($num <= 1)
$this->EventCount = $row['num']; //so many data records were foundy
else
$this->EventCount = $num;
}
//! returns the total number of available events
function GetEventCount()
{
return $this->EventCount;
}
function SetPageNumber($val)
{
$this->PageNumber = $val;
}
}
?>

View File

@ -1,163 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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', 'MonitorWareUser');
// Password for database connection ***
define('_DBPWD', 'UsersPassword');
// 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 the Header (image/introduce sentence) will be used! Set 0 to disable it.
define('_ENABLEHEADER', 1);
//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, indicates if the records are stored in utc time
define('_UTCtime', 1);
// Show localtime, indicates if the records should be displayed in local time or utc time
define('_SHOWLocaltime', 1);
// Time format
define('_TIMEFormat', 'Y-m-d H:i:s');
// Get messages date by ReceivedAt or DeviceReportedTime
define('_DATE', 'ReceivedAt');
// Coloring priority
define('_COLPriority', 1);
// Custom Admin Message (appears on the homepage)
define('_AdminMessage', "");
// Version Number
define('_VersionMajor', "1");
define('_VersionMinor', "2");
define('_VersionPatchLevel', "3");
/*
***** 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));
?>

View File

@ -1,77 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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['databaseConfig']) )
$_POST['databaseConfig'] = "";
if($_POST['databaseConfig'] == "DatabaseConfiguration")
{
/*!
* Update database name setting
!*/
if ($_POST['database'] != "")
$_SESSION['database'] = $_POST['database'];
else
$_SESSION['database'] = _DBNAME;
}
$szRedirectLink = "database-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>

View File

@ -1,76 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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(_MSGdatabaseConf);
?>
<br>
<form method="POST" action="database-config-process.php" name="DatabaseConfiguration">
<input type="hidden" name="databaseConfig" value="DatabaseConfiguration">
<table align="center"><tr><td><h3>..:: <?php echo _MSGdatabaseSet; ?> ::..</h3></td></tr></table>
<center>
<table border="" cellpadding="2" cellspacing="0" width="400" align="center" Class="ConfigTable">
<tr>
<td colspan="2" Class="Header1">
<?php echo _MSGdatabaseSet; ?>
</td>
</tr>
<tr>
<td><?php echo _MSGdatabaseChoose; ?></td>
<td align = "center">
<?php
$db_list = db_exec($global_Con, 'SHOW DATABASES');
echo "<Select name=\"database\">";
while ($row = db_fetch_array($db_list))
{
$status_selected = '';
if($_SESSION['database'] == $row['Database'])
{
$status_selected = ' selected';
}
echo "<option value=\"".$row['Database']."\"".$status_selected.">".$row['Database']."</Option>";
}
echo "</Select>";
?>
</td>
</table>
<br>
<input type="submit" name="form" value="Update Config">
</form>
</center>
<?php
WriteFooter();
?>

View File

@ -1,217 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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)
{
if (defined('_UTCtime') && _UTCtime)
{
$times = GetUTCtime($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()
{
if (!isset($_SESSION['database']))
{
$_SESSION['database'] = _DBNAME;
}
$db = mysql_connect(_DBSERVER, _DBUSERID, _DBPWD) or db_die_with_error(_MSGNoDBCon);
mysql_select_db($_SESSION['database']) 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);
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);
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);
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, $order)
{
$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_get_tables($dbCon, $dbName)
{
$query = "SHOW TABLES FROM " . $dbName;
return mysql_query($query);
}
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 '%';
}
?>

View File

@ -1,209 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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)
{
if (defined('_UTCtime') && _UTCtime)
{
$timestamp = GetUTCtime($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()
{
if (!isset($_SESSION['database']))
{
$_SESSION['database'] = _DBNAME;
}
return odbc_connect($_SESSION['database'], _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)
{
return odbc_fetch_array($res);
}
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)
{
if(stristr($cmdSQLwhere_part, "order by") != FALSE)
return 'SELECT DISTINCT COUNT(*) AS num FROM ' . _DBTABLENAME . substr($cmdSQLwhere_part, 0, strpos($cmdSQLwhere_part, 'ORDER BY'));
else
return 'SELECT DISTINCT COUNT(*) AS num FROM ' . _DBTABLENAME . $cmdSQLwhere_part;
}
// This function is for getting the correct row count! db_num_rows is BUGGED! >_<
// THX to 'deejay_' from PHP.net for this function!
function odbc_record_count($odbcDbId, $query)
{
$countQueryString = "SELECT COUNT(*) as results FROM (" . $query . ")";
// echo $countQueryString;
$count = odbc_exec ($odbcDbId, $countQueryString);
$numRecords = odbc_result ($count, "results");
return $numRecords;
}
/*
* 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, $order)
{
//Because ODBC doesn't know LIMIT we have to do it with subselects
if(strtolower($order) == "date")
$order = _DATE;
elseif(strtolower($order) == "host")
$order = "[FromHost]";
elseif(strtolower($order) == "facilitydate")
$order = "[Facility], [" . _DATE . "]";
elseif(strtolower($order) == "prioritydate")
$order = "[Priority], [" . _DATE . "]";
else
$order = "[" . $order . "]";
//now we have to check in wich order the results will be listed.
//we have to fit our query to this.
if( stristr(strtolower($cmdSQLwhere_part), "desc") == FALSE)
{
$sort1 = "DESC";
$sort2 = "ASC";
}
else
{
$sort1 = "ASC";
$sort2 = "DESC";
}
//now the big statement will be created! Have fun! ;)
$tmp = $perpage + $limitlower - 1;
$cmdSQL = "SELECT * FROM ( SELECT TOP " . $perpage . " * FROM ( " . $cmdSQLfirst_part . "TOP " . $tmp . " " . $cmdSQLmain_part . $cmdSQLwhere_part . " ) AS blub ORDER BY " . $order . " " . $sort1 . " ) AS blubblub ORDER BY " . $order . " " . $sort2;
// echo $cmdSQL . "<br>";
return db_exec($db, $cmdSQL);
}
function db_free_result($result)
{
return odbc_free_result($result);
}
function db_get_tables($dbCon, $dbName)
{
return odbc_tables($dbCon);
}
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 '%';
}
?>

View File

@ -1,205 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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)
{
if (defined('_UTCtime') && _UTCtime)
{
$times = GetUTCtime($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()
{
if (!isset($_SESSION['database']))
{
$_SESSION['database'] = _DBNAME;
}
return odbc_connect($_SESSION['database'], _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)
{
return odbc_fetch_array($res);
}
/*
* 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, $order)
{
$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_get_tables($dbCon, $dbName)
{
return odbc_tables($dbCon);
}
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 '%';
}
?>

View File

@ -1,168 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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)
{
if (isset(_UTCtime) && _UTCtime)
{
$timestamp = GetUTCtime($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()
{
if (!isset($_SESSION['database']))
{
$_SESSION['database'] = _DBNAME;
}
return odbc_connect($_SESSION['database'], _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 '*';
}
?>

View File

@ -1,283 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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");
if( !isset($_GET['lid']) )
{
header("Location: events-display.php");
exit;
}
WriteStandardHeader(_MSGShwEvnDet);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<br /><a href="<?php 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=<?php 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);
}
}
// by therget - for renaming of severity states
// --->
function SeverityText($severity)
{
switch ($severity) //Severity
{
case 0:
$severity_txt = 'EMERGENCY';
break;
case 1:
$severity_txt = 'ALERT';
break;
case 2:
$severity_txt = 'CRITICAL';
break;
case 3:
$severity_txt = 'ERROR';
break;
case 4:
$severity_txt = 'WARNING';
break;
case 5:
$severity_txt = 'NOTICE';
break;
case 6:
$severity_txt = 'INFO';
break;
case 7:
$severity_txt = 'DEBUG';
break;
default:
die('Error Invalid Severity number!');
}
return ($severity_txt);
}
// <---- end
// backgroundcolor regarding severity state
$severity = SeverityText($row['Priority']);
if ($severity == "EMERGENCY")
{
$class = "CLASS=PriorityEmergency";
}
elseif ($severity == "ALERT")
{
$class = "CLASS=PriorityAlert";
}
elseif ($severity == "CRITICAL")
{
$class = "CLASS=PriorityCritical";
}
elseif ($severity == "ERROR")
{
$class = "CLASS=PriorityError";
}
elseif ($severity == "WARNING")
{
$class = "CLASS=PriorityWarning";
}
elseif ($severity == "NOTICE")
{
$class = "CLASS=PriorityNotice";
}
elseif ($severity == "INFO")
{
$class = "CLASS=PriorityInfo";
}
elseif ($severity == "DEBUG")
{
$class = "CLASS=PriorityDebug";
}
$importance = $row['Importance'];
?>
<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 <?php echo $class ?> ><?php echo $severity ?></td></tr>
<tr><td CLASS=TDHEADER><?php echo "SysLogTag"; ?></td><td CLASS=TD1><?php echo $row['SysLogTag']; ?></td></tr>
<?php
if ($importance != "")
{
echo "<tr><td CLASS=TDHEADER>", _MSGImp," </td><td CLASS=TD2> $importance </td></tr>";
}
?>
</table>
<?php
echo "</table>";
WriteFooter();
?>

View File

@ -1,44 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: Credits</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META http-equiv="pragma" CONTENT="no-cache">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">5. Credits</a></h2>
<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>Additional developers:</p>
<ul>
<li>Andreas Hofmann <a href="mailto:(utg-man@gmx.de">(utg-man@gmx.de</a>)</li>
</ul>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -1,64 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: Design Goals</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">1. Design Goals</a></h2>
<ul>
<li><a href="#1_1">1.1 Main Usage Points</a></li>
<li><a href="#1_2">1.2 Portability</a></li>
</ul>
<br>
<p>PhpLogCon 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>
<h3><a name="1_1">1.1 Main Usage Points</a></h3>
<p>phpLogCon is primarily being used for</p>
<ul>
<li>quick overview over current system activity</li>
<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>
<small><a href="#top">[Top]</a></small>
<h3><a name="1_2">1.2 Portability</a></h3>
<p>phpLogCon is being implemented as a set of PHP scripts to ensure
portability between different platforms. Target platforms for phpLogCon
are:</p>
<ul>
<li>Windows with IIS</li>
<li>Windows with Apache</li>
<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>
<li>Microsoft Jet (aka Access, via ODBC)</li>
<li>MySQL (via ODBC and via native classes)<br>
<b>Note: Native mysql is recommended for the best performance!</b></li>
</ul>
<p>Of course, other database systems can most likely be used with 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).</p>
<small><a href="#top">[Top]</a></small>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -1,54 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: Developer Notes</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">6. Developer notes</a></h2>
<ul>
<li><a href="#6_1">6.1 General Database Connection Functions</a></li>
<li><a href="#6_2">6.2 ODBC Connection functions</a></li>
<li><a href="#6_3">6.3 Include Files</a></li>
</ul>
<br>
<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>
<h3><a name="6_1">6.1 General database connection functions</a></h3>
<p>The database functions in phpLogCon are called similar to well-know commands from e.g. php mysql functions. All database functions start 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>
<small><a href="#top">[Top]</a></small>
<h3><a name="6_2">6.2 ODBC functions</a></h3>
<p>phpLogCon support also database connection via ODBC. You can find the functions in 'db-drv\odbc_mssql.php' and 'db-drv\odbc_mysql.php'. Like you can see, there are two different drivers for ODBC. That's because the syntax of MySql and MsSql are different. 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>
<h4>Known Issues</h4>
<p>At the moment you can only use ODBC for query Microsoft databases like MSSQL, etc and for MySql. A second database layer which can handle different sql formats should be implemented in the future!</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="6_3">6.3 Include files</a></h3>
<h4>include.php</h4>
<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>
<h4>config.php</h4>
<p>Here are the whole config of phpLogCon saved. It is included already by include.php, so you don't have to include it separately. If you want to set a new config variable, do it here! But if you only want to set a default variable for a variable, anywhere in the script, so do it there or in include.php! Config.php is only for global configuration variables with it's default values.</p>
<small><a href="#top">[Top]</a></small>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -1,49 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: Getting Started</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">2. Getting Started</a></h2>
<ul>
<li><a href="#2_1">2.1 Minimum Requirements</a></li>
</ul>
<br>
<p>Getting started with phpLogCon is just a few simple steps:</p>
<ul>
<li>make sure your system meets the minimum requirements</li>
<li>extract the archive to a proper location</li>
<li>" after setup, point your browser to the root of the phpLogCon (If that doesn't work, point to 'index.php' in the root directory)</li>
</ul>
<h3><a name="2_1">2.1 Minimum Requirements</a></h3>
<p>The minimum requirements of your hardware are given by your database server application. The software requirements for phpLogCon meet the following:</p>
<ul>
<li>A running database server, at best one of the with phpLogCon has been tested (see 1.2 for more information)</li>
<li>A database, i.e. created by MonitorWare Agent, for logging information</li>
</ul>
<small><a href="#top">[Top]</a></small>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -1,72 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: Release History</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">7. Release History</a></h2>
<p>2007-03-26
<li>Missing logout link while logged in without cookies fixed.</li>
</p>
<p>2006-04-12
<li>Minor fixes in user module.</li>
<li>Database Options does not work correctly other databases than MySQL in native mode. This is fixed now.</li>
<li>Some modifications on the "Message in the future" check in order to fix some minor issues. </li>
<li>Displaying local time even if the data is stored in utc time is supported now. </li>
<li>Time format is configurable now. See config.php. </li>
<li>Manual updated.</li>
</p>
<p>2006-02-06
<li>Improved "Search only for IP". Filtering for subnets is now possible. E.g. to show all 172.19.*.* addresses, simply enter "172.19." (without the quotes) into search field.
</li>
</p>
<p>2005-12-12
<li>Fixed a security bug in user login validation.
</li>
</p>
<p>2005-12-05
<li>"Message must contain" filter enhanced. Filtering for multiple words (seperated by spaces) is supported now.
</li>
<li>New page database options. Using the "Database Options" (see link in menu) changing the database to use is possible during runtime.
</li>
<li>Status info which database is in use was added on start page.
</li>
<li>The version number was not correctly took on from install script. This bug is fixed.
</li>
<li>Fixed a table style bug which caused an oddly look of some tables.
</li>
</p>
<p>2005-09-26
<li>Removed semicolon at the end of the query, because this is not supported by mysql<br />
file: scripts\mysql_ct*.sql
</li>
<li>Added version number variables<br />
file: scripts\config.php.ex
</li>
</p>
<p>2003-03-05&nbsp;&nbsp;&nbsp; Actual project was started</p>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -1,91 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: Index</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META http-equiv="pragma" CONTENT="no-cache">
<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>
<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">1. Design Goals</a>
<ul>
<li><a href="design.htm#1_1">1.1 Main Usage Points</a></li>
<li><a href="design.htm#1_2">1.2 Portability</a></li>
</ul>
</li>
<li>
<a href="getting-started.htm">2. Getting Started</a>
<ul>
<li><a href="getting-started.htm#2_1">2.1 Minimum Requirements</a></li>
</ul>
</li>
<li>
<a href="setup.htm">3. phpLogCon Setup</a>
<ul>
<li><a href="setup.htm#3_1">3.1 Configuration Settings</a></li>
</ul>
</li>
<li>
<a href="using.htm">4. Using The Web Interface</a>
<ul>
<li><a href="using.htm#4_1">4.1 General Concepts</a></li>
<li><a href="using.htm#4_2">4.2 Overall Event Filter</a></li>
<li><a href="using.htm#4_3">4.3 Page Layout</a></li>
<li><a href="using.htm#4_4">4.4 HomePage/Index</a></li>
<li><a href="using.htm#4_5">4.5 Show Events</a></li>
<li><a href="using.htm#4_6">4.6 Show SysLogTags</a></li>
<li><a href="using.htm#4_7">4.7 Details</a></li>
<li><a href="using.htm#4_8">4.8 Filter Options</a></li>
<li><a href="using.htm#4_9">4.9 User Options</a></li>
<li><a href="using.htm#4_10">4.10 Database Options</a></li>
<li><a href="using.htm#4_11">4.11 Refresh</a></li>
</ul>
</li>
<li>
<a href="credits.htm">5. Credits</a>
</li>
<li>
<a href="developer-notes.htm">6. Developer notes</a>
<ul>
<li><a href="developer-notes.htm#6_1">6.1 General Database Connection Functions</a></li>
<li><a href="developer-notes.htm#6_2">6.2 ODBC Connection functions</a></li>
<li><a href="developer-notes.htm#6_3">6.3 Include Files</a></li>
</ul>
</li>
<li>
<a href="history.htm">7. Release history</a>
</li>
<li>
<a href="license.htm">8. License</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="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -1,37 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: License</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META http-equiv="pragma" CONTENT="no-cache">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">8. License</a></h2>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>If you have questions about phpLogCon in general, please email info@adiscon.com. To learn more about phpLogCon, please visit <a href="http://www.phplogcon.com" target="_blank">www.phplogcon.com</a>.</p>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

View File

@ -1,45 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: phpLogCon Setup</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META http-equiv="pragma" CONTENT="no-cache">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">3. phpLogCon Setup</a></h2>
<ul>
<li><a href="#3_1">3.1 Configuration Settings</a></li>
</ul>
<br>
<p>For an installing that runs on every operating system, we created a 'install.php', that you will find in phpLogCon/install. You only have to point to install/install.php in your browser! The Installation-Assistant will guide you through the installation.</p>
<p>Note: Don't forget to delete whole 'install/' directory! Also remember, that the user who runs the web server (i.e. www-data) must have 'write'-rights (chmod 666) on the 'config.php'! Remove these rights after installing (chmod 644)!</p>
<h3><a name="3_1">3.1 Configuration Settings</a></h3>
<h4>Config.php</h4>
<p>The setup created a 'config.php' in the root directory. This file contains all info you have entered at the install process. Here you can alter the 'config.php' every time you want to your need.</p>
<h4>phplogcon.ini</h4>
<p>You will find a file named 'phplogcon.ini' in the root directory. Here you can set some external information. For now, there is only the 'wordsdontshow'-function available. Here you can enter some words, followed by a separator. These words will be hided in events display and details.</p>
<small><a href="#top">[Top]</a></small>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

View File

@ -1,205 +0,0 @@
<html>
<head>
<title>phpLogCon Manual :: Using The Web Interface</title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META http-equiv="pragma" CONTENT="no-cache">
<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>
<p><small><a href="index.htm">[Doc Home]</a></small></p>
<h2><a name="top">4. Using the Web Interface</a></h2>
<ul>
<li><a href="#4_1">4.1 General Concepts</a></li>
<li><a href="#4_2">4.2 Overall Event Filter</a></li>
<li><a href="#4_3">4.3 Page Layout</a></li>
<li><a href="#4_4">4.4 HomePage/Index</a></li>
<li><a href="#4_5">4.5 Show Events</a></li>
<li><a href="#4_6">4.6 Show SysLogTags</a></li>
<li><a href="#4_7">4.7 Details</a></li>
<li><a href="#4_8">4.8 Filter Options</a></li>
<li><a href="#4_9">4.9 User Options</a></li>
<li><a href="#4_10">4.10 Refresh</a></li>
</ul>
<br>
<h3><a name="4_1">4.1 General concepts</a></h3>
<p>phpLogCon is designed to give you fast access to your desired information with a high controllable output/filtering. The whole solution is build for good viewing, fast finding that, what you want and to give you full access to the information.</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_2">4.2 Overall Event Filter</a></h3>
<p>All processing done by phpLogCon is relative to a user-selected filter. That is, only events that match the applicable filter condition will be shown.</p>
<p>There are two types of filters in phpLogCon:</p>
<h4>General Filters:</h4>
<p>These filters can always be set on the Filer Options page. You can reach them through a link on top of each web page. These settings will be saved in the session. So when the session expired, however the filter settings will be default next time. In User Interface mode they will be saved in database for each user. That provides on each logon or opening phpLogCon gettin your personal filter settings.</p>
<p>General Filters are:</p>
<ul>
<li>Event's Date - The time when the event occurred</li>
<li>Order by - Also you can order the events, in which order they should appear in Events Display</li>
<li>Refresh - Not that a filter setting, but it can be set in which distance a page should be refreshed. Note that it has effect on all pages!</li>
<li>InfoUnits - The Units, where the event had been logged (i.e. EventReporter or SysLog)</li>
<li>Severity - Filtered by Severity of an event</li>
</ul>
<h4>SysLogTag Filter Conditions:</h4>
<p>
</p>
<p>SysLogTag Filters are:</p>
<ul>
<li>Order by Occurences or Syslogtag</li>
<li>Order Ascending or Descending</li>
</ul>
<h4>Quick Filters:</h4>
<p>Quick Filters provide the General Filters and can be set in Events Display. They will override the general filters while staying in Events Display. They provide you quick changes for temporally viewing different and little bit fine filtered events, without changing your general filter settings.</p>
<p>Quick Filters are:</p>
<ul>
<li>Logs per page - How many logs should be displayed per page</li>
<li>Search for IP/Host - You can filter out one Host or IP</li>
<li>Message must contain - The message must contain the specified string</li>
<li>Color an Expression - Searching for an regular expression and color it in specified color</li>
</ul>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_3">4.3 Page Layout</a></h3>
<p>Every page will follow a standard layout. It has three areas
<ul>
<li>header</li>
<li>main work area</li>
<li>footer</li>
</ul>
<p>The <b>header</b> holds the top menu items and the current date and time. It also holds:</p>
<ul>
<li>On enabled user interface, the currently logged in user</li>
<li>On enabled user interface, a link to logout the user</li>
<li>When enabled, some debug information about the current database settings</li>
</ul>
<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 & links to homepage of phpLogCon and Adiscon</li>
</ul>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_4">4.4 Homepage/Index</a></h3>
<p>The main work area of the home displays statistical information:
<ul>
<li>Number of syslog events</li>
<li>Number of event log events</li>
<li>Top 5 devices reporting</li>
</ul>
<p>Of course, all of this in respect to the current filter.</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_5">4.5 Show Events</a></h3>
<p>Here you can see the events; listed in respect to the current filter settings. Also you can use the quick filter, that allows you to override (not overwrite!) temporally your current filter settings. This provides a quick view on different filtered events, without going to the filter options. You can also choose how much event's should be displayed per page, color and search for an expression and search for a Host or IP.</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_6">4.6 Show SysLogTags</a></h3>
<p>This page is especially created for watching the different SysLogTags. Here you can see all different SysLogTags, those appear in database with occurrences in database and sample message.</p>
<p>It brings you two new quick filters to filter and order the SysLogTags for fine-tuning:</p>
<h4>Display SysLogTags</h4>
<p>In this drop-down menu you can choose between <b>'Syslog'</b>, that will show you all Syslogs those appear in database with a sample message and <b>'SysLog corresponding to host'</b>, what will show you every SysLogTag that appeared on each Host.</p>
<h4>Order by</h4>
<p>You can order the Events ascending or descending by SysLogTag, Occurrences or Hosts, who have send this SysLogTag.</p>
<p>When you click on the example message, you'll get listed all occurrences of this SysLogTag. They're listed under respect of overall filter settings!</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_7">4.7 Details</a></h3>
<p>You can reach the details through clicking on an events message. This page will give you full information about the selected event. Also you have direct links to the MonitorWare event reference and google groups to get additional information.</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_8">4.8 Filter Options</a></h3>
<p>The filter options allow the user to specify filters important for output of the events. Which overall filters are available is listed above under point 4.2. For optimizing the events display you can choose which quick filter should be displayed. Also there are filters for the SysLogTag page. You can choose how they should be order and corresponding to which field, for example occurrences of one Tag.</p>
<p>If User Interface is enabled and the option "Save filter settings in database and load them while logging in" is checked, all filter settings will be saved in database. Otherwise, they only will stay like this in current session!</p>
<p>If User Interface is disabled, the settings will only stay like this in the current session. Next time opening phpLogCon, they will be default.</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_9">4.9 User Options</a></h3>
<p>User options can look in two different versions:</p>
<ul>
<li>User Interface is enabled</li>
<li>User Interface is disabled</li>
</ul>
<p>When User Interface is enabled, there are more settings than in non User Interface mode. The basic settings that are available in both modes are:</p>
<ul>
<li>Style sheet - You can choose a style sheet you like an gives you best viewing</li>
<li>Language - Choose your desired language. Currently English and German is available</li>
<li>Debug - User can switch on/off Debug outputs in the whole script</li>
</ul>
<p>The following settings are only available in User Interface mode:</p>
<ul>
<li>Save filter settings to database - Save filter settings in database and load them on login</li>
<li>Bookmarks - User can add, delete and visit his favorite/usefully homepages</li>
</ul>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_10">4.10 Database Options</a></h3>
<p>Here you can choose the database from a dropdown menu, which phpLogCon should use.</p>
<small><a href="#top">[Top]</a></small>
<h3><a name="4_11">4.11 Refresh</a></h3>
<p>Simply refreshes the page. It's the same as hitting F5 in the most of the browsers.</p>
<small><a href="#top">[Top]</a></small>
<p><small><a href="index.htm">[Doc Home]</a>&nbsp;<a href="http://www.monitorware.com" target="_blank">[MonitorWare Web Site]</a></small></p>
<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="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -1,241 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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';
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'] > 2000)
$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(), $myFilter->OrderBy);
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);
}
$tc = 1;
while($row = db_fetch_array($res))
{
if (db_errno() != 0)
{
echo db_errno() . ': ' . db_error(). '\n';
}
//choose InfoUnitdType 1 = SL => Syslog ; 3 = ER => Eventreporter ; O = O => Other
switch ($row['InfoUnitID'])
{
case 1:
$infounit = 'SL';
break;
case 3:
$infounit = 'ER';
break;
default:
$infounit = 'O';
}
if($row['Message'] == "")
$message = _MSGNoMsg;
else
$message = $row['Message'];
// If date is today, only show the time --->
$current_date = FormatTime($row[_DATE], 'Y-m-d H:i:s');
$now = date("Y-m-d 00:00:00");
$tmp_format = _TIMEFormat;
if ($current_date > $now)
{
$tmp_format = 'H:i:s';
}
// <---
echo '<tr>';
echo '<td CLASS=TD' . $tc . '><nobr>'.FormatTime($row[_DATE], $tmp_format).'</nobr></td>'; //date
echo '<td CLASS=TD' . $tc . '>'.$row['Facility'].'</td>'; //facility
// get the description of priority (and get the the right color, if enabled)
$pricol = 'TD' . $tc;
$priword = FormatPriority($row['Priority'], $pricol);
echo '<td CLASS=', $pricol, '>', $priword, '</td>';
echo '<td CLASS=TD' . $tc . '>'.$infounit.'</td>'; //InfoUnit
echo '<td CLASS=TD' . $tc . '>'.$row['FromHost'].'</td>'; //host
$message = htmlspecialchars($message);
if(isset($_SESSION['regexp']) && $_SESSION['regexp'] != '')
{
$_SESSION['regexp'] = trim($_SESSION['regexp']);
$messageUp = strtoupper($message);
$regexpUp = strtoupper($_SESSION['regexp']);
$search_pos = strpos($messageUp, $regexpUp);
if($search_pos !== FALSE)
{
$regexpLng = strlen($_SESSION['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="' . $_SESSION['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['ID'] , '">', $message, '</a></td>'; //message
//for changing colors
if($tc == 1) $tc = 2;
else $tc = 1;
/*
echo "<td>".$row['Priority']."</td>";
*/
echo '</tr>', "\r\n";
}
echo '</table>';
}
WriteFooter();
?>

View File

@ -1,150 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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;
if( !isset($_POST['filConf']) )
$_POST['filConf'] = "";
if($_POST['filConf'] == "FilterConfig")
{
// configure filter settings
$_SESSION['ti'] = $_POST['ti'];
$_SESSION['order'] = $_POST['order'];
$_SESSION['tag_order'] = $_POST['tag_order'];
$_SESSION['tag_sort'] = $_POST['tag_sort'];
$_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 && $_SESSION['priority_1'] == 0 && $_SESSION['priority_2'] == 0 && $_SESSION['priority_3'] == 0 && $_SESSION['priority_4'] == 0 && $_SESSION['priority_5'] == 0 && $_SESSION['priority_6'] == 0 && $_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>

View File

@ -1,197 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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";
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['tag_order'] = $_SESSION['tag_order_old'];
$_SESSION['tag_sort'] = $_SESSION['tag_sort_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('tag_order_old');
session_unregister('tag_sort_old');
session_unregister('refresh_old');
}
?>
<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="2" 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>
</tr>
<?php /* This is not implemented yet!
<tr>
<td>
<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>
</td>
</tr>
End this is not implemented yet! */ ?>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2" Class="Header1">
<?php echo _MSGSltFil; ?>:
</td>
</tr>
<tr>
<td><?php echo _MSGOrdBy; ?>:</td>
<td>
<?php include _FORMS.'tag-order-by.php'; ?>
</td>
</tr>
<tr>
<td><?php echo _MSGTagSort; ?>:</td>
<td>
<?php include _FORMS.'tag-sort.php'; ?>
</td>
</tr>
<tr>
<td colspan="2" Class="Header1">
<?php echo _MSGEnbQF; ?>:
</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
WriteFooter();
?>

View File

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

View File

@ -1,3 +0,0 @@
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"; ?>>

View File

@ -1,12 +0,0 @@
<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>

View File

@ -1,5 +0,0 @@
<?php
echo '<input type="text" name="filhost" size="30" value="';
echo $_SESSION['filhost'];
echo '">';
?>

View File

@ -1,43 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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>
<option value="500" <?php if ($_SESSION["epp"] == 500) echo "selected"; ?>>500 per page</option>
<option value="1000" <?php if ($_SESSION["epp"] == 1000) echo "selected"; ?>>1000 per page</option>
<option value="2000" <?php if ($_SESSION["epp"] == 2000) echo "selected"; ?>>2000 per page</option>
</Select>

View File

@ -1,124 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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;&nbsp;<?php echo _MSGAnd;?>&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>

View File

@ -1,8 +0,0 @@
<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>

View File

@ -1,10 +0,0 @@
<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>

View File

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

View File

@ -1,4 +0,0 @@
<Select name="show_methode">
<option value="SysLogTag" <?php if ($_SESSION['show_methode'] == 'SysLogTag') echo 'selected'; ?>><?php echo _MSGMethSlt; ?></option>
<option value="Host" <?php if ($_SESSION['show_methode'] == 'Host') echo 'selected'; ?>><?php echo _MSGMethHost; ?></option>
</Select>

View File

@ -1,12 +0,0 @@
<Select name="tag_order">
<option value="Occurences" <?php if ($_SESSION['tag_order'] == "Occurences") echo 'selected'; ?>><?php echo _MSGOccuren; ?></option>
<option value="SysLogTag" <?php if ($_SESSION['tag_order'] == "SysLogTag") echo 'selected'; ?>><?php echo _MSGSysLogTag; ?></option>
<?php
if($_SESSION['show_methode'] == "Host")
{
?>
<option value="Host" <?php if ($_SESSION['tag_order'] == "Host") echo 'selected'; ?>><?php echo _MSGHost; ?></option>
<?php
}
?>
</Select>

View File

@ -1,4 +0,0 @@
<Select name="tag_sort">
<option value="Asc" <?php if ($_SESSION['tag_sort'] == "Asc") echo 'selected'; ?>><?php echo _MSGAscend; ?></Option>
<option value="Desc" <?php if ($_SESSION['tag_sort'] == "Desc") echo 'selected'; ?>><?php echo _MSGDescend; ?></option>
</Select>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -1,836 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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
*/
// enable it only for testing purposes
// error_reporting(E_ALL);
//if (!headers_sent()) { header("Pragma: no-cache"); }
header("Pragma: no-cache");
// very important to include config settings at beginning!
include 'config.php';
session_cache_expire($session_time);
//*** 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_start();
// 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;
/*
* Filtering by ip/host
* if a string for filter host submitted, check this string.
*/
if (isset($_POST['filhost']))
{
$_SESSION['filhost'] = PreStrFromTxt4DB($_POST['filhost']);
}
else
{
if (!isset($_SESSION['filhost']))
$_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']);
}
else
{
if (!isset($_SESSION['searchmsg']))
$_SESSION['searchmsg'] = '';
}
/*
* Color an Expression
*/
if (isset($_POST['regexp']))
{
$_SESSION['regexp'] = $_POST['regexp'];
$_SESSION['color'] = $_POST['color'];
}
else
{
if (!isset($_SESSION['regexp']))
$_SESSION['regexp'] = '';
if (!isset($_SESSION['color']))
$_SESSION['color'] = 'red';
}
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['tag_order_old'] = $_SESSION['tag_order'];
$_SESSION['tag_sort_old'] = $_SESSION['tag_sort'];
$_SESSION['refresh_old'] = $_SESSION['refresh'];
if( isset($_POST['ti']) )
$_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;
if( !isset($_POST['order']) )
{
$_POST['order'] = '';
$_SESSION['tag_order'] = $_POST['tag_order'];
}
else
{
$_POST['tag_order'] = '';
$_SESSION['order'] = $_POST['order'];
}
if( isset($_POST['tag_sort']) )
$_SESSION['tag_sort'] = $_POST['tag_sort'];
$_SESSION['refresh'] = $_POST['refresh'];
if( isset($_POST['show_methode']) )
$_SESSION['show_methode'] = $_POST['show_methode'];
}
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/tag-order-by.php
// validation in eventfilter.php
if (!isset($_SESSION['tag_order']))
$_SESSION['tag_order'] = 'Occurences';
// forms/tag-sort.php
// check sort ascending/descending
if (!isset($_SESSION['tag_sort']))
$_SESSION['tag_sort'] = 'Asc';
// forms/refresh.php
if (!isset($_SESSION['refresh']))
$_SESSION['refresh'] = 0; // default
//syslog-index.php
if( !isset($_SESSION['show_methode']) )
$_SESSION['show_methode'] = "SysLogTag";
// 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';
// --- Added here, the Install direcgtory has to be removed before we do anything else
CheckInstallDir();
// ---
//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***
/*
* 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));
}
/*
* 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");
}
/************************************************************************/
/* 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" )
{
header("Location: index.php");
exit;
}
else
{
session_register('usr');
session_register('usrdis');
$_SESSION['usr'] = $_COOKIE['usr'];
$_SESSION['usrdis'] = $_COOKIE['usrdis'];
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"] != "|") || isset($_SESSION["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);
}
CheckInstallDir();
}
/*!
* 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;
}
function CheckInstallDir()
{
if(file_exists("install/"))
{
echo "<html><head><link rel=\"stylesheet\" href=\"" . _ADLibPathScript . $_SESSION['stylesheet'] .".css\" type=\"text/css\"></head><body><h3><font color=\"red\"><BR><center>" . _MSGInstDir . "</center></font></h3></body></html>";
exit;
}
clearstatcache();
}
/*!
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['tag_order'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_tag_order'";
$query[14] = "UPDATE UserPrefs SET PropValue='" . $_POST['tag_sort'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_tag_sort'";
$query[15] = "UPDATE UserPrefs SET PropValue='" . $_POST['refresh'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_refresh'";
if( !isset($_POST['FilterInfoUnit']) )
$query[16] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterInfoUnit'";
else
$query[16] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterInfoUnit'";
if( !isset($_POST['FilterOrderby']) )
$query[17] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterOrderby'";
else
$query[17] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterOrderby'";
if( !isset($_POST['FilterRefresh']) )
$query[18] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterRefresh'";
else
$query[18] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterRefresh'";
if( !isset($_POST['FilterColExp']) )
$query[19] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterColExp'";
else
$query[19] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterColExp'";
if( !isset($_POST['FilterHost']) )
$query[20] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterHost'";
else
$query[20] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterHost'";
if( !isset($_POST['FilterMsg']) )
$query[21] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterMsg'";
else
$query[21] = "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[3] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uDebug'";
else
$query[3] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uDebug'";
return $query;
}
/*!
* 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) );
}
// Calculate the differenz between local and UTC time
function GetTimeDifferenzInHours ( $iTime = 0 )
{
if ( 0 == $iTime ) { $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 ( ($iTztime - $iTime) / 3600 );
}
// Call this function each time you want to display a date/time.
// /param $timestamp A date timestamp in ISO format (2006-04-12 12:51:24) containing date + time.
function FormatTime($datetimestamp, $format = _TIMEFormat)
{
// get the unix timestamp of the given date timestamp
$u_ts = strtotime($datetimestamp);
if (_UTCtime)
{
// ok, utc is used, now determine if we have to convert to local time
if (_SHOWLocaltime)
{
$u_ts = strtotime(GetTimeDifferenzInHours() . " hours", $u_ts);
}
// no else needed, because it is already in utc time
}
else
{
// ok, local time is used, determine if we have to convert to utc
if (!_SHOWLocaltime)
{
// note you have to add the hours if is -GMT or subtract if +GMT
// therefore * -1
$u_ts = strtotime((GetTimeDifferenzInHours() * -1) . " hours", $u_ts);
}
// no else needed, because is already in localtime
}
// format
return date($format, $u_ts);
}
?>

247
index.php
View File

@ -1,247 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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("usrdis", "|", _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>";
CheckInstallDir();
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_register('usrdis');
$_SESSION['usr'] = $_COOKIE['usr'];
$_SESSION['usrdis'] = $_COOKIE['usrdis'];
LoadUserConfig();
header("Location: index.php");
exit;
}
if($_SESSION['save_cookies'])
{
setcookie("valid", $_COOKIE["valid"], _COOKIE_EXPIRE, "/");
setcookie("usr", $_COOKIE["usr"], _COOKIE_EXPIRE, "/");
}
}
WriteStandardHeader('Index');
// Show current Version Number (configurable in config.php):
echo "<br><b>phpLogCon version "._VersionMajor."."._VersionMinor."."._VersionPatchLevel."</b><br>";
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(0);
$cmdSQLlast_part .= $myFilter->GetSQLSort();
$myEventsNavigation = new EventsNavigation(5);
$myEventsNavigation->SetPageNumber(1);
$myEventsNavigation->SetEventCount($global_Con, $cmdSQLlast_part);
$num = $myEventsNavigation->GetEventCount();
if(_ENABLEUI)
{
echo _MSGWel . ", <font color=\"blue\">" . $_SESSION["usrdis"] . "</font>" . _MSGChoOpt;
echo "<br>"._MSGwhichdb." <b>".$_SESSION['database']."</b>";
}
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);
if(strtolower(_DB_APP) == "mssql")
$rowIndex = 'num';
else
$rowIndex = 0;
if (_AdminMessage != "")
{
echo "<br><br><b>"._AdminMessage."</b><br>";
}
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['num'] . "</td></tr>";
echo "<tr><td CLASS=TDHEADER>" . _MSGNumERE . "</td><td CLASS=TD2>" . $row_er['num'] . "</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, $myFilter->OrderBy);
$i = 0;
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['InfoUnitID'])
{
case 1:
$infounit = "SL";
break;
case 3:
$infounit = "ER";
break;
default:
$infounit = "O";
}
static $tc = 1;
echo '<tr>';
echo '<td CLASS=TD', $tc, '><nobr>',FormatTime($row[_DATE]),'</nobr></td>'; //date
echo '<td CLASS=TD', $tc, '>',$row['Facility'],'</td>'; //facility
// get the description of priority (and get the the right color, if enabled)
$pricol = 'TD' . $tc;
$priword = FormatPriority($row['Priority'], $pricol);
echo '<td CLASS=', $pricol, '>', $priword, '</td>';
echo "<td CLASS=TD" . $tc . ">".$infounit."</td>"; //InfoUnit
echo "<td CLASS=TD" . $tc . ">".$row['FromHost']."</td>"; //host
$message = $row['Message'];
$message = str_replace("<", "&lt;", $message);
$message = str_replace(">", "&gt;", $message);
echo '<td CLASS=TD', $tc, '><a CLASS="Msg" href="details.php?lid=', $row['ID'], '">', $message, '</a></td>'; //message
//for changing colors
if($tc == 1) $tc = 2;
else $tc = 1;
echo "</tr>";
}
echo "</table>";
echo "<a href=\"events-display.php\"><b>[more...]</b></a>";
}
// 2005-08-17 by therget --->
// If any date is in the future, show a message on the homepage.
/* 2005-09-19 by mm
* $now = date("Y-m-d g:i:s"); // <-- this is a bug use H for 0 - 23 hours.
* Furthermore, use the database driver for date/time stuff!
*/
/* 2006-04-12 by mm
*
* Moved this code out of the above if/else condition, because it is also of interest even
* if no data was found for the current filter conditions.
*
*/
$sqlstatement = "SELECT COUNT(*) AS datecount FROM "._DBTABLENAME ." WHERE "._DATE." > ".dbc_sql_timeformat(time());
$result = db_exec($global_Con,$sqlstatement);
$db_datecount = db_fetch_array($result);
if ($db_datecount['datecount'] > 0)
{
echo _NoteMsgInFuture1, $db_datecount['datecount'], _NoteMsgInFuture2;
}
// <--- End 2005-08-17 by therget
WriteFooter();
?>

View File

@ -1,116 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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.
*/#### #### #### #### #### #### #### #### #### ####
function WriteHead($title)
{
?>
<!-- Head creation -->
<html>
<head>
<title><?php echo $title; ?></title>
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META http-equiv="pragma" CONTENT="no-cache">
<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()
{
?>
<!-- Footer creation -->
<center>
<table>
<tr>
<td>
<br /><br />
<small><i><a href="http://www.phplogcon.org/" target="phplogcon">phpLogCon</a>,
Copyright &copy; 2003 - 2005 <a href="http://www.adiscon.com" target="Adiscon">Adiscon GmbH</a>. Part of the <a href="http://www.monitorware.com/">MonitorWare line of Products</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) );
}

View File

@ -1,190 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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");
if(!isset($_POST['instLang']))
{
echo "<center><b>Welcome to the installation of phpLogCon, the WebInterface to log data.</b><br>";
echo "<form method=\"POST\" action=\"install.php\" name=\"Language\">";
echo "<input type=\"hidden\" name=\"instLang\" value=\"Language\">";
echo "Please select your language for Installation progress: ";
echo "<Select name=\"language\">";
echo "<option value=\"en\">English</Option>";
echo "<option value=\"de\">German</Option>";
echo "</Select>";
echo "<br><input type=\"submit\" value=\"Submit\">";
echo "</center>";
}
else
{
include "../lang/" . $_POST['language'] . ".php";
?>
<!-- Body creation -->
<center><b><?php echo _InsWelc1; ?><br><?php echo _InsWelc2; ?><br><i><?php echo _InsWelc3; ?><font color="red"><?php echo _InsWelc4; ?></font><?php echo _InsWelc5; ?></i></b></center>
<br><br>
<center><?php echo _InsDbIns1; ?><br><?php echo _InsDbIns2; ?></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">.: <?php echo _InsDbIns3; ?> :.</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td><?php echo _InsDbInsCon; ?>: <font color="red">*</font></td>
<td>
<select name="dbcon">
<option value="nativemysql" selected>MySQL</Option>
<option value="odbcmysql">MySQL via ODBC</Option>
<option value="odbcmssql">MSSQL/MSAccess via ODBC</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 (<?php echo _InsDbInsPort; ?>):</td>
<td><input type="text" name="dbport" size="25"></td>
</tr>
<tr>
<td><?php echo _InsDbInsUsr; ?>:</td>
<td><input type="text" name="dbuser" size="25"></td>
</tr>
<tr>
<td><?php echo _InsPass; ?>:</td>
<td><input type="password" name="dbpass" size="25"></td>
</tr>
<tr>
<td><?php echo _InsPassRe; ?>:</td>
<td><input type="password" name="dbpassre" size="25"></td>
</tr>
<tr>
<td><?php echo _InsDbInsName; ?>: <font color="red">*</font></td>
<td><input type="text" name="dbname" size="25"></td>
</tr>
<tr>
<td><?php echo _InsDbInsTime; ?>: <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><?php echo _InsPlcIns1; ?><br><i><?php echo _InsPlcIns2; ?></center>
<br>
<table border="" cellpadding="2" cellspacing="0" width="600" align="center" Class="ConfigTable">
<tr>
<td colspan="2" align="center" Class="Header1">.: <?php echo _InsPlcIns3; ?> :.</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td><?php echo _InsPlcInsLang; ?>:</td>
<td>
<select name="lang">
<option value="en" <?php if($_POST['instLang'] == "en") echo 'selected'; ?>><?php echo _InsLangEn; ?></Option>
<option value="de" <?php if($_POST['instLang'] == "de") echo 'selected'; ?>><?php echo _InsLangDe; ?></Option>
</select>
</td>
</tr>
<tr>
<td><?php echo _InsPlcInsUi; ?>:</td>
<td>
<input type="checkbox" name="ui" value="1">
</td>
</tr>
<tr>
<td colspan="2" align="left" Class="Header1"><?php echo _InsPlcInsUiCrUsr; ?>:</td>
<td Class="Header1">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><?php echo _InsPlcIns4; ?></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php echo _InsPlcInsUiName; ?>:</td>
<td><input type="text" name="uiuser" size="25"></td>
</tr>
<tr>
<td><?php echo _InsPlcInsUiDisName; ?>:</td>
<td><input type="text" name="uidisname" size="25"></td>
</tr>
<tr>
<td><?php echo _InsPass; ?>:</td>
<td><input type="password" name="uipass" size="25"></td>
</tr>
<tr>
<td><?php echo _InsPassRe; ?>:</td>
<td><input type="password" name="uipassre" size="25"></td>
</tr>
<tr>
<td><?php echo _InsPlcInsUiLang; ?>:</td>
<td>
<select name="uilang">
<option value="en" <?php if($_POST['instLang'] == "en") echo 'selected'; ?>><?php echo _InsLangEn; ?></Option>
<option value="de" <?php if($_POST['instLang'] == "de") echo 'selected'; ?>><?php echo _InsLangDe; ?></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();
?>

View File

@ -1,375 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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><?php echo _InsPer1; ?>
<?php
// if there are fields missing, create an error message
$strErrorMsg = "";
/*
* 2004-12-13 by mm
* Check if we use odbc, this is the case if the dbcon starts with
* the string "odbc".
*
* Using ODBC we need also the database type.
*/
if(substr($_POST['dbcon'], 0, 4) == 'odbc')
{
$bIsODBC = true;
$dbcon = 'odbc';
if (substr($_POST['dbcon'], 4)=='mysql')
$dbapp = 'mysql';
elseif(substr($_POST['dbcon'], 4)=='mssql')
$dbapp = 'mssql';
else
die('connection type unspecified');
}
else
{
$bIsODBC = false;
// currently only mysql is supported in non-odbc mode
$dbcon = 'native';
$dbapp = 'mysql';
}
if($_POST["dbhost"] == "" && !$bIsODBC)
$strErrorMsg .= "Host/IP";
if($_POST["dbport"] == "")
$_POST["dbport"] = 0;
if($_POST["dbuser"] == "" && !$bIsODBC)
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "User";
}
/*
* 2004-12-13 by mm
* Also with an mysql connection you can use a
* user without password. In fact, this is not
* really a good idea, but that's not our choise.
*
if($_POST["dbpass"] == "" && !$bIsODBC)
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Password";
}
if($_POST["dbpassre"] == "" && !$bIsODBC)
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Re-type Password";
}
*/
if($_POST["dbname"] == "")
{
if($strErrorMsg != "")
$strErrorMsg .= " - ";
$strErrorMsg .= "Database/DSN name";
}
if($_POST["dbpass"] != "" && $_POST["dbpassre"] != "" && !$bIsODBC)
{
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 = "";
}
else
$strUiErrMsg = "";
}
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=\"javascript:history.back()\">Go back to installation</a> ::..<br>";
echo "<br><br>";
exit;
}
?>
<b><font color="red"><?php echo _InsPerDone; ?></font></b></center>
<center><?php echo _InsPer2; ?>
<?php
// include database driver
if($bIsODBC)
{
include '../db-drv/odbc_' . $dbapp . '.php';
$tableIndex = 'TABLE_NAME';
}
else
{
include "../db-drv/mysql.php";
$tableIndex = 0;
}
// connect to database
$installCon = db_own_connection($_POST["dbhost"], $_POST["dbport"], $_POST["dbuser"], $_POST["dbpass"], $_POST["dbname"]);
// ***********************
// BEGIN CREATING TABLES
// ***********************
//Create an Array with all tablenames. If there are a new table assigned to phplogcon, add it here, too.
$arTables[0] = "SystemEvents";
$arTables[1] = "SystemEventsProperties";
$arTables[2] = "Users";
$arTables[3] = "UserPrefs";
// Check which tables are currently existing
$tableRes = db_get_tables($installCon, $_POST["dbname"]);
for($i = 0; $res = db_fetch_array($tableRes); $i++)
$arCurTables[$i] = $res[$tableIndex];
if(!isset($arCurTables))
$arCurTables = array();
for($i = 0; $i < count($arTables); $i++)
{
if( array_search($arTables[$i], $arCurTables) == FALSE )
{
if( !isset($arNewTables) )
$arNewTables[0] = $arTables[$i];
else
$arNewTables[count($arNewTables)] = $arTables[$i];
}
}
//Create not existing tables
if(isset($arNewTables))
{
for($i = 0; $i < count($arNewTables); $i++)
{
//Get queries from file
$strQueryFile = $dbapp . '_ct' . $arNewTables[$i] . '.sql';
$arQueries = GetSQLQueries($strQueryFile);
// Execute Queries
for($j = 0; $j < count($arQueries); $j++)
db_exec($installCon, $arQueries[$j]);
}
}
?>
<b><font color="red"><?php echo _InsPerDone; ?></font></b></center>
<center><?php echo _InsPer3; ?>
<?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]);
$arQueries[$i] = ereg_replace("<lang>", $_POST['uilang'], $arQueries[$i]);
db_exec($installCon, $arQueries[$i]);
}
elseif( stristr($arQueries[$i], "SET IDENTITY_INSERT UserPrefs") )
db_exec($installCon, $arQueries[$i]);
}
}
//close database connection
db_close($installCon);
?>
<b><font color="red"><?php echo _InsPerDone; ?></font></b></center>
<center><?php echo _InsPer4; ?>
<?php
// ***************************
// BEGIN EDITING CONFIG.PHP
// ***************************
// First check if the File is writeable!
if (is_writable("../config.php") == FALSE)
{
$strDbErrMsg = "Database Settings: ";
echo "<BR><u><b>Error:</b></u> <font color=red>The file '../config.php' is not writeable. Please check the permissions</b></font><br><br>Go back and correct this!<br>..:: <a href=\"javascript:history.back()\">Go back to installation</a> ::..<br>";
echo "<br><br></body></html>";
exit;
}
//open file handle
$hConfigSrc = fopen("../scripts/config.php.ex", "r");
$hConfigDes = @fopen("../config.php", "w");
if ($hConfigDes == FALSE)
{
$strDbErrMsg = "Database Settings: ";
echo "<BR><u><b>Error:</b></u> <font color=red>The file '../config.php' is not writeable. Please check the permissions</b></font><br><br>Go back and correct this!<br>..:: <a href=\"javascript:history.back()\">Go back to installation</a> ::..<br>";
echo "<br><br></body></html>";
exit;
}
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', '" . $dbcon . "');\r\n");
elseif(stristr($strLine, "define('_DB_APP'"))
fwrite($hConfigDes, " define('_DB_APP', '" . $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"><?php echo _InsPerDone; ?></font></b></center>
<br>
<center><b><?php echo _InsPer5; ?><br><?php echo _InsPer6; ?><br><?php echo _InsPer7; ?><br><br><?php echo _InsPer8; ?><br><br><font color="red"><?php echo _InsPer9; ?><br><?php echo _InsPer10; ?></font><br><br><?php echo _InsPer11; ?><a href="../index.php"><?php echo _InsPer12; ?></a>.</b></center>
<br><br>
<?php
WriteFoot();
?>

View File

@ -1,238 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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', 'Letzte fünf Logs (Unter Berücksichtigung der Filtereinstellungen)');
define('_MSGNoData', 'Keine Daten gefunden');
define('_MSGDate', 'Datum');
define('_MSGFac', 'Facility');
define('_MSGMsg', 'Nachricht');
define('_MSGSysLogTag', 'SysLogTag');
define('_MSGOccuren', 'Vorkommen');
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('_MSGShwSlt', 'Zeige SysLogTags');
define('_MSGShwSLog', 'Zeige SysLog');
define('_MSGNoDBCon', 'Verbindung zum Datenbank-Server fehlgeschlagen');
define('_MSGChDB', 'Auswahl der Datenbank fehlgeschlagen');
define('_MSGInvQur', 'Ungültige Abfrage');
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', 'Allgemeine Filter Konfiguration');
define('_MSGSltFil', 'SysLogTag 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('_MSGTagSort', 'Aufsteigend oder absteigend sortieren');
define('_MSGRef', 'Aktualisierung');
define('_MSGInfUI', 'InfoEinheit');
define('_MSGOth', 'Andere');
define('_MSGPri', 'Severity');
define('_MSGFilSet', 'Filter Einstellungen');
define('_MSGUsrSet', 'Benutzer Einstellungen');
define('_MSGFilOpt', 'Quick 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', 'Severity 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 (Zum Aufrufen, auswählen):');
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('_MSGAscend', 'Aufsteigend');
define('_MSGDescend', 'Absteigend');
define('_MSGEnbQF', 'Quick-Filter auswählen');
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)?');
define('_MSGAnd', 'und');
define('_MSGApply', 'Filter anwenden');
define('_MSGShow', 'Show');
define('_MSGMethSlt', 'SysLogTags');
define('_MSGMethHost', 'SysLogTags auf Hosts beziehend');
define('_MSGInstDir', 'Das \'install\' Verzeichnis existiert noch! Wenn Sie phplogcon schon komnfiguriert haben, löschen oder benennen Sie dieses Verzeichnis um. Dies verursacht sonst ein hohes sicherheitsrisiko! Anderfalls klicken Sie <a href="install/install.php">HIER</A> um die Installation von PHPLogCon zu starten.');
define('_InsWelc1', 'Willkommen zur Installation von phpLogCon, dem Logging-WebInterface.');
define('_InsWelc2', 'Die folgenden Schritte werden Sie durch die Installation begleiten und Ihnen bei der korrekten Installation und Konfiguration von phpLogCon helfen.');
define('_InsWelc3', 'Anmerkung: Felder mit einem ');
define('_InsWelc4', 'ROTEN *');
define('_InsWelc5', ' müssen in jdem Fall ausgefüllt werden!');
define('_InsDbIns1', 'Zuerst müssen wir Ihre Datenbank-Struktur überprüfen, da phpLogCon einige Tabellen benötigt. Wenn die Tabellen nicht existieren, wird phpLogCon sie anlegen.');
define('_InsDbIns2', 'Hierfür benötigt die phpLogCon Installation ein paar Informationen zu Ihrem Datenbank-Server:');
define('_InsDbIns3', 'Datenbank Einstellungen');
define('_InsDbInsCon', 'Verbindungstyp');
define('_InsDbInsConNa', 'Native');
define('_InsDbInsApp', 'Datenbank-Applikation');
define('_InsDbInsPort', 'Bei Standard, leer lassen');
define('_InsDbInsUsr', 'Benutzer (Benutzer muss \'INSERT\' und \'CREATE\' Rechte haben!)');
define('_InsPass', 'Passwort');
define('_InsPassRe', 'Password wiederholen');
define('_InsDbInsName', 'Datenbank/DSN Name');
define('_InsDbInsTime', 'Datenbank Zeitformat');
define('_InsPlcIns1', 'Nun müssen wir ein paar Einstellungen vornehmen, sauber und optimiert läuft.');
define('_InsPlcIns2', 'Anmerkung: Wenn Sie gewählt haben, dass das User Interface nicht installiert werden soll, können Sie es durch SQL-Scripte nachträglich installieren! Für Hilfe schauen Sie ins Manual.');
define('_InsPlcIns3', 'phpLogCon Allgemeine Einstellungen');
define('_InsPlcInsLang', 'Standard Sprache');
define('_InsLangEn', 'Englisch');
define('_InsLangDe', 'Deutsch');
define('_InsPlcInsUi', 'User Interface installieren');
define('_InsPlcInsUiCrUsr', 'Einen Benutzer anlegen');
define('_InsPlcIns4', 'Hier können Sie einen Benutzer für das User Interface anlegen. Wenn Sie bereits Benutzer in Ihrer Datenbank haben oder das User Interface nicht installieren möchten, lassen Sie diese Felder leer!');
define('_InsPlcInsUiName', 'Benutzername');
define('_InsPlcInsUiDisName', 'Anzeigename');
define('_InsPlcInsUiLang', 'Gewünschte Sprache');
define('_InsPer1', 'Überprüfe Benutzer Eingaben...');
define('_InsPerDone', 'Erledigt!');
define('_InsPer2', 'Erstelle benötigte Tabellen...');
define('_InsPer3', 'Füge Daten in die Tabellen ein...');
define('_InsPer4', 'Erstelle Ihre Konfigurationsdatei (config.php)...');
define('_InsPer5', 'Alle Aufgaben wurden erfolgreich abgeschlossen!');
define('_InsPer6', 'Herzlichen Glückwunsch! Sie haben erfolgreich phpLogCon installiert!');
define('_InsPer7', 'Eine Dtei namens \'config.php\' liegt im Hauptverzeichnis von phpLogCon. In dieser Datei sind alle Informationen, die sie zuvor eingegeben haben, gespeichert! Sie können diese Datei jederzeit Ihren Bedürfnissen anpassen.');
define('_InsPer8', 'Wechseln Sie zu \'index.php\' im root Verzeichnis um die Arbeit mit phpLogCon zu starten!');
define('_InsPer9', 'Vergessen Sie nicht den kompletten Ordner \'install/\' zu löschen!');
define('_InsPer10', 'Diese Datein können für einen DoS auf Ihr phpLogCon genutzt werden!');
define('_InsPer11', 'Nach Löschen des Ordners können Sie zum ');
define('_InsPer12', 'Index wecheln!');
define('_NoteMsgInFuture1', '<br><br><b>Hinweis:</b> Es sind ');
define('_NoteMsgInFuture2', ' Events in der Datenbank, die ein Datum haben, das in der Zukunft liegt!');
define('_MSGdatabaseConf', 'Datenbank Konfiguration');
define('_MSGdatabaseSet', 'Datenbank Einstellungen');
define('_MSGdatabaseChoose', 'Datenbank auswählen:');
define('_MSGDbOpt', 'Datenbank Optionen');
define('_MSGwhichdb', 'Sie arbeiten zur Zeit mit folgender Datenbank:');

View File

@ -1,238 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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 (filter settings apply)');
define('_MSGTop5', '5 most recent logs (filter settings apply)');
define('_MSGNoData', 'No data found');
define('_MSGDate', 'Date');
define('_MSGFac', 'Facility');
define('_MSGPri', 'Severity');
define('_MSGInfUI', 'InfoUnit');
define('_MSGMsg', 'Message');
define('_MSGSysLogTag', 'SysLogTag');
define('_MSGOccuren', 'Occurences');
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('_MSGShwSlt', 'Show SysLogTags');
define('_MSGShwSLog', 'Show SysLog');
define('_MSGNoDBCon', 'Cannot connect to database-server');
define('_MSGChDB', 'Failed to changing database');
define('_MSGInvQur', 'Invalid query');
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', 'Overall Filter conditions');
define('_MSGSltFil', 'SysLogTag Filter conditions');
define('_MSGEvnDat', 'Event&acute;s Date');
define('_MSGOrdBy', 'Order by');
define('_MSGTagSort', 'Order Ascending or Descending');
define('_MSGRef', 'Refresh');
define('_MSGOth', 'Other');
define('_MSGFilSet', 'Filter Settings');
define('_MSGUsrSet', 'User Settings');
define('_MSGFilOpt', 'Quick Filter Options');
define('_MSGSwiEvnMan', 'Select events date manually');
define('_MSGSwiEvnPre', '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', 'Severity 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 (Select to visit):');
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', 'Choose Quick Filters:');
define('_MSGDisIU', 'Display Info Unit');
define('_MSGAscend', 'Ascending');
define('_MSGDescend', 'Descending');
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)?');
define('_MSGAnd', 'and');
define('_MSGApply', 'Apply Filters');
define('_MSGDisSlt', 'Display');
define('_MSGMethSlt', 'SysLogTags');
define('_MSGMethHost', 'SysLogTags corresponding to hosts');
define('_MSGInstDir', 'The \'install\' directory does still exist! If you configured phplogcon already, please delete or rename it. This causes a high security risk! Otherwise please click <a href="install/install.php">HERE</A> to start the installation script.');
define('_InsWelc1', 'Welcome to the installation of phpLogCon, the WebInterface to log data.');
define('_InsWelc2', 'The following steps will guide you through the installation and help you to install and configure phpLogCon correctly.');
define('_InsWelc3', 'Note: Fields marked with a ');
define('_InsWelc4', 'RED *');
define('_InsWelc5', ' MUST be filled out in very case!');
define('_InsDbIns1', 'First we have to check your database structure, because phpLogCon needs some tables. If the tables don\'t exist, they will be created.');
define('_InsDbIns2', 'For this, phpLogCon Installation needs some information about your database Server:');
define('_InsDbIns3', 'Database Settings');
define('_InsDbInsCon', 'Connection Type');
define('_InsDbInsConNa', 'Native');
define('_InsDbInsApp', 'Database application');
define('_InsDbInsPort', 'If standard, leave blank');
define('_InsDbInsUsr', 'User (User must have \'INSERT\' and \'CREATE\' rights!)');
define('_InsPass', 'Password');
define('_InsPassRe', 'Re-type password');
define('_InsDbInsName', 'Database/DSN name');
define('_InsDbInsTime', 'Database time format');
define('_InsPlcIns1', 'Now we have to do some settings for phpLogCon to run clearly and user optimized.');
define('_InsPlcIns2', '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.');
define('_InsPlcIns3', 'phpLogCon General Settings');
define('_InsPlcInsLang', 'Default language');
define('_InsLangEn', 'English');
define('_InsLangDe', 'German');
define('_InsPlcInsUi', 'Install User Interface');
define('_InsPlcInsUiCrUsr', 'Create a User');
define('_InsPlcIns4', '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!');
define('_InsPlcInsUiName', 'Username');
define('_InsPlcInsUiDisName', 'Display name');
define('_InsPlcInsUiLang', 'Desired language');
define('_InsPer1', 'Checking users input...');
define('_InsPerDone', 'Done!');
define('_InsPer2', 'Creating required tables...');
define('_InsPer3', 'Inserting values into tables...');
define('_InsPer4', 'Creating your config file (config.php)...');
define('_InsPer5', 'All processes have been done clearly!');
define('_InsPer6', 'Congratulations! You\'ve successfully installed phpLogCon!');
define('_InsPer7', '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.');
define('_InsPer8', 'Move to \'index.php\' in root directory to start working with phpLogCon!');
define('_InsPer9', 'Don\'t forget to delete whole \'install/\' directory!');
define('_InsPer10', 'These files could be user for a DoS on your phpLogCon!');
define('_InsPer11', 'After deleting the directory, you can go to ');
define('_InsPer12', 'index');
define('_NoteMsgInFuture1', '<br><br><b>Note:</b> There are ');
define('_NoteMsgInFuture2', ' events in the database, which are in the future!');
define('_MSGdatabaseConf', 'Database Configuration');
define('_MSGdatabaseSet', 'Database Settings');
define('_MSGdatabaseChoose', 'Choose Database:');
define('_MSGDbOpt', 'Database Options');
define('_MSGwhichdb', 'You are currently working with the following database:');

View File

@ -1,19 +0,0 @@
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,"","");
}

View File

@ -1,228 +0,0 @@
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
{
}
.butto
background-color: #787878
border-color: #343434
color : #000000
font-size: 11px
font-family: Verdana, Arial, Helvetica, sans-serif

View File

@ -1,48 +0,0 @@
//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();

View File

@ -1,196 +0,0 @@
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;
}
.butto
background-color: #E5E5E5
border-color: #343434
color : #000000
font-size: 11px
font-family: Verdana, Arial, Helvetica, sans-serif
}

View File

@ -1 +0,0 @@
// dummy - not needed by this skin, but must be present - rgerhards 2005-08-09

View File

@ -1,206 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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 WriteFooter(). 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
* WriteFooter(). This generates the footer on the bottom of the page.
* @{
*/
/*!
*
*/
/*!
* generate the url for pint version
* /return The Url refer to the pint version of the current page.
*/
// very important to include config settings at beginning! (enable header setting)
// include 'config.php';
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>
<?php
if (_ENABLEHEADER == "1")
{
echo "<td width=\"220\" align=\"left\"><img src=\"",_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="syslog-index.php"><?php echo _MSGShwSlt; ?></a>
| <a href="filter-config.php"><?php echo _MSGFOpt; ?></a> | <a href="user-config.php"><?php echo _MSGUOpt; ?></a> | <a href="database-config.php"><?php echo _MSGDbOpt; ?></a> |
<a href="
<?php echo $_SERVER['PHP_SELF'];
$i = strpos($_SERVER['REQUEST_URI'], '?');
if ($i>0)
echo substr($_SERVER['REQUEST_URI'], $i);
?>
">
<?php echo _MSGRef; ?></a> | <a href="doc/index.htm" target="_blank"><?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><?php 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="<?php 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 WriteFooter()
{
global $strBasePath, $strBaseRealPath, $PrinterVersion, $global_Con;
?>
<center>
<table>
<tr>
<td>
<br /><br />
<small><i><a href="http://www.phplogcon.com/" target="_blank">phpLogCon</a>, Copyright &copy; 2003 - 2005 <a href="http://www.adiscon.com" target="_blank">Adiscon GmbH</a></i></small>
</td>
</tr>
</table>
</center>
</body>
</html>
<?php
// Close Database connection ONCE
db_close($global_Con);
} // END function WriteFooter()
?>

View File

@ -1,9 +0,0 @@
# *********************************************
# 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=

View File

@ -1,134 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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.
*/#### #### #### #### #### #### #### #### #### ####
function ShowVarFilter()
{
if ($_SESSION['change'] == 'Predefined')
{
echo '&nbsp;', _MSGEvnDat, ':&nbsp;';
include _FORMS.'events-date.php';
echo '&nbsp;';
}
else
{
echo '&nbsp;', _MSGEvnDat, ':&nbsp;';
include _FORMS.'manually-date.php';
echo '&nbsp;';
}
echo '<br><b>', _MSGFilOpt, ': </b>';
echo _MSGLogPg, ': ';
include _FORMS.'logs-per-page.php';
if ($_SESSION['FilterInfoUnit'] == 1 && stristr($_SERVER['PHP_SELF'], 'syslog') == FALSE)
{
echo "&nbsp;<b>|</b>";
echo '&nbsp;', _MSGDisIU, ': ';
include _FORMS.'display-infounit.php';
}
if ($_SESSION['FilterOrderby'] == 1)
{
echo "&nbsp;<b>|</b>";
echo '&nbsp;', _MSGOrdBy, ': ';
if(stristr($_SERVER['PHP_SELF'], 'syslog-index') != FALSE) include _FORMS.'tag-order-by.php';
else include _FORMS.'order-by.php';
}
if ($_SESSION['FilterOrderby'] == 1 && stristr($_SERVER['PHP_SELF'], 'syslog-index') != FALSE)
{
echo '&nbsp;';
include _FORMS.'tag-sort.php';
}
if (stristr($_SERVER['PHP_SELF'], 'syslog-index') != FALSE)
{
echo "&nbsp;<b>|</b>";
echo '&nbsp;', _MSGDisSlt, ': ';
include _FORMS.'syslog-show.php';
}
if ($_SESSION['FilterRefresh'] == 1)
{
echo "&nbsp;<b>|</b>";
echo '&nbsp;', _MSGRef, ': ';
include _FORMS.'refresh.php';
}
if ($_SESSION['FilterColExp'] == 1)
{
echo "&nbsp;<b>|</b>";
echo '&nbsp;', _MSGColExp, '&nbsp;';
include _FORMS.'color-expression.php';
}
if ($_SESSION['FilterHost'] == 1)
{
echo "&nbsp;<b>|</b>";
echo '&nbsp;', _MSGFilHost, ': ';
include _FORMS.'filter-host.php';
}
if ($_SESSION['FilterMsg'] == 1)
{
echo "&nbsp;<b>|</b>";
echo '&nbsp;', _MSGSearchMsg, ': ';
include _FORMS.'search-msg.php';
}
}
echo "<form method=\"POST\" action=" . $_SERVER['PHP_SELF'] . ">";
// 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 '<input type="hidden" name="change" value="Manually">';
echo '<input type="submit" name="button" value="' . _MSGSwiEvnMan . '">';
}
else
{
echo '<input type="hidden" name="change" value="Predefined">';
echo '<input type="submit" name="button" value="' . _MSGSwiEvnPre . '">';
}
?>
</form>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ; ?>">
<input type="hidden" name="quickFilter" value="change">
<?php
ShowVarFilter();
?>
<input type="submit" name="form" value="Submit">
</form>
<center><img src="<?php echo _ADLibPathImage;?>Head-Line.gif" width="100%" height="2" align="center"></center>

View File

@ -1,34 +0,0 @@
# 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 (UserIDText, Password, DisplayName, LastLogon, UserType, PrefCulture) VALUES ('<username>', '<password>', '<realname>', <date>, 1, '<lang>');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_infounit_sl', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_infounit_er', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_infounit_o', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_0', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_1', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_2', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_3', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_4', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_5', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_6', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_priority_7', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_ti', 'today');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_order', 'Date');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_refresh', '0');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_FilterInfoUnit', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_FilterOrderby', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_FilterRefresh', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_FilterColExp', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_FilterHost', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_FilterMsg', '1');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_favorites', 'www.adiscon.com|Adiscon,www.monitorware.com|MonitorWare,www.winsyslog.com|WinSysLog');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_tag_order', 'Occurences');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_tag_sort', 'Asc');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_uStylesheet', 'phplogcon');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_uLanguage', '<lang>');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_uSaveFilterSettings', '0');
INSERT INTO UserPrefs (UserLogin, Name, PropValue) VALUES ('<username>', 'PHPLOGCON_uDebug', '0');

View File

@ -1,166 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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 the Header (image/introduce sentence) will be used! Set 0 to disable it.
define('_ENABLEHEADER', 1);
//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, indicates if the records are stored in utc time
define('_UTCtime', 1);
// Show localtime, indicates if the records should be displayed in local time or utc time
define('_SHOWLocaltime', 1);
// Time format
define('_TIMEFormat', 'Y-m-d H:i:s');
// Get messages date by ReceivedAt or DeviceReportedTime
define('_DATE', 'ReceivedAt');
// Coloring priority
define('_COLPriority', 1);
// Custom Admin Message (appears on the homepage)
define('_AdminMessage', "");
// Version Number
define('_VersionMajor', "1");
define('_VersionMinor', "2");
define('_VersionPatchLevel', "3");
/*
***** 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));
?>

View File

@ -1,33 +0,0 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the SystemEvents table for MSsql
CREATE TABLE [SystemEvents] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[CustomerID] [int] NOT NULL ,
[ReceivedAt] [datetime] NOT NULL ,
[DeviceReportedTime] [datetime] NOT NULL ,
[Facility] [int] NOT NULL ,
[Priority] [int] NOT NULL ,
[FromHost] [varchar] (60) COLLATE Latin1_General_CI_AS NOT NULL ,
[Message] [text] COLLATE Latin1_General_CI_AS NOT NULL ,
[NTSeverity] [char] (3) COLLATE Latin1_General_CI_AS NOT NULL ,
[Importance] [char] (3) COLLATE Latin1_General_CI_AS NOT NULL ,
[EventSource] [varchar] (60) COLLATE Latin1_General_CI_AS NULL ,
[EventUser] [varchar] (60) COLLATE Latin1_General_CI_AS NOT NULL ,
[EventCategory] [int] NOT NULL ,
[EventID] [int] NOT NULL ,
[EventBinaryData] [text] COLLATE Latin1_General_CI_AS NOT NULL ,
[MaxAvailable] [int] NOT NULL ,
[CurrUsage] [int] NOT NULL ,
[MinUsage] [int] NOT NULL ,
[MaxUsage] [int] NOT NULL ,
[InfoUnitID] [int] NOT NULL ,
[SysLogTag] [varchar] (60) COLLATE Latin1_General_CI_AS NULL ,
[EventLogType] [varchar] (60) COLLATE Latin1_General_CI_AS NULL ,
[GenericFileName] [varchar] (60) COLLATE Latin1_General_CI_AS NULL ,
[SystemID] [int] NOT NULL ,
[Checksum] [int] NOT NULL ,
PRIMARY KEY (ID)
);

View File

@ -1,12 +0,0 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the SystemEventsProperties table for MSsql
CREATE TABLE [SystemEventsProperties] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[SystemEventID] [int] NULL ,
[ParamName] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[ParamValue] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL ,
PRIMARY KEY (ID)
);

View File

@ -1,12 +0,0 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the UserPrefs table for MSsql
CREATE TABLE [UserPrefs] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[UserLogin] [nvarchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[Name] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[PropValue] [nvarchar] (200) COLLATE Latin1_General_CI_AS NULL ,
PRIMARY KEY (ID)
);

View File

@ -1,16 +0,0 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the Users table for MSsql
CREATE TABLE [Users] (
[UserID] [int] IDENTITY (1, 1) NOT NULL ,
[UserIDText] [nvarchar] (20) COLLATE Latin1_General_CI_AS NULL ,
[Password] [nvarchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[DisplayName] [nvarchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[LastLogon] [smalldatetime] NULL ,
[UserType] [int] NULL ,
[HomeTZ] [int] NULL ,
[PrefCulture] [nvarchar] (5) COLLATE Latin1_General_CI_AS NULL ,
PRIMARY KEY (UserID)
);

View File

@ -1,33 +0,0 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the SystemEvents table for Mysql
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

View File

@ -1,11 +0,0 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the SystemEventsProperties table for Mysql
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

@ -1,12 +0,0 @@
# phpLogCon - A Web Interface to Log Data.
# Copyright (C) 2003 - 2004 Adiscon GmbH
#
# This SQL file creates the UserPrefs table for Mysql
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

@ -1,16 +0,0 @@
# 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

View File

@ -1,111 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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.
*/#### #### #### #### #### #### #### #### #### ####
// Check for speical ysql characters
function invalid_chars( $string )
{
$bad_list = array("'",'"',"%");
foreach( $bad_list as $needle )
{
if( strpos( $string, $needle ) !== FALSE )
{
return TRUE;
}
}
return FALSE;
}
// global _DBNAME, _DBUSERID, _DBPWD, _DBSERVER, $session_time;
include 'include.php';
if( !isset($_POST['save_cookies']))
$_POST['save_cookies'] = 0;
if( invalid_chars( $_POST['usr'] ) || invalid_chars( $_POST['pass'] ) )
{
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, DisplayName 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, "/");
setcookie("usrdis", $result["DisplayName"], _COOKIE_EXPIRE, "/");
}
else
$_SESSION['save_cookies'] = 0;
session_register("usr");
session_register("usrdis");
$_SESSION["usr"] = $result["UserIDText"];
$_SESSION["usrdis"] = $result["DisplayName"];
LoadUserConfig();
// Loading Users Filter Config when enabled
if($_SESSION['savefiltersettings'])
LoadFilterConfig();
db_close($global_Con);
header("Location: index.php");
}
}
?>

View File

@ -1,206 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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';
if( !isset($_GET['slt']) )
{
header("Location: syslog-index.php");
exit;
}
WriteStandardHeader(_MSGShwSLog);
//classes
include _CLASSES . 'eventsnavigation.php';
include _CLASSES . 'eventfilter.php';
//the splitted sql statement
$cmdSQLfirst_part = 'SELECT ';
$cmdSQLmain_part = 'ID, '._DATE.', Facility, Priority, FromHost, Message FROM '._DBTABLENAME;
$cmdSQLlast_part = " WHERE InfoUnitID=1 AND SysLogTag LIKE '" . $_GET['slt'] . "' AND ";
// 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();
// how much data records should be displayed on one page
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();
// show (include) quick filters
include "quick-filter.php";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<br /><a href="<?php echo $_SERVER['HTTP_REFERER']; ?>">&lt;&lt; <?php echo _MSGBck; ?></a><br />
<?php
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(), $myFilter->OrderBy);
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>SysLogTag</td>
<td><?php echo _MSGDate; ?></td>
<td><?php echo _MSGHost; ?></td>
<td><?php echo _MSGFac; ?></td>
<td><?php echo _MSGPri; ?></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);
}
$tc = 1;
while($row = db_fetch_array($res))
{
if($row['Message'] == "")
$message = _MSGNoMsg;
else
$message = $row['Message'];
echo '<tr>';
echo '<td CLASS=TD' . $tc . '>' . $_GET['slt'] . '</nobr></td>'; //date
echo '<td CLASS=TD' . $tc . '><nobr>' . $row[_DATE] . '</nobr></td>'; //date
echo '<td CLASS=TD' . $tc . '>' . $row['FromHost'] . '</td>'; //host
echo '<td CLASS=TD' . $tc . '>' . $row['Facility'] . '</td>'; //facility
// get the description of priority (and get the the right color, if enabled)
$pricol = 'TD' . $tc;
$priword = FormatPriority($row['Priority'], $pricol);
echo '<td CLASS=', $pricol, '>', $priword, '</td>';
$message = htmlspecialchars($message);
if(isset($_SESSION['regexp']) && $_SESSION['regexp'] != "")
{
$_SESSION['regexp'] = trim($_SESSION['regexp']);
$messageUp = strtoupper($message);
$regexpUp = strtoupper($_SESSION['regexp']);
$search_pos = strpos($messageUp, $regexpUp);
if($search_pos !== FALSE)
{
$regexpLng = strlen($_SESSION['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="' . $_SESSION['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['ID'] , '">', $message, '</a></td>'; //message
//for changing colors
if($tc == 1) $tc = 2;
else $tc = 1;
/*
echo "<td>".$row['Priority']."</td>";
*/
echo '</tr>';
}
echo "</table>";
WriteFooter();
?>

View File

@ -1,243 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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';
WriteStandardHeader(_MSGShwSlt);
//classes
include _CLASSES . 'eventsnavigation.php';
include _CLASSES . 'eventfilter.php';
// SELECT COUNT(ID) AS occurences, ID, FromHost, Message, SysLogTag FROM SystemEvents WHERE InfoUnitID=1 AND ReceivedAt >= '2004-01-01 00:00:00' AND ReceivedAt <= '2004-10-26 23:59:59' GROUP BY SysLogTag ORDER BY occurences DESC limit 0,20
// SELECT COUNT(ID) AS occurences, SysLogTag FROM SystemEvents WHERE (InfoUnitID = 1) AND (ReceivedAt >= '2004-01-01 00:00:00') AND (ReceivedAt <= '2004-10-26 23:59:59') GROUP BY SysLogTag
// TO-DO: Change "ExampleHost" to "Most Host"
//the splitted sql statement
// Cause MSSQL has proplems with GROUP BY clauses we need to do 2 DataBase-Queries
// the first one gets the occurences on one syslogtag, the syslogtag itself and the host.
// the second one only gets the message!
// Don't try to combine these two queries! MSSQL will give you a headnut! :D
$cmdSQLfirst_part = 'SELECT ';
$cmdSQLmain_part_1 = "COUNT(ID) AS occurences, SysLogTag";
$cmdSQLmain_part_2 = "ID, Message FROM "._DBTABLENAME;
$cmdSQLlast_part_1 = ' WHERE InfoUnitID=1 AND ';
$cmdSQLlast_part_2 = ' WHERE InfoUnitID=1 AND ';
// define the last part of the sql statment, e.g. the where part, ordery by, etc.
$myFilter = New EventFilter;
// Which methode is choosed?
if($_SESSION['show_methode'] == "Host")
{
$myFilter->SetSQLGroup("SysLogTagHost");
$cmdSQLmain_part_1 .= ", FromHost FROM "._DBTABLENAME;
}
else
{
if($_SESSION['tag_order'] == "Host")
$_SESSION['tag_order'] = "SysLogTag";
$myFilter->SetSQLGroup("SysLogTag");
$cmdSQLmain_part_1 .= " FROM "._DBTABLENAME;
}
$cmdSQLlast_part_1 .= $myFilter->GetSQLWherePart(1);
$cmdSQLlast_part_2 .= $myFilter->GetSQLWherePart(1);
// how much data records should be displayed on one page
if($_SESSION['epp'] < 1 || $_SESSION['epp'] > 100)
$myEventsNavigation = new EventsNavigation(20);
else
$myEventsNavigation = new EventsNavigation($_SESSION['epp']);
// show (include) quick filters
include "quick-filter.php";
echo "<br>";
// how much data records match with the filter settings
// if(strtolower(_CON_MODE) == "odbc" && strtolower(_DB_APP) == "mssql")
// $myEventsNavigation->EventCount = odbc_record_count($global_Con, $cmdSQLfirst_part . $cmdSQLmain_part_1 . $cmdSQLlast_part_1);
// else
$myEventsNavigation->SetEventCount($global_Con, $cmdSQLlast_part_1);
$num = $myEventsNavigation->GetEventCount();
$cmdSQLlast_part_1 .= $myFilter->GetSQLGroup();
$cmdSQLlast_part_1 .= $myFilter->GetSysLogTagSQLSort();
// SQL statement to get result with limitation
$res1 = db_exec_limit($global_Con, $cmdSQLfirst_part, $cmdSQLmain_part_1, $cmdSQLlast_part_1, $myEventsNavigation->GetLimitLower(), $myEventsNavigation->GetPageSize(), $myFilter->OrderBy);
if($num == 0)
{
// output if no data exit for the search string
echo '<br><b>', _MSGNoData, '</b>';
}
else
{
echo '<table>';
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>
<?php if($_SESSION['show_methode'] == "Host") echo "<td>Example Host</td>";?>
<td>SysLogTag</td>
<td>Occurences</td>
<td>Example Message - Click for full list</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);
}
$tc = 1;
while($row1 = db_fetch_array($res1))
{
// here we get the message corresponding to a syslogtag!
// for better performance we optimize the query with a TOP(Mssql) or LIMIT(MySql)
$cmdTmpFirst = $cmdSQLfirst_part;
$cmdTmpLast = $cmdSQLlast_part_2;
$cmdSQLlast_part_2 .= " AND SysLogTag LIKE '" . $row1['SysLogTag'] . "'";
if(strtolower(_CON_MODE) == "odbc" && strtolower(_DB_APP) == "mssql")
$cmdSQLfirst_part .= "TOP 1 ";
else
$cmdSQLlast_part_2 .= " LIMIT 0,1";
$res2 = db_exec($global_Con, $cmdSQLfirst_part . $cmdSQLmain_part_2 . $cmdSQLlast_part_2);
$cmdSQLlast_part_2 = $cmdTmpLast;
$cmdSQLfirst_part = $cmdTmpFirst;
$row2 = db_fetch_array($res2);
if($row2['Message'] == "")
$message = _MSGNoMsg;
else
$message = $row2['Message'];
echo '<tr>';
if($_SESSION['show_methode'] == "Host")
echo '<td CLASS=TD' . $tc . '>' . $row1['FromHost'] . '</td>';
echo '<td CLASS=TD' . $tc . '>' . $row1['SysLogTag'] . '</td>';
echo '<td CLASS=TD' . $tc . '>' . $row1['occurences'] . '</td>';
$message = htmlspecialchars($message);
if(isset($_SESSION['regexp']) && $_SESSION['regexp'] != "")
{
$_SESSION['regexp'] = trim($_SESSION['regexp']);
$messageUp = strtoupper($message);
$regexpUp = strtoupper($_SESSION['regexp']);
$search_pos = strpos($messageUp, $regexpUp);
if($search_pos !== FALSE)
{
$regexpLng = strlen($_SESSION['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="' . $_SESSION['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="syslog-display.php?slt=' . $row1['SysLogTag'] . '">', $message, '</a></td>'; //message
//for changing colors
if($tc == 1) $tc = 2;
else $tc = 1;
/*
echo "<td>".$row['Priority']."</td>";
*/
echo '</tr>';
}
echo "</table>";
}
WriteFooter();
?>

View File

@ -1,152 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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>

View File

@ -1,184 +0,0 @@
<?php
/*#### #### #### #### #### #### #### #### #### ####
phpLogCon - A Web Interface to Log Data.
Copyright (C) 2004-2005 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">
<table align="center"><tr><td><h3>..:: <?php echo _MSGUsrSet; ?> ::..</h3></td></tr></table>
<center>
<table border="" cellpadding="2" cellspacing="0" width="700" align="center" Class="ConfigTable">
<tr>
<td colspan="2" Class="Header1">
<?php echo _MSGSty; ?>:
</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>
</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>
</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>
<?php
/*
?>
<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 colspan="2" Class="Header1">
Bookmarks:
</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" onchange="window.open(this.options[this.selectedIndex].value, \'\'); return true;">';
echo '<option value="" selected>Select your Bookmark</option>';
$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=\"submit\" value=\"" . _MSGDel . "\">\t";
}
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
*/
WriteFooter();
?>