diff --git a/classes/eventfilter.php b/classes/eventfilter.php
deleted file mode 100644
index 36827f0..0000000
--- a/classes/eventfilter.php
+++ /dev/null
@@ -1,633 +0,0 @@
-.
-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;
- }
- }
-
-?>
\ No newline at end of file
diff --git a/classes/eventsnavigation.php b/classes/eventsnavigation.php
deleted file mode 100644
index 7b9429e..0000000
--- a/classes/eventsnavigation.php
+++ /dev/null
@@ -1,174 +0,0 @@
-.
-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 = "GetPageNumber()-1)."&" . $url_query . "\" class=\"searchlink\"> « ";
- $this->NavigationFirstPage = " «« ";
- }
- else
- {
- $this->NavigationLeftArrow = " « ";//unable
- $this->NavigationFirstPage = " «« ";//enable
- }
-
- if($this->GetPageNumber() < $page)
- {
- $this->NavigationRightArrow = "GetPageNumber()+1)."&" . $url_query . "\" class=\"searchlink\"> » ";
- $this->NavigationLastPage = " »» ";
- }
- else
- {
- $this->NavigationRightArrow = " » ";
- $this->NavigationLastPage = " »» ";
- }
-
- 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 " $a";
- else
- echo " ".$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;
- }
- }
-
-?>
diff --git a/config.php b/config.php
deleted file mode 100644
index 32e5653..0000000
--- a/config.php
+++ /dev/null
@@ -1,163 +0,0 @@
-.
-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));
-
-?>
\ No newline at end of file
diff --git a/database-config-process.php b/database-config-process.php
deleted file mode 100644
index 7e4f7a9..0000000
--- a/database-config-process.php
+++ /dev/null
@@ -1,77 +0,0 @@
-.
-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";
-
-?>
-
-
-
-
-";
-?>
-
-Redirecting
-
-
-
-".$szDescription."
";
-echo "You will be redirected to this page in 1 second.";
-
-?>
-
-
-
\ No newline at end of file
diff --git a/database-config.php b/database-config.php
deleted file mode 100644
index 5d88d5c..0000000
--- a/database-config.php
+++ /dev/null
@@ -1,76 +0,0 @@
-.
-See AUTHORS to learn who helped make it become a reality.
-
-*/#### #### #### #### #### #### #### #### #### ####
-
- require("include.php");
- WriteStandardHeader(_MSGdatabaseConf);
-?>
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/db-drv/mysql.php b/db-drv/mysql.php
deleted file mode 100644
index 56117fd..0000000
--- a/db-drv/mysql.php
+++ /dev/null
@@ -1,217 +0,0 @@
-.
-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 "
" . $cmdSQL . "
";
- $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=" Database error: $MyErrorMsg ";
- $errormsg.="mysql error: $errdesc ";
- $errormsg.="mysql error number: $errno ";
- $errormsg.="Date: ".date("d.m.Y @ H:i")." ";
- $errormsg.="Script: ".getenv("REQUEST_URI")." ";
- $errormsg.="Referer: ".getenv("HTTP_REFERER")."
";
-
- echo $errormsg;
- exit;
- }
-
- /*
- * Returns what wildcut the database use (e.g. %, *, ...)
- */
- function db_get_wildcut()
- {
- return '%';
- }
-
-?>
\ No newline at end of file
diff --git a/db-drv/odbc_mssql.php b/db-drv/odbc_mssql.php
deleted file mode 100644
index a9974a3..0000000
--- a/db-drv/odbc_mssql.php
+++ /dev/null
@@ -1,209 +0,0 @@
-.
-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 "
" . $cmdSQL . "
";
- 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 . " ";
- 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=" Database error: $MyErrorMsg ";
- $errormsg.="mysql error: $errdesc ";
- $errormsg.="mysql error number: $errno ";
- $errormsg.="Date: ".date("d.m.Y @ H:i")." ";
- $errormsg.="Script: ".getenv("REQUEST_URI")." ";
- $errormsg.="Referer: ".getenv("HTTP_REFERER")."
";
-
- echo $errormsg;
- exit;
- }
-
- function db_get_wildcut()
- {
- return '%';
- }
-
-?>
\ No newline at end of file
diff --git a/db-drv/odbc_mysql.php b/db-drv/odbc_mysql.php
deleted file mode 100644
index a8c5fd8..0000000
--- a/db-drv/odbc_mysql.php
+++ /dev/null
@@ -1,205 +0,0 @@
-.
-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 "
" . $cmdSQL . "
";
- 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=" Database error: $MyErrorMsg ";
- $errormsg.="mysql error: $errdesc ";
- $errormsg.="mysql error number: $errno ";
- $errormsg.="Date: ".date("d.m.Y @ H:i")." ";
- $errormsg.="Script: ".getenv("REQUEST_URI")." ";
- $errormsg.="Referer: ".getenv("HTTP_REFERER")."
";
-
- echo $errormsg;
- exit;
- }
-
- /*
- * Returns what wildcut the database use (e.g. %, *, ...)
- */
- function db_get_wildcut()
- {
- return '%';
- }
-
-?>
\ No newline at end of file
diff --git a/db-drv/odbc_mysql_.php b/db-drv/odbc_mysql_.php
deleted file mode 100644
index bd0fcbf..0000000
--- a/db-drv/odbc_mysql_.php
+++ /dev/null
@@ -1,168 +0,0 @@
-.
-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 "
" . $cmdSQL . "
";
- 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=" Database error: $MyErrorMsg ";
- $errormsg.="mysql error: $errdesc ";
- $errormsg.="mysql error number: $errno ";
- $errormsg.="Date: ".date("d.m.Y @ H:i")." ";
- $errormsg.="Script: ".getenv("REQUEST_URI")." ";
- $errormsg.="Referer: ".getenv("HTTP_REFERER")."
";
-
- echo $errormsg;
- exit;
- }
-
- function db_get_wildcut()
- {
- return '*';
- }
-?>
\ No newline at end of file
diff --git a/details.php b/details.php
deleted file mode 100644
index 9fab711..0000000
--- a/details.php
+++ /dev/null
@@ -1,283 +0,0 @@
-.
-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);
-
-?>
-
-
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.
phpLogCon is being implemented as a set of PHP scripts to ensure
- portability between different platforms. Target platforms for phpLogCon
- are:
-
-
Windows with IIS
-
Windows with Apache
-
Linux / *nix with Apache
-
-
The standard set of database systems is supported, that is
-
-
Microsoft SQL Server (via ODBC)
-
Microsoft Jet (aka Access, via ODBC)
-
MySQL (via ODBC and via native classes)
- Note: Native mysql is recommended for the best performance!
-
-
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).
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.
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.
-
Known Issues
-
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!
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).
-
Note: At each page of phpLogCon, include.php should be included!
-
config.php
-
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.
Missing logout link while logged in without cookies fixed.
-
-
2006-04-12
-
Minor fixes in user module.
-
Database Options does not work correctly other databases than MySQL in native mode. This is fixed now.
-
Some modifications on the "Message in the future" check in order to fix some minor issues.
-
Displaying local time even if the data is stored in utc time is supported now.
-
Time format is configurable now. See config.php.
-
Manual updated.
-
-
2006-02-06
-
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.
-
-
-
2005-12-12
-
Fixed a security bug in user login validation.
-
-
-
2005-12-05
-
"Message must contain" filter enhanced. Filtering for multiple words (seperated by spaces) is supported now.
-
-
New page database options. Using the "Database Options" (see link in menu) changing the database to use is possible during runtime.
-
-
Status info which database is in use was added on start page.
-
-
The version number was not correctly took on from install script. This bug is fixed.
-
-
Fixed a table style bug which caused an oddly look of some tables.
-
-
-
2005-09-26
-
Removed semicolon at the end of the query, because this is not supported by mysql
- file: scripts\mysql_ct*.sql
-
-
Added version number variables
- file: scripts\config.php.ex
-
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.
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 www.phplogcon.com.
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.
-
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)!
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.
-
phplogcon.ini
-
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.
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.
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.
-
There are two types of filters in phpLogCon:
-
-
-
-
General Filters:
-
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.
-
General Filters are:
-
-
Event's Date - The time when the event occurred
-
Order by - Also you can order the events, in which order they should appear in Events Display
-
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!
-
InfoUnits - The Units, where the event had been logged (i.e. EventReporter or SysLog)
-
Severity - Filtered by Severity of an event
-
-
-
-
-
SysLogTag Filter Conditions:
-
-
-
SysLogTag Filters are:
-
-
Order by Occurences or Syslogtag
-
Order Ascending or Descending
-
-
-
-
-
Quick Filters:
-
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.
-
Quick Filters are:
-
-
Logs per page - How many logs should be displayed per page
-
Search for IP/Host - You can filter out one Host or IP
-
Message must contain - The message must contain the specified string
-
Color an Expression - Searching for an regular expression and color it in specified color
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.
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.
-
It brings you two new quick filters to filter and order the SysLogTags for fine-tuning:
-
-
-
-
Display SysLogTags
-
In this drop-down menu you can choose between 'Syslog', that will show you all Syslogs those appear in database with a sample message and 'SysLog corresponding to host', what will show you every SysLogTag that appeared on each Host.
-
-
-
-
Order by
-
You can order the Events ascending or descending by SysLogTag, Occurrences or Hosts, who have send this SysLogTag.
-
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!
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.
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.
-
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!
-
If User Interface is disabled, the settings will only stay like this in the current session. Next time opening phpLogCon, they will be default.
-
- 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 '
';
- echo '
'.FormatTime($row[_DATE], $tmp_format).'
'; //date
- echo '
'.$row['Facility'].'
'; //facility
-
- // get the description of priority (and get the the right color, if enabled)
- $pricol = 'TD' . $tc;
- $priword = FormatPriority($row['Priority'], $pricol);
- echo '
';
- }
- }
- 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 "
" . _MSGInstDir . "
";
- 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);
-}
-?>
diff --git a/index.php b/index.php
deleted file mode 100644
index f0765ab..0000000
--- a/index.php
+++ /dev/null
@@ -1,247 +0,0 @@
-.
-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 " ";
- CheckInstallDir();
- echo " ";
-
- echo '', _MSG001, '.';
- echo '';
- 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 " phpLogCon version "._VersionMajor."."._VersionMinor."."._VersionPatchLevel." ";
-
-
- echo ' ';
- 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 . ", " . $_SESSION["usrdis"] . "" . _MSGChoOpt;
- echo " "._MSGwhichdb." ".$_SESSION['database']."";
- }
- 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 "
"._AdminMessage." ";
- }
-
- echo "
" . _MSGQuiInf . ":";
- echo "
";
- echo "
" . _MSGNumSLE . "
" . $row_sl['num'] . "
";
- echo "
" . _MSGNumERE . "
" . $row_er['num'] . "
";
- echo "
";
- echo " " . _MSGTop5 . ":
";
- if($num == 0)
- {
- //output if no data exists for the search string
- echo " " . _MSGNoData . "!";
- }
- else
- {
- echo '
'; //facility
-
- // get the description of priority (and get the the right color, if enabled)
- $pricol = 'TD' . $tc;
- $priword = FormatPriority($row['Priority'], $pricol);
- echo '
";
- echo "[more...]";
- }
-
- // 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();
-?>
diff --git a/install/include.php b/install/include.php
deleted file mode 100644
index 7a78b6f..0000000
--- a/install/include.php
+++ /dev/null
@@ -1,116 +0,0 @@
-.
-See AUTHORS to learn who helped make it become a reality.
-
-*/#### #### #### #### #### #### #### #### #### ####
-
-function WriteHead($title)
-{
-
-?>
-
-
-
-
-
-
-
-
-
-
-