commit 3ba2be96cb559cc7458b6a7df2f755d7b34da165 Author: Rainer Gerhards Date: Tue Nov 2 12:06:34 2004 +0000 Initial revision diff --git a/classes/eventfilter.php b/classes/eventfilter.php new file mode 100644 index 0000000..5e37ccd --- /dev/null +++ b/classes/eventfilter.php @@ -0,0 +1,586 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + if( !isset($_SESSION['change']) ) + $_SESSION['change'] = "Predefined"; + + /*! + * This is the filter for the events. + * + */ + + //error_reporting(E_ALL); + class EventFilter + { + var $TimeInterval; /*!< String coming from the URL describing the selected time interval. + * The variable from the url is "ti" + * Four scenarios are possible: + * Case 1: ti = the string "min" + the number of minutes of the selected + * time interval. + * Case 2: ti = the string "thishour" + * Case 3: ti = the string "today" + * Case 4: ti = the string "yesterday" + */ + var $BeginTime; //!< Timestamp when the interval begins + var $EndTime; //!< Timestamp when the interval ends + var $TimeInMinutes; //!< Actual time interval in minutes + var $UserDefaultTimeInterval; //!< The time interval set as default in the user's options menu + var $SQLWhereTime; //!< Contains the where part of the SQL statement + var $OrderBy; //!< Sorting argument + var $SQLWherePart; //!< Contains the whole SQL where part + var $SQLWhereInfoUnit; //!< Restriction of InfoUnit type + var $SQLWherePriority; //!< Restriction of Priority + var $SQLWhereHost; //!< Restriction of ip/host + var $SQLWhereMsg; //!< Message must contain a certain string + + /*! Constructor + * + * Get filter settings form url or if not available, get the user's default filter settings + * from the database. + */ + function EventFilter() + { + + // get the selected mode (time period) + $this->TimeInterval = $_SESSION['ti']; + + //Order argument + $this->OrderBy = $_SESSION['order']; + + if($_SESSION['change'] == 'Predefined') + { + $this->SelectTimeMode(); + } + else if ($_SESSION['change'] == 'Manually') + { + $this->ManuallyTime(); + } + } + + /*! + * Set $BeginTime and $EndTime if the user has selected manually events date + */ + function ManuallyTime() + { + $tmp_endtime = mktime(23, 59, 59, $_SESSION['m2'], $_SESSION['d2'], $_SESSION['y2']); + $tmp_endtime > 0 ? $this->EndTime = $tmp_endtime : 0; + $tmp_begintime = mktime(0, 0, 0, $_SESSION['m1'], $_SESSION['d1'], $_SESSION['y1']); + $tmp_begintime > 0 ? $this->BeginTime = $tmp_begintime : 0; + } + + /*! + * Get the default Time Interval from the user profil. This is stored in the database. + */ + function GetDefaultTimeInterval() + { + // instead of this read from session/database--> + $this->UserDefaultTimeInterval = "today"; + } + + /*! + * SelectMode decide on the TimeInterval variable which functions have to call to set the time interval. + * Possible modes are "thishour", "today" and an indication in minutes. This function also prove if + * TimeInterval valid. If invalid it used the default setting for TimeInterval from the user profil getting from + * the database. + * + */ + function SelectTimeMode() + { + // if TimeInterval is not transmitted by url, get the TimeInterval from the UserProfil + if (empty($this->TimeInterval)) + $this->GetDefaultTimeInterval(); + + switch ($this->TimeInterval) + { + case "thishour": + $this->SetTimeIntervalThisHour(); + break; + case "today": + $this->SetTimeIntervalToday(); + break; + case "yesterday": + $this->SetTimeIntervalYesterday(); + break; + default: + if (substr($this->TimeInterval, 0, 3) == "min") + { + //This is to convert the string after the "min"(from the URL) into an integer + $tmpTi = substr($this->TimeInterval, 3); + if (!is_numeric($tmpTi)) + die(" $tmpTi is no number"); + //string + int = int! this is required, because is numeric don't prove /-- etc. + $this->TimeInMinutes = $tmpTi+0; + $this->SetTimeIntervalMin($this->TimeInMinutes); + } + else + { + //this occurs only if an invalid value comes from the url + switch ($this->UserDefaultTimeInterval) + { + //if user has thishour set as default + case "thishour": + $this->SetTimeIntervalThisHour(); + break; + //if user has today set as default + case "today": + $this->SetTimeIntervalToday(); + break; + case "yesterday": + $this->SetTimeIntervalYesterday(); + break; + //if user has his own number of minutes(e.g. 60) set as default + default: + $this->SetTimeInterval($this->UserDefaultTimeInterval); + } + } + } + } + + /*! + * Calculate the time interval for this hour and set EndTime and EndTime. EndTime of the time interval is now, + * BeginTime is the start time of the current hour. You get the current unix timestamp + * with time(), wich is equel to EndTime. To get the BeginTime, easily take the current timestamp + * and set the minutes and seconds to 0.. + * + * \remarks An example: Current time is 2003-05-05 11:53:21. In this case EndTime = 2003-05-05 11:53:21 + * and BeginTime = 2003-05-05 11:00:00. + * + */ + function SetTimeIntervalThisHour() + { + $mytime = time(); + $y = date("Y", $mytime); + $m = date("m", $mytime); + $d = date("d", $mytime); + $h = date("H", $mytime); + + $this->EndTime = $mytime; + $this->BeginTime = mktime($h, 0, 0, $m, $d, $y); + + //$this->EndTime = date("Y-m-d H:i:s", time()); + //$this->BeginTime = date("Y-m-d H", time()) . ":00:00"; + } + + /*! + * Calculate the time interval for today and set BeginTime and EndTime. EndTime of the time interval is now, + * BeginTime is the date of today with hour 00:00:00. You get the current unix timestamp + * with time(), which is equal to EndTime. To get the BeginTime take the date of the current + * timestamp and set the hour to 00:00:00. + * + * \remarks An example: Current time is 2003-05-05 11:53:21. In this case EndTime = 2003-05-05 11:53:21 + * and BeginTime = 2003-05-05 00:00:00. + */ + function SetTimeIntervalToday() + { + $mytime = time(); + $y = date("Y", $mytime); + $m = date("m", $mytime); + $d = date("d", $mytime); + + $this->EndTime = $mytime; + $this->BeginTime = mktime(0, 0, 0, $m, $d, $y); + + //$this->EndTime = date("Y-m-d H:i:s", time()); + //$this->BeginTime = date("Y-m-d ", time()) . "00:00:00"; + } + + /*! + * Calculate the time interval for yesterday and set BeginTime and EndTime. EndTime of the time interval is now, + * BeginTime is the date of today with hour 00:00:00. You get the current unix timestamp + * with time(), which is equal to EndTime. To get the BeginTime take the date of the current + * timestamp and set the hour to 00:00:00. + * + * \remarks An example: Current time is 2003-05-05 11:53:21. In this case EndTime = 2003-05-04 23:59:59 + * and BeginTime = 2003-05-04 00:00:00. + */ + function SetTimeIntervalYesterday() + { + $mytime = time(); + $y = date("Y", $mytime); + $m = date("m", $mytime); + $d = date("d", $mytime); + + $d--; + + $this->EndTime = mktime(23, 59, 59, $m, $d, $y); + $this->BeginTime = mktime(0, 0, 1, $m, $d, $y); + + //$this->EndTime = date("Y-m-d H:i:s", time()); + //$this->BeginTime = date("Y-m-d ", time()) . "00:00:00"; + } + + + /*! + * Calculates the time in minutes from now to the beginning of the interval and set EndTime and EndTime. + * To do this, get the current timestamp with time(), which is equal to EndTime, and take from it TimeInMinutes off. + * + * \remarks An example: Current time is 2003-05-05 11:53:21 and TimeInMinutes are 60. In this case + * EndTime is 2003-05-05 11:53:21 and BeginTime = 2003-05-05 10:53:21. + * + * \param TimeInMinutes describe how many minutes are between the BeginTime and EndTime + */ + function SetTimeIntervalMin($TimeInMinutes) + { + $mytime = time(); + $this->BeginTime = $mytime - $TimeInMinutes*60; + $this->EndTime = $mytime; + } + + + // generate HTML to display in quick menu bar + // returns: string, html to be displayed + function GetHTMLQuickDisplay() + { + } + + /*! + * To calculate the the UTC Timestamp + * \param timestamp of the local system + * \return timestamp, UTC time + */ + function GetUTCtime($iTime) + { + if ( $iTime == 0 ) $iTime = time(); + $ar = localtime ( $iTime ); + + $ar[5] += 1900; $ar[4]++; + $iTztime = gmmktime ( $ar[2], $ar[1], $ar[0], + $ar[4], $ar[3], $ar[5], $ar[8] ); + return ( $iTime - ($iTztime - $iTime) ); + } + + /*! + * Use this to set SQLWhereTime which is part of the sql where clause. + * This is responsilbe for the limitation of the requested data by time. + */ + function SetSQLWhereTime() + { + if (_UTCtime) + $this->SQLWhereTime = _DATE . ' >= ' . dbc_sql_timeformat($this->GetUTCtime($this->BeginTime)) . ' AND ' . _DATE . ' <= ' . dbc_sql_timeformat($this->GetUTCtime($this->EndTime)); + else + $this->SQLWhereTime = _DATE . ' >= ' . dbc_sql_timeformat($this->BeginTime) . ' AND ' . _DATE . ' <= ' . dbc_sql_timeformat($this->EndTime); + } + + /*! + * Use this to get a part of the sql where clause. + * This is responsilbe for the limitation of the requested data by time. + * \return A string, part of the SQL where clause (time argument) + */ + function GetSQLWhereTime() + { + $this->SetSQLWhereTime(); + return $this->SQLWhereTime; + } + + /*! + * Use this to set SQLWhereInfoUnit which is part of the sql where clause. + * This set the InfoUnit restriction. + */ + function SetSQLWhereInfoUnit() + { + // sl = 1, er = 3, o + // sl-er-o (matrix) + // 0-0-0 -> all InfoUnit #0 + // 0-0-1 -> only o #1 + // 0-1-0 -> only er #2 + // 0-1-1 -> not sl #3 + // 1-0-0 -> only sl #4 + // 1-0-1 -> not er #5 + // 1-1-0 -> only sl and er#6 + // 1-1-1 -> all InfoUnit #7 + $tmpSQL[0][0][0]= ''; + $tmpSQL[0][0][1]= ' AND (InfoUnitID<>1 AND InfoUnitID<>3) '; + $tmpSQL[0][1][0]= ' AND InfoUnitID=3 '; + $tmpSQL[0][1][1]= ' AND InfoUnitID<>1 '; + $tmpSQL[1][0][0]= ' AND InfoUnitID=1 '; + $tmpSQL[1][0][1]= ' AND InfoUnitID<>3 '; + $tmpSQL[1][1][0]= ' AND (InfoUnitID=1 or InfoUnitID=3) '; + $tmpSQL[1][1][1]= ''; + $this->SQLWhereInfoUnit = $tmpSQL[$_SESSION['infounit_sl']][$_SESSION['infounit_er']][$_SESSION['infounit_o']]; + +/* + if ($_SESSION['infounit_sl'] == 1) + { + if ($_SESSION['infounit_er'] == 1) + { + if ($_SESSION['infounit_o'] == 1) { $tmpSQL = ''; } // #7 + else { $tmpSQL = ' AND (InfoUnitID=1 or InfoUnitID=3) '; } // #6 + } + else + { + if ($_SESSION['infounit_o'] == 1) + { $tmpSQL = ' AND InfoUnitID<>3 '; } // #5 + else + { $tmpSQL = ' AND InfoUnitID=1 '; } // #4 + } + } + else + { + if ($_SESSION['infounit_er'] == 1) + { + if ($_SESSION['infounit_o'] == 1) { $tmpSQL = ' AND InfoUnitID<>1 '; } // #3 + else { $tmpSQL = ' AND InfoUnitID=3 '; } // #2 + } + else + { + if ($_SESSION['infounit_o'] == 1) { $tmpSQL = ' AND (InfoUnitID<>1 AND InfoUnitID<>3) '; } // #1 + else { $tmpSQL = ''; } // #0 + } + } + */ + + } + + /*! + * Use this to get a part of the sql where clause. + * This sort out the InfoUnit type. + * \return A string, part of the SQL where clause (InfoUnit type restriction) + */ + function GetSQLWhereInfoUnit() + { + $this->SetSQLWhereInfoUnit(); + return $this->SQLWhereInfoUnit; + } + + function SetSQLWherePriority() + { + //Optimizing Query... + if ($_SESSION['priority_0'] == 1 and $_SESSION['priority_1'] == 1 and $_SESSION['priority_2'] == 1 and $_SESSION['priority_3'] == 1 and $_SESSION['priority_4'] == 1 and $_SESSION['priority_5'] == 1 and $_SESSION['priority_6'] == 1 and $_SESSION['priority_7'] == 1) + { + $this->SQLWherePriority = ""; + } + else + { + if ($_SESSION['priority_0'] == 1 or $_SESSION['priority_1'] == 1 or $_SESSION['priority_2'] == 1 or $_SESSION['priority_3'] == 1 or $_SESSION['priority_4'] == 1 or $_SESSION['priority_5'] == 1 or $_SESSION['priority_6'] == 1 or $_SESSION['priority_7'] == 1) + { + $tmpSQL = ' AND ('; + $orFlag = false; + if ($_SESSION['priority_0'] == 1) + { + $tmpSQL.='Priority=0'; + $orFlag=true; + } + if ($_SESSION['priority_1'] == 1) + { + if ($orFlag) + $tmpSQL.=' or '; + + $tmpSQL.='Priority=1'; + $orFlag=true; + } + if ($_SESSION['priority_2'] == 1) + { + if ($orFlag) + $tmpSQL.=' or '; + + $tmpSQL.='Priority=2'; + $orFlag=true; + } + if ($_SESSION['priority_3'] == 1) + { + if ($orFlag) + $tmpSQL.=' or '; + + $tmpSQL.='Priority=3'; + $orFlag=true; + } + if ($_SESSION['priority_4'] == 1) + { + if ($orFlag) + $tmpSQL.=' or '; + + $tmpSQL.='Priority=4'; + $orFlag=true; + } + if ($_SESSION['priority_5'] == 1) + { + if ($orFlag) + $tmpSQL.=' or '; + + $tmpSQL.='Priority=5'; + $orFlag=true; + } + if ($_SESSION['priority_6'] == 1) + { + if ($orFlag) + $tmpSQL.=' or '; + + $tmpSQL.='Priority=6'; + $orFlag=true; + } + if ($_SESSION['priority_7'] == 1) + { + if ($orFlag) + $tmpSQL.=' or '; + + $tmpSQL.='Priority=7'; + $orFlag=true; + } + + $tmpSQL.=')'; + } + else + { + $tmpSQL = ''; + } + $this->SQLWherePriority = $tmpSQL; + } + } + + /*! + * Use this to get a part of the sql where clause. + * This sort out the priority. + * \return A string, part of the SQL where clause (Priority restriction) + */ + function GetSQLWherePriority() + { + $this->SetSQLWherePriority(); + return $this->SQLWherePriority; + } + + + /*! + * Use this to get a part of the sql where clause. + * This search only for a single ip or host. + * \return A string, part of the SQL where clause (Host restriction) + */ + function GetSQLWhereHost() + { + $this->SetSQLWhereHost(); + return $this->SQLWhereHost; + } + + /*! + * Use this to get a part of the sql where clause. + * This is responsilbe for the limitation of the requested data by ip/host. + */ + function SetSQLWhereHost() + { + $tmpSQL=''; + // filhost must be validate in include! + if (isset($_SESSION['filhost'])) + { + if (!empty($_SESSION['filhost'])) + $tmpSQL.=" AND FromHost='".$_SESSION['filhost']."'"; + } + $this->SQLWhereHost = $tmpSQL; + + } + + /*! + * Use this to get a part of the sql where clause. + * This search only for a single ip or host. + * \return A string, part of the SQL where clause (Host restriction) + */ + function GetSQLWhereMsg() + { + $this->SetSQLWhereMsg(); + return $this->SQLWhereMsg; + } + + + /*! + * Use this to get a part of the sql where clause. + * This is responsilbe for the limitation of the requested data by ip/host. + */ + function SetSQLWhereMsg() + { + $tmpSQL=''; + // filhost must be validate in include! + if (isset($_SESSION['searchmsg'])) + { + if (!empty($_SESSION['searchmsg'])) + $tmpSQL.=" AND Message like '".db_get_wildcut().$_SESSION['searchmsg'].db_get_wildcut()."'"; + } + $this->SQLWhereMsg = $tmpSQL; + + } + + /*! + * Use this to get a part of the sql where clause. + * This is responsilbe for the limitation of the requested data by time. + */ + function SetSQLWherePart($time_only) + { + if($time_only == 1) + { + $this->SQLWherePart = $this->GetSQLWhereTime(); + } + else + { + $this->SQLWherePart = $this->GetSQLWhereTime().$this->GetSQLWhereInfoUnit().$this->GetSQLWherePriority().$this->GetSQLWhereHost().$this->GetSQLWhereMsg(); + } + } + + + /*! + * Use this to get a part of the sql where clause. + * This is responsilbe for the limitation of the requested data by time. + * \return A string, the SQL where part + */ + function GetSQLWherePart($time_only) + { + if($time_only == 1) + { + $this->SetSQLWherePart(1); + } + else + { + $this->SetSQLWherePart(0); + } + return $this->SQLWherePart; + } + + /*! + * Use this to get the part of the sql part, responsible for the sorting argument. + * \return A string, part of the SQL where clause (sorting argument) + */ + function GetSQLSort() + { + + switch ($this->OrderBy) + { + case "Date": + $tmpSQL = ' ORDER BY '._DATE.' DESC'; + break; + case "Facility": + $tmpSQL = ' ORDER BY Facility'; + break; + case "Priority": + $tmpSQL = ' ORDER BY Priority'; + break; + case "FacilityDate": + $tmpSQL = ' ORDER BY Facility, '._DATE.' DESC'; + break; + case "PriorityDate": + $tmpSQL = ' ORDER BY Priority, '._DATE.' DESC'; + break; + case "Host": + $tmpSQL = ' ORDER BY FromHost'; + break; + default: + $tmpSQL = ' ORDER BY '._DATE.' DESC'; + break; + } + return $tmpSQL; + } + } + +?> \ No newline at end of file diff --git a/classes/eventsnavigation.php b/classes/eventsnavigation.php new file mode 100644 index 0000000..2614e27 --- /dev/null +++ b/classes/eventsnavigation.php @@ -0,0 +1,157 @@ +. 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 = " « "; + $this->NavigationFirstPage = " «« "; + } + else + { + $this->NavigationLeftArrow = " « ";//unable + $this->NavigationFirstPage = " «« ";//enable + } + + if($this->GetPageNumber() < $page) + { + $this->NavigationRightArrow = " » "; + $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"); + + $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)); + $result = db_fetch_array($result); + $this->EventCount = $result[0]; //so many data records were found + } + + //! returns the total number of available events + function GetEventCount() + { + return $this->EventCount; + } + + function SetPageNumber($val) + { + $this->PageNumber = $val; + } + } + +?> \ No newline at end of file diff --git a/config.php b/config.php new file mode 100644 index 0000000..7af81a0 --- /dev/null +++ b/config.php @@ -0,0 +1,143 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + // Set some defaults + ini_set("register_globals", "1"); + + +/* +************************************************** +* Begin of config variables * +* * ** * * +* You can change these settings to your need * +* * ** * * +* Only change if you know what you are doing * +************************************************** +*/ +/* +***** BEGIN DATABASE SETTINGS ***** +*/ + + //Server name (only needed if you not use ODBC) + define('_DBSERVER', 'localhost'); + + // DSN (ODBC) or database name (Mysql) + define('_DBNAME', 'phplogcon'); + + // Userid for database connection *** + define('_DBUSERID', 'root'); + + // Password for database connection *** + define('_DBPWD', ''); + + // table name + define('_DBTABLENAME', 'systemevents'); + + // Switch for connection mode + // Currently only odbc and native works + define('_CON_MODE', 'native'); + + // Defines the Database Application you are using, + // because for example thx ODBC syntax of MySQL + // and Microsoft Access/SQL Server/etc are different + // Currently available are: + // with native: mysql + // with ODBC: mysql and mssql are available + define('_DB_APP', 'mysql'); + +/* +***** END DATABASE SETTINGS ***** +*/ +/* +***** BEGIN FOLDER SETTINGS ***** +*/ + + //The folder where the classes are stored + define('_CLASSES', 'classes/'); + + //The folder where the forms are stored + define('_FORMS', 'forms/'); + + //The folder where the database drivers are stored + define('_DB_DRV', 'db-drv/'); + + //The folder where the language files are stored + define('_LANG', 'lang/'); + + //your image folder + define('_ADLibPathImage', 'images/'); + + //folder for scripts i.g. extern javascript + define('_ADLibPathScript', 'layout/'); + +/* +***** END FOLDER SETTINGS ***** +*/ +/* +***** BEGIN VARIOUS SETTINGS ***** +*/ + + //Set to 1 and User Interface will be used! Set 0 to disable it. + define('_ENABLEUI', 0); + + //This sets the default language that will be used. + define('_DEFLANG', 'en'); + + // Use UTC time + define('_UTCtime', 1); + + // Get messages date by ReceivedAt or DeviceReportedTime + define('_DATE', 'ReceivedAt'); + + // Coloring priority + define('_COLPriority', 1); + +/* +***** END VARIOUS SETTINGS ***** +*/ + +/* +****************************************************** +* * ** * * +* From this point you shouldn't change something * +* * ** * * +* Only change if it is really required * +****************************************************** +*/ + + // Show quick filter enabled = 1, disabled = 0: + define('_FilterInfoUnit', 1); + define('_FilterOrderby', 1); + define('_FilterRefresh', 1); + define('_FilterColExp', 1); + define('_FilterHost', 1); + define('_FilterMsg', 1); + + //Session expire time. Unix-Timestamp. To set this value: + //call time(), that returns the seconds from 1.1.1970 (begin Unix-epoch) and add the + //time in seconds when the cookie should expire. + $session_time = (time()+(60*10)); + + //Cookie expire time. Unix-Timestamp. How to set this value, see "session_time". + define('_COOKIE_EXPIRE', (time()+60*60*24*30)); + +?> \ No newline at end of file diff --git a/db-drv/mysql.php b/db-drv/mysql.php new file mode 100644 index 0000000..4ffd874 --- /dev/null +++ b/db-drv/mysql.php @@ -0,0 +1,194 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + + /* + * This file contains the function for database connection + * via mysql + */ + + /*! \addtogroup DB Converter + * + * All converter functions using to prepare things to work with database queries + * use the prefix "dbc_" + * @{ + */ + + /* + * Generate the tags for a time argument using in a sql statment + * \param timestamp which need tags + * \return timestamp_with_tags returns the timestamp with tags in the nesessary format + */ + function dbc_sql_timeformat($times) + { + return "'".date("Y-m-d H:i:s", $times)."'"; + } + + /*! @} */ + + /* + * Database driver + */ + + /* + * Attempts to establish a connection to the database. + * /return the connection handle if the connection was successful, NULL if the connection was unsuccessful. + */ + function db_connection() + { + $db = mysql_connect(_DBSERVER, _DBUSERID, _DBPWD) or db_die_with_error(_MSGNoDBCon); + mysql_select_db(_DBNAME) or db_die_with_error(_MSGChDB); + return $db; + } + + function db_own_connection($host, $port, $user, $pass, $dbname) + { + if($port != 0) + $db = mysql_connect($host . ":" . $port, $user, $pass) or db_die_with_error(_MSGNoDBCon); + else + $db = mysql_connect($host, $user, $pass) or db_die_with_error(_MSGNoDBCon); + mysql_select_db($dbname) or db_die_with_error(_MSGChDB); + return $db; + } + + /* + * Executes the SQL. + * /param db Database connection handle + * /param cmdSQL SQL statement + * + * /return Resource handle + */ + function db_exec($db, $cmdSQL) + { + //echo "

" . $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) or db_die_with_error(_MSGNoRes); + return $result; + } + + /* + * Fetch a result row as an associative array, a numeric array, or both. + * /param res Rescource hanndle + * + * /return Returns an array that corresponds to the fetched row, or FALSE if there are no more rows. + */ + function db_fetch_array($res) + { + $result = mysql_fetch_array($res);// or db_die_with_error(_MSGNoRes); + return $result; + } + + /* + * db_fetch_singleresult is need in ODBC mode, so db_fetch_singleresult and db_fetch_array + * are the same in MySQL + */ + function db_fetch_singleresult($result) + { + $result = mysql_fetch_array($result) or db_die_with_error(_MSGNoRes); + return $result; + } + + /* + * Get the result data. + * /param res Rescource hanndle + * /param res_name either be an integer containing the column number of the field you want; + or it can be a string containing the name of the field. For example: + * + * /return the contents of one cell from the result set. + */ + function db_result($res, $res_name) + { + $result = mysql_result($res, 1, $res_name) or db_die_with_error(_MSGNoRes); + return $result; + } + + function db_close($db) + { + mysql_close($db) or db_die_with_error(_MSGNoDBHan); + } + + function db_num_count($cmdSQLwhere_part) + { + return 'SELECT COUNT(*) AS num FROM ' . _DBTABLENAME . $cmdSQLwhere_part; + } + + /* + * fetch a result row as an a numeric array + * the array points to the first data record you want to display + * at current page. You need it for paging. + */ + function db_exec_limit($db, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLwhere_part, $limitlower, $perpage) + { + $cmdSQL = $cmdSQLfirst_part . $cmdSQLmain_part . $cmdSQLwhere_part . " limit ".($limitlower-1)."," . $perpage; + return db_exec($db, $cmdSQL); + } + + function db_free_result($result) + { + return mysql_free_result($result); + } + + function db_errno() + { + return mysql_errno(); + } + + function db_error() + { + return mysql_error(); + } + + function db_die_with_error($MyErrorMsg) + { + $errdesc = mysql_error(); + $errno = mysql_errno(); + + $errormsg="
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 new file mode 100644 index 0000000..cabef19 --- /dev/null +++ b/db-drv/odbc_mssql.php @@ -0,0 +1,161 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + +/* +SQL_CURSOR_TYPE (integer) +SQL_CURSOR_FORWARD_ONLY (integer) +SQL_CURSOR_KEYSET_DRIVEN (integer) +SQL_CURSOR_DYNAMIC (integer) +SQL_CURSOR_STATIC (integer) +*/ + + /* + * This file contains the function for database connection + * via odbc + */ + + // Converter + + function dbc_sql_timeformat($timestamp) + { + //use '#' for MS Access + //return "#".date("Y-m-d H:i:s", $timestamp)."#"; + //return "#".date("m/d/Y H:i:s", $timestamp)."#"; + return "{ ts '".date("Y-m-d H:i:s", $timestamp)."' }"; + } + + // Driver + + function db_connection() + { + return odbc_connect(_DBNAME, _DBUSERID, _DBPWD, SQL_CUR_USE_ODBC); + } + + function db_own_connection($host, $port, $user, $pass, $dbname) + { + $db = odbc_connect($dbname, $user, $pass, SQL_CUR_USE_ODBC) or db_die_with_error(_MSGNoDBCon); + return $db; + } + + function db_exec($db, $cmdSQL) + { +// echo "

" . $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); + odbc_fetch_into($res, $myarray); + return $myarray; + } + + function db_result($res, $res_name) + { + return odbc_result($res, $res_name); + } + + function db_close($db) + { + odbc_close($db); + } + + function db_num_count($cmdSQLwhere_part) + { + return 'SELECT DISTINCT COUNT(*) AS num FROM ' . _DBTABLENAME . substr($cmdSQLwhere_part, 0, strpos($cmdSQLwhere_part, 'ORDER BY')); + } + + /* + * fetch a result row as an a numeric array, + * the array points to the first data record you want to display + * at current page. You need it for paging. + */ + function db_exec_limit($db, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLwhere_part, $limitlower, $perpage) + { + //you must move through the recordset + //until you reach the data record you want + //***if you know a better and more efficent methode, please let us know, too! + + $tmp = $perpage + $limitlower - 1; + $cmdSQL = $cmdSQLfirst_part . "TOP " . $tmp . " " . $cmdSQLmain_part . $cmdSQLwhere_part; + return db_exec($db, $cmdSQL); +/* + for($i = 1; $i < $limitlower; $i++) + $row = odbc_fetch_row($result); + + return $result; + */ + } + + function db_free_result($result) + { + return odbc_free_result($result); + } + + function db_errno() + { + return odbc_error(); + } + + function db_error() + { + return odbc_errormsg(); + } + + function db_die_with_error($MyErrorMsg) + { + $errdesc = odbc_errormsg(); + $errno = odbc_error(); + + $errormsg="
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 new file mode 100644 index 0000000..45412ec --- /dev/null +++ b/db-drv/odbc_mysql.php @@ -0,0 +1,184 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + + /* + * This file contains the function for database connection + * via mysql + */ + + /*! \addtogroup DB Converter + * + * All converter functions using to prepare things to work with database queries + * use the prefix "dbc_" + * @{ + */ + + /* + * Generate the tags for a time argument using in a sql statment + * \param timestamp which need tags + * \return timestamp_with_tags returns the timestamp with tags in the nesessary format + */ + function dbc_sql_timeformat($times) + { + return "'".date("Y-m-d H:i:s", $times)."'"; + } + + /*! @} */ + + /* + * Database driver + */ + + /* + * Attempts to establish a connection to the database. + * /return the connection handle if the connection was successful, NULL if the connection was unsuccessful. + */ + function db_connection() + { + return odbc_connect(_DBNAME, _DBUSERID, _DBPWD, SQL_CUR_USE_ODBC); + } + + function db_own_connection($host, $port, $user, $pass, $dbname) + { + $db = odbc_connect($dbname, $user, $pass, SQL_CUR_USE_ODBC) or db_die_with_error(_MSGNoDBCon); + return $db; + } + + /* + * Executes the SQL. + * /param db Database connection handle + * /param cmdSQL SQL statement + * + * /return Resource handle + */ + function db_exec($db, $cmdSQL) + { +// echo "

" . $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) + { + odbc_fetch_into($res, $myarray); + return $myarray; + } + + /* + * db_fetch_singleresult is need in ODBC mode, so db_fetch_singleresult and db_fetch_array + * are the same in MySQL + */ + function db_fetch_singleresult($result) + { + return odbc_fetch_array($result); + } + + /* + * Get the result data. + * /param res Rescource hanndle + * /param res_name either be an integer containing the column number of the field you want; + or it can be a string containing the name of the field. For example: + * + * /return the contents of one cell from the result set. + */ + function db_result($res, $res_name) + { + return odbc_result($res, 1, $res_name); + } + + function db_close($db) + { + odbc_close($db); + } + + function db_num_count($cmdSQLwhere_part) + { + return 'SELECT COUNT(*) AS num FROM ' . _DBTABLENAME . $cmdSQLwhere_part; + } + + /* + * fetch a result row as an a numeric array + * the array points to the first data record you want to display + * at current page. You need it for paging. + */ + function db_exec_limit($db, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLwhere_part, $limitlower, $perpage) + { + $cmdSQL = $cmdSQLfirst_part . $cmdSQLmain_part . $cmdSQLwhere_part . " limit ".($limitlower-1)."," . $perpage; + return db_exec($db, $cmdSQL); + } + + function db_free_result($result) + { + return odbc_free_result($result); + } + + function db_errno() + { + return odbc_error(); + } + + function db_error() + { + return odbc_errormsg(); + } + + function db_die_with_error($MyErrorMsg) + { + $errdesc = odbc_error(); + $errno = odbc_errno(); + + $errormsg="
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 new file mode 100644 index 0000000..f4f6e43 --- /dev/null +++ b/db-drv/odbc_mysql_.php @@ -0,0 +1,151 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + +/* +SQL_CURSOR_TYPE (integer) +SQL_CURSOR_FORWARD_ONLY (integer) +SQL_CURSOR_KEYSET_DRIVEN (integer) +SQL_CURSOR_DYNAMIC (integer) +SQL_CURSOR_STATIC (integer) +*/ + + /* + * This file contains the function for database connection + * via odbc + */ + + // Converter + + function dbc_sql_timeformat($timestamp) + { + //use '#' for MS Access + //return "#".date("Y-m-d H:i:s", $timestamp)."#"; + //return "#".date("m/d/Y H:i:s", $timestamp)."#"; + return "{ ts '".date("Y-m-d H:i:s", $timestamp)."' }"; + } + + // Driver + + function db_connection() + { + return odbc_connect(_DBNAME, _DBUSERID, _DBPWD, SQL_CUR_USE_ODBC); + } + + function db_exec($db, $cmdSQL) + { + //echo "

" . $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 new file mode 100644 index 0000000..a51f7b9 --- /dev/null +++ b/details.php @@ -0,0 +1,187 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + + require("include.php"); + + WriteStandardHeader(_MSGShwEvnDet); + +?> + + +
<<
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
" target="_blank">Google-Groups)
+ +"; + WriteFood(); +?> \ No newline at end of file diff --git a/doc/credits.htm b/doc/credits.htm new file mode 100644 index 0000000..3754554 --- /dev/null +++ b/doc/credits.htm @@ -0,0 +1,18 @@ + + +Credits + +

Credits

+

This project is funded by Adiscon +and initiated by Rainer Gerhards.

+

The core development team is:

+ +

[Doc Home] [MonitorWare Web Site]

+

Copyright © 2003 by Adiscon. +Initiated by Rainer Gerhards. See license for details.

+ + diff --git a/doc/design.htm b/doc/design.htm new file mode 100644 index 0000000..4400caf --- /dev/null +++ b/doc/design.htm @@ -0,0 +1,52 @@ + + + phpLogCon Design Goals + +

Design Goals

+

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.

+

Main Usage Points

+

phpLogCon is primarily being used for

+ +

For in-depth analysis, we recommend using the MonitorWare Console. It provides + advanced analysis capabilities not found inside phpLogCon.

+

Portability

+

phpLogCon is being implemented as a set of PHP scripts to ensure + portability between different platforms. Target platforms for phpLogCon + are:

+ +

The standard set of database systems is supported, that is

+ +

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). 

+

[Doc Home] [MonitorWare + Web Site]

+

Copyright © 2003 by Adiscon. Initiated by + Rainer Gerhards. See license for details.

+ + diff --git a/doc/developer-notes.htm b/doc/developer-notes.htm new file mode 100644 index 0000000..ad1f8ff --- /dev/null +++ b/doc/developer-notes.htm @@ -0,0 +1,39 @@ + + + phpLogCon - Developer notes + +

Developer notes

+

+ phpLogCon is an open source project. Feel free to change what you want. Here + you will find some hints and background knowledge about phpLogCon.

+

Gernarel database connection functions

+

The database function in phpLogCon are called similar to well-know commands from + e.g. php mysql functions. All database functions beginn with "db_" and + then a word that best describes the instruction. Sample: db_connect() - + should open a connection to the database. This is according to mysql_connect(). + So you know if you find db_fetch_array in phpLogCon for example, that this + function should fetch a result row as an associative array, a numeric array, or + both.

+

ODBC functions

+

phpLogCon support also database connection via ODBC. You can find the functions in + db-drv\odbc.php. The most functions are in a very low basic level. The + reason, a lot of the php ODBC functions don't work with all + versions of php. Also the usability often depends on the ODBC driver.

+

Known Issues
At the moment you can only use ODBC for query Microsoft databases like MSSQL, + Jet, ... A second database layer which can handle different sql formats should be implement in the future!

+

Include files

+

include.php

+

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!

+

 

+

[Doc Home] [MonitorWare + Web Site]

+

Copyright © 2003 by Adiscon. Initiated by + Rainer Gerhards. See license for details.

+ + diff --git a/doc/getting-started.htm b/doc/getting-started.htm new file mode 100644 index 0000000..0ac0ee5 --- /dev/null +++ b/doc/getting-started.htm @@ -0,0 +1,24 @@ + + + MonitorWare Web Interface - Getting Started + +

+ phpLogCon - Getting Started

+

Getting started with phpLogCon is just a few simple steps:

+ +

[Doc Home] [MonitorWare + Web Site]

+

Copyright © 2003 by Adiscon. Initiated by + Rainer Gerhards. See license for details.

+ + diff --git a/doc/history.htm b/doc/history.htm new file mode 100644 index 0000000..952054c --- /dev/null +++ b/doc/history.htm @@ -0,0 +1,11 @@ + + +phpLogCon - History + +

MonitorWare Web Interface - Release History

+

2003-03-05    Actual project was started

+

[Doc Home] [MonitorWare Web Site]

+

Copyright © 2003 by Adiscon. +Initiated by Rainer Gerhards. See license for details.

+ + diff --git a/doc/index.htm b/doc/index.htm new file mode 100644 index 0000000..6f13cbf --- /dev/null +++ b/doc/index.htm @@ -0,0 +1,33 @@ + + + phpLogCon 1.0 + +

phpLogCon 1.0

+

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.

+ +

See http://www.monitorware.com/en/ for + further details about the MonitorWare solution.

+

[Doc Home] [MonitorWare + Web Site]

+

Copyright © 2003 by Adiscon. Initiated by + Rainer Gerhards. See license for details.

+ + diff --git a/doc/license.htm b/doc/license.htm new file mode 100644 index 0000000..28c0228 --- /dev/null +++ b/doc/license.htm @@ -0,0 +1,12 @@ + + +MonitorWare Web Interface - License + +

MonitorWare Web Interface - License

+

MWWeb is currently under development. No license has yet been selected. Use +at your sole risk.

+

[Doc Home] [MonitorWare Web Site]

+

Copyright © 2003 by Adiscon. +Initiated by Rainer Gerhards. See license for details.

+ + diff --git a/doc/setup.htm b/doc/setup.htm new file mode 100644 index 0000000..e2409ca --- /dev/null +++ b/doc/setup.htm @@ -0,0 +1,34 @@ + + + phpLogCon - Setup + +

+ phpLogCon Setup

+ +

If you intend to use phpLogCon with a non-MonitorWare generated database, you + can easily do so. The key point is to make sure that the database contains all + necessary data at the right locations. You might want to look up the + MonitorWare schema to see what is needed. For syslog events, this should be + fairly simple to acomplish as only a limited set of fields is to be provided. + If you purchase our low-priced support contract, we will gladly assist you in + getting this going ;). Currently, the link to the schema is missing. This is + not by intention. If it is missing by the time you read us, contact + support@adiscon.com. The schema is of course provided freely, was just + not at hand while writing this...

+

[Doc Home] [MonitorWare + Web Site]

+

Copyright © 2003 by Adiscon. Initiated by + Rainer Gerhards. See license for details.

+ + diff --git a/doc/using.htm b/doc/using.htm new file mode 100644 index 0000000..04c6299 --- /dev/null +++ b/doc/using.htm @@ -0,0 +1,76 @@ + + + phpLogCon - Using + +

Using the Web Interface

+

General concepts

+

Overall Event Filter

+

+ All processing done by phpLogCon is relative to a user-selected filter. + That is, only events that match the applicable filter condition will be show. + In the initial release, the filter condition will be solely time-based. The + default filter is "today". Other filters are "the last nn minutes", + "the last nn hours", "today", "this week" and "from date ... to date ...". + The filter can always be set by following a link on top + of each web page.

Page Layout

+

Every page will follow a standard layout. It has three areas +

+

The header holds the top menu items and the current date and time. It + also has quick links to:

+ +

When we have the notation of a user inside phpLogCon, this should probably come + out of the user profile. Over time, we may also provide dynamic links based on + what the user did last.

+

The main work area is the primary display/work space. Obviously its + content is depending on the called function.

+

The footer holds some general information:

+ +

Homepage

+

The main work area of the home displays statistical information: +

+

Of course, all of this in respect to the current filter.

+

Utility functions

+

Configuration Page

+

The configuration page allows the user to specify settings important for the + overall operation of phpLogCon. So far, it will allow to configure: +

+

[Doc Home] [MonitorWare + Web Site]

+

Copyright © 2003 by Adiscon. Initiated by + Rainer Gerhards. See license for details.

+ + diff --git a/events-display.php b/events-display.php new file mode 100644 index 0000000..ada91bc --- /dev/null +++ b/events-display.php @@ -0,0 +1,224 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + require('include.php'); + + WriteStandardHeader(_MSGShwEvn); + + //classes + include _CLASSES . 'eventsnavigation.php'; + include _CLASSES . 'eventfilter.php'; + + //the splitted sql statement + $cmdSQLfirst_part = 'SELECT '; + $cmdSQLmain_part = 'ID, '._DATE.', Facility, Priority, FromHost, Message, InfoUnitID FROM '._DBTABLENAME; + $cmdSQLlast_part = ' WHERE '; + + //define the last part of the sql statment, e.g. the where part, ordery by, etc. + $myFilter = New EventFilter; + $cmdSQLlast_part .= $myFilter->GetSQLWherePart(0); + $cmdSQLlast_part .= $myFilter->GetSQLSort(); + + + //Set Priority Filter if activated + /*if ($Priority!=0) { + $cmdSQLlast_part .= " where Priority = ".$Priority; + } + */ + //amount of data records displayed + + if($_SESSION['epp'] < 1 || $_SESSION['epp'] > 100) + $myEventsNavigation = new EventsNavigation(20); + else + $myEventsNavigation = new EventsNavigation($_SESSION['epp']); + + $myEventsNavigation->SetEventCount($global_Con, $cmdSQLlast_part); + $num = $myEventsNavigation->GetEventCount(); + + include "quick-filter.php"; + +/* + echo "
"; + echo _MSGSrcExp . ": \t"; + echo ""; + echo "\tTemporally UNAVAIBLE!!"; + echo "
"; +*/ + + echo '
'; + + //SQL statement to get result with limitation + $res = db_exec_limit($global_Con, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLlast_part, $myEventsNavigation->GetLimitLower(), $myEventsNavigation->GetPageSize()); + + if($num == 0) + { + //output if no data exit for the search string + echo '
', _MSGNoData, ''; + } + else + { + echo ' + +
'; + echo _MSGEvn, ' ', $myEventsNavigation->GetLimitLower(), ' ', _MSGTo, ' ', $myEventsNavigation->GetLimitUpper(), ' ', _MSGFrm, ' ', $myEventsNavigation->GetEventCount(); + echo ''; + + $myEventsNavigation->ShowNavigation(); + +?> + +
+ + + + + + + + + + + +'; + echo ''; //date + echo ''; //facility + + // get the description of priority (and get the the right color, if enabled) + $pricol = 'TD' . $tc; + $priword = FormatPriority($row[3], $pricol); + echo ''; + + echo ''; //InfoUnit + echo ''; //host + + $message = htmlspecialchars($message); + + if(isset($_POST['regexp']) && $_POST['regexp'] != "") + { + $_POST['regexp'] = trim($_POST['regexp']); + $messageUp = strtoupper($message); + $regexpUp = strtoupper($_POST['regexp']); + $search_pos = strpos($messageUp, $regexpUp); + if($search_pos !== FALSE) + { + $regexpLng = strlen($_POST['regexp']); + $strCount = substr_count($messageUp, $regexpUp); + $strTmp = $message; + + $message = ""; + for($i = 0; $i < $strCount; $i++) + { + $messageUp = strtoupper($strTmp); + $search_pos = strpos($messageUp, $regexpUp); + $subStrSt = substr($strTmp, 0 , $search_pos); + $subStrExp = substr($strTmp, $search_pos, $regexpLng); + $subStrEnd = substr($strTmp, ($search_pos + $regexpLng)); + $message .= $subStrSt . '' . $subStrExp . ''; + 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 ''; //message + + //for changing colors + if($tc == 1) $tc = 2; + else $tc = 1; + /* + echo ""; + */ + echo ''; + } + + } + echo '
'.$row[1].''.$row[2].'', $priword, ''.$infounit.''.$row[4].'', $message, '".$row['Priority']."
'; + WriteFood(); +?> \ No newline at end of file diff --git a/filter-config-process.php b/filter-config-process.php new file mode 100644 index 0000000..18a3e04 --- /dev/null +++ b/filter-config-process.php @@ -0,0 +1,174 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + +include 'include.php'; + + + + /* + * Read all settings from cookie. If it not set, display a login screen. + * If the user authentified, read the settings from database. The user can + * also alter it's oven personal settings. For security reaseon the password + * is not store in the cookie. Therefore you must enter your password each time, + * if you want to change the settings. + */ + + +// General variables +$szRedirectLink = ""; +$szDescription = ""; + +global $global_Con; + +/* + // Get Action + if ( !isset($_POST['action'] ) ) + $_POST['action'] = ""; + + if ($_POST['action'] == "ChangeGeneralConfig") + { + if ( !isset($_POST["enableui"]) ) + $_POST["enableui"] = 0; + + setcookie("connection_mode", $_POST['connection_mode'], time()+(60*60*24*365*10), "/"); + +*/ + +/* if( strcmp($_POST["enableui"], $_COOKIE["enable_ui"]) != 0) + { + if($_POST["enableui"] == "0") + { + setcookie("usr", "standard", _COOKIE_EXPIRE, "/"); + setcookie("sesid", "0", _COOKIE_EXPIRE, "/"); + } + else + { + setcookie("usr", "|", _COOKIE_EXPIRE, "/"); + setcookie("sesid", "|", _COOKIE_EXPIRE, "/"); + } + setcookie("enable_ui", $_POST['enableui'], time()+(60*60*24*365*10), "/"); + } + + +$szRedirectLink = "index.php"; +$szDescription = "General settings have been updated"; +*/ + + +if( !isset($_POST['filConf']) ) + $_POST['filConf'] = ""; + +if($_POST['filConf'] == "FilterConfig") +{ + // configure filter settings + $_SESSION['ti'] = $_POST['ti']; + $_SESSION['order'] = $_POST['order']; + $_SESSION['refresh'] = $_POST['refresh']+0; // +0 make sure that is numeric + + // enable/disable quick filter options + $_SESSION['FilterInfoUnit'] = (isset($_POST['FilterInfoUnit'])) ? 1 : 0; + $_SESSION['FilterOrderby'] = (isset($_POST['FilterOrderby'])) ? 1 : 0; + $_SESSION['FilterRefresh'] = (isset($_POST['FilterRefresh'])) ? 1 : 0; + $_SESSION['FilterColExp'] = (isset($_POST['FilterColExp'])) ? 1 : 0; + $_SESSION['FilterHost'] = (isset($_POST['FilterHost'])) ? 1 : 0; + $_SESSION['FilterMsg'] = (isset($_POST['FilterMsg'])) ? 1 : 0; + + // Set new info unit filter options + if ($_SESSION['FilterInfoUnit'] == 1 or isset($_POST['fromConfig'])) + { + $_SESSION['infounit_sl'] = (isset($_POST['infounit_sl'])) ? 1 : 0; + $_SESSION['infounit_er'] = (isset($_POST['infounit_er'])) ? 1 : 0; + $_SESSION['infounit_o'] = (isset($_POST['infounit_o'])) ? 1 : 0; + } + + // Set new priority filter options + $_SESSION['priority_0'] = (isset($_POST['priority_0'])) ? 1 : 0; + $_SESSION['priority_1'] = (isset($_POST['priority_1'])) ? 1 : 0; + $_SESSION['priority_2'] = (isset($_POST['priority_2'])) ? 1 : 0; + $_SESSION['priority_3'] = (isset($_POST['priority_3'])) ? 1 : 0; + $_SESSION['priority_4'] = (isset($_POST['priority_4'])) ? 1 : 0; + $_SESSION['priority_5'] = (isset($_POST['priority_5'])) ? 1 : 0; + $_SESSION['priority_6'] = (isset($_POST['priority_6'])) ? 1 : 0; + $_SESSION['priority_7'] = (isset($_POST['priority_7'])) ? 1 : 0; + + // If all infounits are unchecked it makes no sense, + // because in this case, no messages were displayed. + // So, activate all infounit types + if($_SESSION['infounit_sl'] == 0 && $_SESSION['infounit_er'] == 0 & $_SESSION['infounit_o'] == 0) + { + $_SESSION['infounit_sl'] = 1; + $_SESSION['infounit_er'] = 1; + $_SESSION['infounit_o'] = 1; + } + + // If all priorities are unchecked it makes no sense, + // because in this case, no messages were displayed. + // So, activate all priority types + if($_SESSION['priority_0'] == 0 and $_SESSION['priority_1'] == 0 and $_SESSION['priority_2'] == 0 and $_SESSION['priority_3'] == 0 and $_SESSION['priority_4'] == 0 and $_SESSION['priority_5'] == 0 and $_SESSION['priority_6'] == 0 and $_SESSION['priority_7'] == 0) + { + $_SESSION['priority_0'] = 1; + $_SESSION['priority_1'] = 1; + $_SESSION['priority_2'] = 1; + $_SESSION['priority_3'] = 1; + $_SESSION['priority_4'] = 1; + $_SESSION['priority_5'] = 1; + $_SESSION['priority_6'] = 1; + $_SESSION['priority_7'] = 1; + } + + if(_ENABLEUI == 1) + { + //Save filter settings to database + if($_SESSION['savefiltersettings']) + { + $query = GetFilterConfigArray(); + for($i = 0; $i < count($query); $i++) + db_exec($global_Con, $query[$i]); + } + } +} + +$szRedirectLink = "filter-config.php"; +$szDescription = "Your Personal filter settings have been updated"; + + + +?> + + + +"; +?> + +Redirecting + +



+
+".$szDescription."

"; +echo "You will be redirected to this page in 1 second."; + +?> +
+ + \ No newline at end of file diff --git a/filter-config.php b/filter-config.php new file mode 100644 index 0000000..ca04d9a --- /dev/null +++ b/filter-config.php @@ -0,0 +1,203 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + + require("include.php"); + WriteStandardHeader(_MSGFilConf); + + // If filter settings have been changed in quick filter, reload the old settings + + if(isset($_SESSION['ti_old'])) + { + $_SESSION['ti'] = $_SESSION['ti_old']; + $_SESSION['infounit_sl'] = $_SESSION['infounit_sl_old']; + $_SESSION['infounit_er'] = $_SESSION['infounit_er_old']; + $_SESSION['infounit_o'] = $_SESSION['infounit_o_old']; + $_SESSION['order'] = $_SESSION['order_old']; + $_SESSION['refresh'] = $_SESSION['refresh_old']; + + session_unregister('ti_old'); + session_unregister('infounit_sl_old'); + session_unregister('infounit_er_old'); + session_unregister('infounit_o_old'); + session_unregister('order_old'); + session_unregister('refresh_old'); + } + +?> + + +
+
+ +

..:: ::..

+ +
+ + + + + + + + + + + + + + + +
:
: + +
This function has been turned off! Set this in config.php!
+ +
+ +
+ + +
+ +
+ + +

..:: ::..

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ : +
: + +
: + +
: + +
: + >SysLog
+ >EventReporter
+ > +
: + + >Emergency (0)
+ >Alert (1)
+ >Critical (2)
+ >Error (3)
+ >Warning (4)
+ >Notice (5)
+ >Info (6)
+ >Debug (7)
+
+ + + + + + + + + End this is not implemented yet! */ ?> + + + +
 
+ : +  
: + > +
: + > +
: + > +
: + > +
: + > +
: + > +
+ + + +
+ + \ No newline at end of file diff --git a/forms/color-expression.php b/forms/color-expression.php new file mode 100644 index 0000000..996f59f --- /dev/null +++ b/forms/color-expression.php @@ -0,0 +1,39 @@ +', _MSGinCol, ''; + +?> \ No newline at end of file diff --git a/forms/display-infounit.php b/forms/display-infounit.php new file mode 100644 index 0000000..15bac4a --- /dev/null +++ b/forms/display-infounit.php @@ -0,0 +1,3 @@ +SL> +ER> +O> \ No newline at end of file diff --git a/forms/events-date.php b/forms/events-date.php new file mode 100644 index 0000000..9fb0aca --- /dev/null +++ b/forms/events-date.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/forms/filter-host.php b/forms/filter-host.php new file mode 100644 index 0000000..9d67bae --- /dev/null +++ b/forms/filter-host.php @@ -0,0 +1,7 @@ +'; +?> \ No newline at end of file diff --git a/forms/logs-per-page.php b/forms/logs-per-page.php new file mode 100644 index 0000000..8a52b2d --- /dev/null +++ b/forms/logs-per-page.php @@ -0,0 +1,31 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + +?> + + diff --git a/forms/manually-date.php b/forms/manually-date.php new file mode 100644 index 0000000..66b4ad8 --- /dev/null +++ b/forms/manually-date.php @@ -0,0 +1,115 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + +?> + + + +All Events between: +  +  + and   +  +  + \ No newline at end of file diff --git a/forms/order-by.php b/forms/order-by.php new file mode 100644 index 0000000..6762ecd --- /dev/null +++ b/forms/order-by.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/forms/refresh.php b/forms/refresh.php new file mode 100644 index 0000000..941662a --- /dev/null +++ b/forms/refresh.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/forms/search-msg.php b/forms/search-msg.php new file mode 100644 index 0000000..770a9cb --- /dev/null +++ b/forms/search-msg.php @@ -0,0 +1,8 @@ +'; +?> \ No newline at end of file diff --git a/images/Head-Line.gif b/images/Head-Line.gif new file mode 100644 index 0000000..2c28f33 Binary files /dev/null and b/images/Head-Line.gif differ diff --git a/images/phplogcon.gif b/images/phplogcon.gif new file mode 100644 index 0000000..1589731 Binary files /dev/null and b/images/phplogcon.gif differ diff --git a/include.php b/include.php new file mode 100644 index 0000000..5371d41 --- /dev/null +++ b/include.php @@ -0,0 +1,740 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + /* + * This file validate all variable comming from the web, + * also it includes all necessary files (e.g. config, db-drv, ...) + * and provide some usefull functions + */ + + // disable error reporting + error_reporting(E_ALL); + + header("Pragma: no-cache"); + // very important to include config settings at beginning! + include 'config.php'; + + + session_cache_expire($session_time); + session_start(); + //*** Begin Validate var input and/or default values *** + + //The following is required for IIS! Otherwise it will cause an error "undefined index" + $_SERVER['QUERY_STRING'] = ''; + + if( !isset($_SESSION['save_cookies']) ) + session_register('save_cookies'); + + // select the language + // use the language code, only two letters are permitted + if (!isset($_SESSION['language'])) + { + $_SESSION['language'] = _DEFLANG; + } + + /* + * get the stylesheet to use + * only letters are permitted + */ + if (!isset($_SESSION['stylesheet'])) + { + $_SESSION['stylesheet'] = 'phplogcon'; // default + } + + if (!isset($_SESSION['debug'])) + { + $_SESSION['debug'] = 0; // default + } + + if (!isset($_SESSION['savefiltersettings'])) + { + $_SESSION['savefiltersettings'] = 0; // default + } + + /* + * Load the default quick filter settings, + * if the quick filter settings not configured yet. + */ + if (!isset($_SESSION['FilterInfoUnit'])) + $_SESSION['FilterInfoUnit'] = _FilterInfoUnit; + if (!isset($_SESSION['FilterOrderby'])) + $_SESSION['FilterOrderby'] = _FilterOrderby; + if (!isset($_SESSION['FilterRefresh'])) + $_SESSION['FilterRefresh'] = _FilterRefresh; + if (!isset($_SESSION['FilterColExp'])) + $_SESSION['FilterColExp'] = _FilterColExp; + if (!isset($_SESSION['FilterHost'])) + $_SESSION['FilterHost'] = _FilterHost; + if (!isset($_SESSION['FilterMsg'])) + $_SESSION['FilterMsg'] = _FilterMsg; + + + /* + * Function prepare strings from textboxes for using it for db queries. + */ + function PreStrFromTxt4DB($var) + { + if (get_magic_quotes_gpc()) + $var = stripslashes($var); + + return str_replace("'", "''", trim($var)); + } + + /* + * Function prepare strings from textboxes for output + */ + function PreStrFromTxt4Out($var) + { + if (get_magic_quotes_gpc()) + $var = stripslashes($var); + + return htmlspecialchars(trim($var)); + } + + /* + * Filtering by ip/host + * if a string for filter host submitted, check this string. + */ + if (isset($_POST['filhost'])) + { + $_SESSION['filhost'] = PreStrFromTxt4DB($_POST['filhost']); + $_POST['filhost'] = PreStrFromTxt4Out($_POST['filhost']); + } + else + $_SESSION['filhost'] = ''; + + + /* + * Filtering the message, msg must contain a certain string. + * if a string submitted, check this string. + */ + if (isset($_POST['searchmsg'])) + { + $_SESSION['searchmsg'] = PreStrFromTxt4DB($_POST['searchmsg']); + $_POST['searchmsg'] = PreStrFromTxt4Out($_POST['searchmsg']); + } + else + $_SESSION['searchmsg'] = ''; + + + /* + * For CLASS EventFilter (classes/eventfilter.php) + * get/set the "manually events date" + * only numbers are permitted + */ + function SetManuallyDateDefault() + { + $_SESSION['d1'] = 1; + $_SESSION['m1'] = 1; + $_SESSION['y1'] = 2004; + + $_SESSION['d2'] = date("d"); + $_SESSION['m2'] = date("m"); + $_SESSION['y2'] = date("Y"); + + } + if (isset($_POST['d1'])) + { + $tmp = true; + if (!is_numeric($_POST['d1'])) { $tmp = false; } + if (!is_numeric($_POST['m1'])) { $tmp = false; } + if (!is_numeric($_POST['y1'])) { $tmp = false; } + if (!is_numeric($_POST['d2'])) { $tmp = false; } + if (!is_numeric($_POST['m2'])) { $tmp = false; } + if (!is_numeric($_POST['y2'])) { $tmp = false; } + + if ($tmp) + { + //is ok, but add a int to ensure that it is now handled as an integer + $_SESSION['d1'] = $_POST['d1']+0; + $_SESSION['m1'] = $_POST['m1']+0; + $_SESSION['y1'] = $_POST['y1']+0; + $_SESSION['d2'] = $_POST['d2']+0; + $_SESSION['m2'] = $_POST['m2']+0; + $_SESSION['y2'] = $_POST['y2']+0; + } + else + SetManuallyDateDefault(); + + } + elseif (!isset($_SESSION['d1'])) + SetManuallyDateDefault(); + + // quick-filter.php + // manually or predefined + if (isset($_POST['change'])) + { + if ($_POST['change'] == 'Predefined') + $_SESSION['change'] = 'Predefined'; + else + $_SESSION['change'] = 'Manually'; + } + elseif (!isset($_SESSION['change'])) + $_SESSION['change'] = 'Predefined'; + + + // Apply changed quick filter settings + if( isset($_POST['quickFilter']) && $_POST['quickFilter'] == 'change' ) + { + // save current settings. Because: + // the quick filter and the filter config are using the same variables. + // when you change the quick filter settings, the filter settings + // would be changed to. + // settings must be reloaded in filter-config.php + $_SESSION['ti_old'] = $_SESSION['ti']; + $_SESSION['infounit_sl_old'] = $_SESSION['infounit_sl']; + $_SESSION['infounit_er_old'] = $_SESSION['infounit_er']; + $_SESSION['infounit_o_old'] = $_SESSION['infounit_o']; + $_SESSION['order_old'] = $_SESSION['order']; + $_SESSION['refresh_old'] = $_SESSION['refresh']; + + $_SESSION['ti'] = $_POST['ti']; + $_SESSION['infounit_sl'] = (isset($_POST['infounit_sl'])) ? 1 : 0; + $_SESSION['infounit_er'] = (isset($_POST['infounit_er'])) ? 1 : 0; + $_SESSION['infounit_o'] = (isset($_POST['infounit_o'])) ? 1 : 0; + $_SESSION['order'] = $_POST['order']; + $_SESSION['refresh'] = $_POST['refresh']; + } + + + //events-display.php + + // InitVariable(2, "search", ""); + // InitVariable(1, "regexp", ""); + + + // implement this + //InitVariable(1, "color", "red"); + + if (!isset($_SESSION['infounit_sl'])) + $_SESSION['infounit_sl'] = 1; + if (!isset($_SESSION['infounit_er'])) + $_SESSION['infounit_er'] = 1; + if (!isset($_SESSION['infounit_o'])) + $_SESSION['infounit_o'] = 1; + + if (!isset($_SESSION['priority_0'])) + $_SESSION['priority_0'] = 1; + if (!isset($_SESSION['priority_1'])) + $_SESSION['priority_1'] = 1; + if (!isset($_SESSION['priority_2'])) + $_SESSION['priority_2'] = 1; + if (!isset($_SESSION['priority_3'])) + $_SESSION['priority_3'] = 1; + if (!isset($_SESSION['priority_4'])) + $_SESSION['priority_4'] = 1; + if (!isset($_SESSION['priority_5'])) + $_SESSION['priority_5'] = 1; + if (!isset($_SESSION['priority_6'])) + $_SESSION['priority_6'] = 1; + if (!isset($_SESSION['priority_7'])) + $_SESSION['priority_7'] = 1; + + + // forms/events-date.php + // selected time interval, validation check of ti in eventfilter.php + if (!isset($_SESSION['ti'])) + $_SESSION['ti'] = 'today'; // default + + // forms/order-by.php + // validation in eventfilter.php + if (!isset($_SESSION['order'])) + $_SESSION['order'] = 'date'; + + // forms/refresh.php + if (!isset($_SESSION['refresh'])) + $_SESSION['refresh'] = 0; // default + + + /* + * forms/logs-per-page.php + * number of lines to be displayed, only numbers are allowed + */ + if (isset($_POST['epp'])) + { + if (is_numeric($_POST['epp'])) + $_SESSION['epp'] = $_POST['epp']+0; //+0 makes sure that is an int + else + $_SESSION['epp'] = 20; + } + elseif (!isset($_SESSION['epp'])) + $_SESSION['epp'] = 20; + + + //*** End Validate var input and/or default values *** + + //***Begin including extern files*** + + // include the language file + include _LANG . $_SESSION['language'] . '.php'; + //design things + include 'layout/theme.php'; + //include required database driver + if(strtolower(_CON_MODE) == "native") + include _DB_DRV . _DB_APP . ".php"; + else + include _DB_DRV . _CON_MODE . "_" . _DB_APP . ".php"; + //***End including extern files*** + + //***Global used variables + // Used to hold the global connection handle + $global_Con = db_connection(); + + + //***Begin usefull functions*** + + /************************************************************************/ + /* expect a path to a folder ('.' for current) and return all */ + /* filenames order by name + /************************************************************************/ + function GetFilenames($dir) + { + $handle = @opendir($dir); + while ($file = @readdir ($handle)) + { + if (eregi("^\.{1,2}$",$file)) + { + continue; + } + + if(!is_dir($dir.$file)) + { + $info[] = $file; + } + + } + @closedir($handle); + sort($info); + + return $info; + } + + /*! + * Remove the parameter $Arg from the given $URL + * \r Returns the url without the $Arg parameter + */ + + function RemoveArgFromURL($URL,$Arg) + { + while($Pos = strpos($URL,"$Arg=")) + { + if ($Pos) + { + if ($URL[$Pos-1] == "&") + { + $Pos--; + } + $nMax = strlen($URL); + $nEndPos = strpos($URL,"&",$Pos+1); + + if ($nEndPos === false) + { + $URL = substr($URL,0,$Pos); + } + else + { + $URL = str_replace(substr($URL,$Pos,$nEndPos-$Pos), '', $URL); + } + } + } + return $URL; + } + + //***End usefull functions*** + + + + // encodes a string one way + function encrypt($txt) + { + return crypt($txt,"vI").crc32($txt); + } + + // returns current date and time + function now() + { + $dat = getdate(strtotime("now")); + return "$dat[year]-$dat[mon]-$dat[mday] $dat[hours]:$dat[minutes]:00"; + } + + // it makes the authentification + function auth() + { + global $session_time; + + // if no session is available, but a cookie => the session will be set and the settings loaded + // if no session and no cookie is available => link to index.php to login will be displayed + if( !isset($_SESSION['usr']) ) + { + if( !isset($_COOKIE['valid']) || $_COOKIE['valid'] == "0" ) + { + WriteHead("phpLogCon :: " . _MSGAccDen, "", "", _MSGAccDen, 0); + echo "
..:: " . _MSGAccDen . " ::.."; + echo "

..:: " . _MSGBac2Ind . " ::.."; + exit; + } + else + { + session_register('usr'); + $_SESSION['usr'] = $_COOKIE['usr']; + LoadUserConfig(); + } + } + + /* + //*** FOR SESSION EXPIRE *** + //if(diff("now", $result["phplogcon_dtime"]) > $session_time) + if( !isset($_COOKIE["valid"]) ) + { + WriteHead("phpLogCon :: " . $msg030, "", "", $msg030, 0); + echo "
..:: " . _MSGSesExp . " ::..
"; + echo "
..:: " . _MSGReLog . " ::.."; + 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 ""; + } + + function CheckSQL($SQLcmd) + { + if( stristr($SQLcmd, "'") || stristr($SQLcmd, """)) + 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 "
"; + + // If a user is logged in, display logout text + if( isset($_COOKIE["usr"]) || $_COOKIE["usr"] != "|") + { + echo ''; + echo ''; + echo ''; + echo ''; + echo '
' . _MSGLogout . '
'; + } + } + else + { + /* + if(isset($_COOKIE["valid"])) + WriteHead("phpLogCon :: " . $myMsg, "", "", $myMsg, $_COOKIE["sesid"]); + else + WriteHead("phpLogCon :: " . $myMsg, "", "", $myMsg, 0); + */ + WriteHead("phpLogCon :: " . $myMsg , "", "", $myMsg); + } + } + + /*! + * Format the priority for displaying purposes. + * Get the number of the priority and change it to a word, + * also the default css style for design format is required. + * If coloring priority enabled, this function change the given + * param to the right color of the priority. + * + * /param pri - priority (number!) + * /param col - css style class (as a reference!) + * /ret priword - returns priority as a word + */ + function FormatPriority($pri, &$col) + { + $priword =''; + $tmpcol = ''; + switch($pri){ + case 0: + $priword = _MSGPRI0; + $tmpcol = 'PriorityEmergency'; + break; + case 1: + $priword = _MSGPRI1; + $tmpcol = 'PriorityAlert'; + break; + case 2: + $priword = _MSGPRI2; + $tmpcol = 'PriorityCrit'; + break; + case 3: + $priword = _MSGPRI3; + $tmpcol = 'PriorityError'; + break; + case 4: + $priword = _MSGPRI4; + $tmpcol = 'PriorityWarning'; + break; + case 5: + $priword = _MSGPRI5; + $tmpcol = 'PriorityNotice'; + break; + case 6: + $priword = _MSGPRI6; + $tmpcol = 'PriorityInfo'; + break; + case 7: + $priword = _MSGPRI7; + $tmpcol = 'PriorityDebug'; + break; + default: + die('priority is false'); + } + + // if coloring enabled + if (_COLPriority) { + $col = $tmpcol; + } + return $priword; + } + + /*! + Gets Args from the active URL and returns them. + !*/ + function GetSortedArgs() + { + $arCount = count($_SERVER["argv"]); + $sArgs = "?"; + + if($arCount == 0) + $sArgs = ""; + else + { + for($i = 0; $i < $arCount; $i++) + { + if($i > 0) + $sArgs .= "&" . $_SERVER["argv"][$i]; + else + $sArgs .= $_SERVER["argv"][$i]; + } + } + return $sArgs; + } + + /*! + Loads the Users Filter Configuration from database + !*/ + function LoadFilterConfig() + { + global $global_Con; + + $query = "SELECT Name, PropValue FROM UserPrefs WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_%'"; + $result = db_exec($global_Con, $query); + + while($value = db_fetch_array($result)) + { + $sValName = explode("PHPLOGCON_", $value['Name']); + $_SESSION["$sValName[1]"] = $value['PropValue']; + } + } + + function LoadUserConfig() + { + global $global_Con; + + $query = "SELECT Name, PropValue FROM userprefs WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_u%'"; + $result = db_exec($global_Con, $query); + while($value = db_fetch_array($result)) + { + $sValName = explode("PHPLOGCON_u", $value['Name']); + $_SESSION[strtolower($sValName[1])] = $value['PropValue']; + } + } + + /*! + Creates the array for saving the Filter Settings to database + !*/ + function GetFilterConfigArray() + { + if( !isset($_POST['infounit_sl']) ) + $query[0] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_sl'"; + else + $query[0] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_sl'"; + if( !isset($_POST['infounit_er']) ) + $query[1] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_er'"; + else + $query[1] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_er'"; + if( !isset($_POST['infounit_o']) ) + $query[2] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_o'"; + else + $query[2] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_infounit_o'"; + + if( !isset($_POST['priority_0']) ) + $query[3] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_0'"; + else + $query[3] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_0'"; + if( !isset($_POST['priority_1']) ) + $query[4] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_1'"; + else + $query[4] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_1'"; + if( !isset($_POST['priority_2']) ) + $query[5] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_2'"; + else + $query[5] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_2'"; + if( !isset($_POST['priority_3']) ) + $query[6] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_3'"; + else + $query[6] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_3'"; + if( !isset($_POST['priority_4']) ) + $query[7] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_4'"; + else + $query[7] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_4'"; + if( !isset($_POST['priority_5']) ) + $query[8] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_5'"; + else + $query[8] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_5'"; + if( !isset($_POST['priority_6']) ) + $query[9] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_6'"; + else + $query[9] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_6'"; + if( !isset($_POST['priority_7']) ) + $query[10] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_7'"; + else + $query[10] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_priority_7'"; + + + $query[11] = "UPDATE UserPrefs SET PropValue='" . $_POST['ti'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_ti'"; + $query[12] = "UPDATE UserPrefs SET PropValue='" . $_POST['order'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_order'"; + $query[13] = "UPDATE UserPrefs SET PropValue='" . $_POST['refresh'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_refresh'"; + + if( !isset($_POST['FilterInfoUnit']) ) + $query[14] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterInfoUnit'"; + else + $query[14] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterInfoUnit'"; + if( !isset($_POST['FilterOrderby']) ) + $query[15] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterOrderby'"; + else + $query[15] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterOrderby'"; + if( !isset($_POST['FilterRefresh']) ) + $query[16] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterRefresh'"; + else + $query[16] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterRefresh'"; + if( !isset($_POST['FilterColExp']) ) + $query[17] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterColExp'"; + else + $query[17] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterColExp'"; + if( !isset($_POST['FilterHost']) ) + $query[18] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterHost'"; + else + $query[18] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterHost'"; + if( !isset($_POST['FilterMsg']) ) + $query[19] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterMsg'"; + else + $query[19] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_FilterMsg'"; + + return $query; + } + + function GetUserConfigArray() + { + $query[0] = "UPDATE UserPrefs SET PropValue='" . $_POST['stylesheet'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uStylesheet'"; + $query[1] = "UPDATE UserPrefs SET PropValue='" . $_POST['language'] . "' WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uLanguage'"; + + if( !isset($_POST['savefiltersettings']) ) + $query[2] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uSaveFilterSettings'"; + else + $query[2] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uSaveFilterSettings'"; + if( !isset($_POST['debug']) ) + $query[2] = "UPDATE UserPrefs SET PropValue=0 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uDebug'"; + else + $query[2] = "UPDATE UserPrefs SET PropValue=1 WHERE UserLogin LIKE '" . $_SESSION['usr'] . "' AND Name LIKE 'PHPLOGCON_uDebug'"; + + return $query; + } + +?> diff --git a/index.php b/index.php new file mode 100644 index 0000000..14518a8 --- /dev/null +++ b/index.php @@ -0,0 +1,208 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + + include 'include.php'; + include _CLASSES . 'eventsnavigation.php'; + + + + if(_ENABLEUI == 1) + { + // *** WHEN TRUE, LOGOUT USER *** + if (isset($_GET['do'])) + { + if ($_GET['do'] == 'logout') + { + setcookie("usr", "|", _COOKIE_EXPIRE, "/"); + setcookie("valid", "0", _COOKIE_EXPIRE, "/"); + session_unset(); + header("Location: index.php"); + exit; + } + } + // **************************************** + } + + // if no session is available, but a cookie => the session will be set and the settings loaded + // if no session and no cookie is available => the login screen will be displayed + if( _ENABLEUI && !isset($_SESSION['usr']) ) + { + if(!isset($_COOKIE['valid']) || $_COOKIE['valid'] == "0") + { + WriteHead("phpLogCon :: Index", "", "", "phpLogCon"); + echo "
"; + + echo '', _MSG001, '.'; + echo '
'; + echo _MSGUsrnam, ':
'; + echo _MSGpas, ':
'; + echo _MSGSavCook, '
'; + echo ''; + echo '
'; + exit; + } + else + { + // reload + session_register('usr'); + $_SESSION['usr'] = $_COOKIE['usr']; + LoadUserConfig(); + header("Location: index.php"); + exit; + } + + if($_SESSION['save_cookies']) + { + setcookie("valid", $_COOKIE["valid"], _COOKIE_EXPIRE, "/"); + setcookie("usr", $_COOKIE["usr"], _COOKIE_EXPIRE, "/"); + } + } + + WriteHead("phpLogCon :: Index", "", "", "phpLogCon"); + echo "
"; + + include _CLASSES . 'eventfilter.php'; + + //the splitted sql statement + $cmdSQLfirst_part = "SELECT "; + //$cmdSQLmain_part = "* FROM "._DBTABLENAME; + $cmdSQLmain_part = 'ID, '._DATE.', Facility, Priority, FromHost, Message, InfoUnitID FROM '._DBTABLENAME; + $cmdSQLlast_part = " WHERE "; + + //define the last part of the sql statment, e.g. the where part, ordery by, etc. + $myFilter = New EventFilter; + $cmdSQLlast_part .= $myFilter->GetSQLWherePart(1); + $cmdSQLlast_part .= $myFilter->GetSQLSort(); + + $myEventsNavigation = new EventsNavigation(5); + $myEventsNavigation->SetPageNumber(1); + + $myEventsNavigation->SetEventCount($global_Con, $cmdSQLlast_part); + + $num = $myEventsNavigation->GetEventCount(); + + if(_ENABLEUI) + { + echo ''; + echo ''; + echo ''; + echo ''; + echo '
' . _MSGLogout . '
'; + echo '..:: ', _MSGLogSuc , ' ::..

'; + } + if(_ENABLEUI) + echo _MSGWel . ", " . $_SESSION["usr"] . "" . _MSGChoOpt; + else + echo _MSGWel . _MSGChoOpt; + $SQLcmdfirst_part = "SELECT DISTINCT "; + $SQLcmdmain_part = "(*) FROM "._DBTABLENAME; + $SQLcmdlast_part = " WHERE "; + $myFilter = New EventFilter; + $SQLcmdlast_part .= $myFilter->GetSQLWherePart(1); + + $result_sl = db_exec($global_Con, "SELECT DISTINCT COUNT(*) as num" . " FROM "._DBTABLENAME . $SQLcmdlast_part . " AND InfoUnitID=1"); + $row_sl = db_fetch_array($result_sl); + db_free_result($result_sl); + + $result_er = db_exec($global_Con, "SELECT DISTINCT COUNT(*) as num" . " FROM "._DBTABLENAME . $SQLcmdlast_part . " AND InfoUnitID=3"); + $row_er = db_fetch_array($result_er); + db_free_result($result_er); + + echo "

" . _MSGQuiInf . ":"; + echo "
"; + echo ""; + echo ""; + echo "
" . _MSGNumSLE . "" . $row_sl[0] . "
" . _MSGNumERE . "" . $row_er[0] . "
"; + echo "
" . _MSGTop5 . ":

"; + if($num == 0) + { + //output if no data exists for the search string + echo "
" . _MSGNoData . "!"; + } + else + { + echo ''; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $res = db_exec_limit($global_Con, $cmdSQLfirst_part, $cmdSQLmain_part, $cmdSQLlast_part, 1, 5); + + while($row = db_fetch_array($res)) + { + if (db_errno() != 0) + { + echo db_errno() . ": " . db_error(). "\n"; + } + + //choose InfoUnitdType 1 = SL = Syslog, 3 = Eventreport, O = Other + switch ($row[6]) + { + case 1: + $infounit = "SL"; + break; + case 3: + $infounit = "ER"; + break; + default: + $infounit = "O"; + } + static $tc = 1; + echo ''; + echo ''; //date + echo ''; //facility + + // get the description of priority (and get the the right color, if enabled) + $pricol = 'TD' . $tc; + $priword = FormatPriority($row[3], $pricol); + echo ''; + + echo ""; //InfoUnit + echo ""; //host + $message = $row[5]; + $message = str_replace("<", "<", $message); + $message = str_replace(">", ">", $message); + + echo ''; //message + + //for changing colors + if($tc == 1) $tc = 2; + else $tc = 1; + /* + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + */ + echo ""; + } + echo "
" . _MSGDate . "" . _MSGFac . "" . _MSGPri . "" . _MSGInfUI . "" . _MSGHost . "" . _MSGMsg . "
',$row[1],'',$row[2],'', $priword, '".$infounit."".$row[4]."', $message, '
".$row['ReceivedAt']."".$row['Facility']."".$row['Priority']."".$row['FromHost']."".$row['Message']."
"; + } + + WriteFood(); +?> \ No newline at end of file diff --git a/install/include.php b/install/include.php new file mode 100644 index 0000000..6aa94f0 --- /dev/null +++ b/install/include.php @@ -0,0 +1,91 @@ + + + + + + <?php echo $title; ?> + + + + + + + + + + + + + +
+

phpLogCon monitoring

+
+ + + + +
.: phpLogCon Installation :.
+

+ + + +
+ + + + +
+

+ phpLogCon, Copyright © 2003 - 2004 Adiscon GmbH +
+
+ + + +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + +include "include.php"; + + + +WriteHead("phpLogCon :: Installation"); + +?> + + +
Welcome to the installation of phpLogCon, the WebInterface to log data.
The following steps will guide you through the installation and help you to install and configure phpLogCon correctly.
Note: Fields marked with a * MUST be filled out! 'Host/IP' can be leaved blank in ODBC mode.
+

+
First we have to check your database structure, because phpLogCon needs some tables. If the tables don't exist, they will be created.
For this, phpLogCon Installation needs some information about your database Server:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
.: Database Settings :. 
Connection Type: * + +
Database application: * + +
Host/IP: *
Port (If standard, leave blank):
User (User must have "INSERT" and "CREATE" rights!): *
Password: *
Re-type password: *
Database/DSN name: *
Database time format: * + +
+ +

+
Now we have to do some settings for phpLogCon to run clearly and user optimized.
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.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
.: phpLogCon General Settings :. 
Default language: + +
User Interface: + Configure? +
Create a User: 
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!
Note: You only have to fill out the fields marked with a * if you have entered a username!
 
  
Username:
Display name: *
Password: *
Re-type password: *
Desired language: + +
  
 
+ + + \ No newline at end of file diff --git a/install/perform.php b/install/perform.php new file mode 100644 index 0000000..f27aa7a --- /dev/null +++ b/install/perform.php @@ -0,0 +1,277 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + +include "include.php"; +include "../lang/" . $_POST['lang'] . ".php"; + + + +WriteHead("phpLogCon :: Installation Progress"); + +?> + +
Checking users input... + +" . $strErrorMsg . ""; +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: " . $strErrorMsg . ""; + else + $strUiErrMsg = ""; + } +} + +if($strDbErrMsg != "" || $strUiErrMsg != "") +{ + echo "
"; + echo "While installing phpLogCon, there caused an error (Date: ".date("d.m.Y @ H:i")."):

"; + echo "Operation: Check user's input!
"; + echo "Error: You have to fill out following fields: " . $strDbErrMsg . "
" . $strUiErrMsg . "


Go back and correct this!
..:: Go back to installation ::..
"; + echo "

"; + exit; +} + +?> + +Done! +
Creating required tables... + + + +Done!
+
Inserting values into tables... + +", $_POST['uiuser'], $arQueries[$i]); + $arQueries[$i] = ereg_replace("", $_POST['uipass'], $arQueries[$i]); + $arQueries[$i] = ereg_replace("", $_POST['uidisname'], $arQueries[$i]); + $arQueries[$i] = ereg_replace("", $now, $arQueries[$i]); + $arQueries[$i] = ereg_replace("", $_POST['uilang'], $arQueries[$i]); + + db_exec($installCon, $arQueries[$i]); + } + elseif( stristr($arQueries[$i], "INSERT INTO UserPrefs") ) + { + $arQueries[$i] = ereg_replace("", $_POST['uiuser'], $arQueries[$i]); + db_exec($installCon, $arQueries[$i]); + } + } +} + +//close database connection +db_close($installCon); + +?> + +Done!
+
Creating your config file (config.php)... + + + +Done!
+
+ +
All processes have been done clearly!
Congratulations! You've successfully installed phpLogCon!
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.

Move to 'index.php' in root directory to start working with phpLogCon!

Don't forget to delete 'install.php', 'progress.php' and 'include.php' (NOT from root directory) from the 'install'-directory!
These files could be user for a DoS on your phpLogCon!
+

+ + \ No newline at end of file diff --git a/install/scripts/EventTables.sql b/install/scripts/EventTables.sql new file mode 100644 index 0000000..3aaf25e --- /dev/null +++ b/install/scripts/EventTables.sql @@ -0,0 +1,41 @@ +# phpLogCon - A Web Interface to Log Data. +# Copyright (C) 2003 - 2004 Adiscon GmbH +# +# This SQL file creates all required tables + +CREATE TABLE IF NOT EXISTS SystemEvents ( + ID int(10) unsigned NOT NULL auto_increment, + CustomerID int(11) NOT NULL default '0', + ReceivedAt datetime NOT NULL default '0000-00-00 00:00:00', + DeviceReportedTime datetime NOT NULL default '0000-00-00 00:00:00', + Facility int(11) NOT NULL default '0', + Priority int(11) NOT NULL default '0', + FromHost varchar(60) NOT NULL default '', + Message text NOT NULL, + NTSeverity char(3) NOT NULL default '', + Importance char(3) NOT NULL default '', + EventSource varchar(60) default NULL, + EventUser varchar(60) NOT NULL default '', + EventCategory int(11) NOT NULL default '0', + EventID int(11) NOT NULL default '0', + EventBinaryData text NOT NULL, + MaxAvailable int(11) NOT NULL default '0', + CurrUsage int(11) NOT NULL default '0', + MinUsage int(11) NOT NULL default '0', + MaxUsage int(11) NOT NULL default '0', + InfoUnitID int(11) NOT NULL default '0', + SysLogTag varchar(60) default NULL, + EventLogType varchar(60) default NULL, + GenericFileName varchar(60) default NULL, + SystemID int(11) NOT NULL default '0', + Checksum int(11) NOT NULL default '0', + PRIMARY KEY (ID) +) TYPE=MyISAM AUTO_INCREMENT=1 ; + + +CREATE TABLE IF NOT EXISTS SystemEventsProperties ( + ID int unsigned not null auto_increment primary key, + SystemEventID int NULL , + ParamName varchar (255) NULL , + ParamValue varchar (255) NULL +); diff --git a/install/scripts/UserInserts.sql b/install/scripts/UserInserts.sql new file mode 100644 index 0000000..39c90d2 --- /dev/null +++ b/install/scripts/UserInserts.sql @@ -0,0 +1,32 @@ +# phpLogCon - A Web Interface to Log Data. +# Copyright (C) 2003 - 2004 Adiscon GmbH +# +# This SQL file inserts values into 'Users' and 'UserPrefs' tables + +INSERT INTO Users VALUES ('', '', '', '', , 1, 100026, ''); + +INSERT INTO userprefs VALUES (1, '', 'PHPLOGCON_infounit_sl', '1'); +INSERT INTO userprefs VALUES (2, '', 'PHPLOGCON_infounit_er', '1'); +INSERT INTO userprefs VALUES (3, '', 'PHPLOGCON_infounit_o', '1'); +INSERT INTO userprefs VALUES (4, '', 'PHPLOGCON_priority_0', '1'); +INSERT INTO userprefs VALUES (5, '', 'PHPLOGCON_priority_1', '1'); +INSERT INTO userprefs VALUES (6, '', 'PHPLOGCON_priority_2', '1'); +INSERT INTO userprefs VALUES (7, '', 'PHPLOGCON_priority_3', '1'); +INSERT INTO userprefs VALUES (8, '', 'PHPLOGCON_priority_4', '1'); +INSERT INTO userprefs VALUES (9, '', 'PHPLOGCON_priority_5', '1'); +INSERT INTO userprefs VALUES (10, '', 'PHPLOGCON_priority_6', '1'); +INSERT INTO userprefs VALUES (11, '', 'PHPLOGCON_priority_7', '1'); +INSERT INTO userprefs VALUES (12, '', 'PHPLOGCON_ti', 'today'); +INSERT INTO userprefs VALUES (13, '', 'PHPLOGCON_order', 'Date'); +INSERT INTO userprefs VALUES (14, '', 'PHPLOGCON_refresh', '0'); +INSERT INTO userprefs VALUES (15, '', 'PHPLOGCON_FilterInfoUnit', '1'); +INSERT INTO userprefs VALUES (16, '', 'PHPLOGCON_FilterOrderby', '1'); +INSERT INTO userprefs VALUES (17, '', 'PHPLOGCON_FilterRefresh', '1'); +INSERT INTO userprefs VALUES (18, '', 'PHPLOGCON_FilterColExp', '1'); +INSERT INTO userprefs VALUES (19, '', 'PHPLOGCON_FilterHost', '1'); +INSERT INTO userprefs VALUES (20, '', 'PHPLOGCON_FilterMsg', '1'); +INSERT INTO userprefs VALUES (24, '', 'PHPLOGCON_favorites', 'www.adiscon.com|Adiscon,www.monitorware.com|MonitorWare,www.winsyslog.com|WinSysLog'); +INSERT INTO userprefs VALUES (21, '', 'PHPLOGCON_uStylesheet', 'matrix'); +INSERT INTO userprefs VALUES (22, '', 'PHPLOGCON_uLanguage', 'en'); +INSERT INTO userprefs VALUES (23, '', 'PHPLOGCON_uSaveFilterSettings', '1'); +INSERT INTO userprefs VALUES (25, '', 'PHPLOGCON_uDebug', '0'); diff --git a/install/scripts/UserTables.sql b/install/scripts/UserTables.sql new file mode 100644 index 0000000..6cc05d2 --- /dev/null +++ b/install/scripts/UserTables.sql @@ -0,0 +1,25 @@ +# phpLogCon - A Web Interface to Log Data. +# Copyright (C) 2003 - 2004 Adiscon GmbH +# +# This SQL file creates the 'Users' and 'UserPrefs' tables + +CREATE TABLE IF NOT EXISTS Users ( + UserID int(10) unsigned NOT NULL auto_increment, + UserIDText varchar(20) NOT NULL default '', + Password varchar(50) NOT NULL default '', + DisplayName varchar(50) NOT NULL default '', + LastLogon datetime NOT NULL default '0000-00-00 00:00:00', + UserType int(11) NOT NULL default '0', + HomeTZ int(11) NOT NULL default '0', + PrefCulture varchar(5) NOT NULL default '', + PRIMARY KEY (UserID) +) TYPE=MyISAM AUTO_INCREMENT=1 ; + + +CREATE TABLE IF NOT EXISTS UserPrefs ( + ID int(10) unsigned NOT NULL auto_increment, + UserLogin varchar(50) NOT NULL default '', + Name varchar(255) NOT NULL default '', + PropValue varchar(200) NOT NULL default '0', + PRIMARY KEY (ID) +) TYPE=MyISAM AUTO_INCREMENT=1 ; diff --git a/install/scripts/config.php.ex b/install/scripts/config.php.ex new file mode 100644 index 0000000..b692fb4 --- /dev/null +++ b/install/scripts/config.php.ex @@ -0,0 +1,143 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + // Set some defaults + ini_set("register_globals", "1"); + + +/* +************************************************** +* Begin of config variables * +* * ** * * +* You can change these settings to your need * +* * ** * * +* Only change if you know what you are doing * +************************************************** +*/ +/* +***** BEGIN DATABASE SETTINGS ***** +*/ + + //Server name (only needed if you not use ODBC) + define('_DBSERVER', 'localhost'); + + // DSN (ODBC) or database name (Mysql) + define('_DBNAME', 'monitorware'); + + // Userid for database connection *** + define('_DBUSERID', 'root'); + + // Password for database connection *** + define('_DBPWD', ''); + + // table name + define('_DBTABLENAME', 'systemevents'); + + // Switch for connection mode + // Currently only odbc and native works + define('_CON_MODE', 'native'); + + // Defines the Database Application you are using, + // because for example thx ODBC syntax of MySQL + // and Microsoft Access/SQL Server/etc are different + // Currently available are: + // with native: mysql + // with ODBC: mysql and mssql are available + define('_DB_APP', 'mysql'); + +/* +***** END DATABASE SETTINGS ***** +*/ +/* +***** BEGIN FOLDER SETTINGS ***** +*/ + + //The folder where the classes are stored + define('_CLASSES', 'classes/'); + + //The folder where the forms are stored + define('_FORMS', 'forms/'); + + //The folder where the database drivers are stored + define('_DB_DRV', 'db-drv/'); + + //The folder where the language files are stored + define('_LANG', 'lang/'); + + //your image folder + define('_ADLibPathImage', 'images/'); + + //folder for scripts i.g. extern javascript + define('_ADLibPathScript', 'layout/'); + +/* +***** END FOLDER SETTINGS ***** +*/ +/* +***** BEGIN VARIOUS SETTINGS ***** +*/ + + //Set to 1 and User Interface will be used! Set 0 to disable it. + define('_ENABLEUI', 0); + + //This sets the default language that will be used. + define('_DEFLANG', 'en'); + + // Use UTC time + define('_UTCtime', 0); + + // Get messages date by ReceivedAt or DeviceReportedTime + define('_DATE', 'ReceivedAt'); + + // Coloring priority + define('_COLPriority', 1); + +/* +***** END VARIOUS SETTINGS ***** +*/ + +/* +****************************************************** +* * ** * * +* From this point you shouldn't change something * +* * ** * * +* Only change if it is really required * +****************************************************** +*/ + + // Show quick filter enabled = 1, disabled = 0: + define('_FilterInfoUnit', 1); + define('_FilterOrderby', 1); + define('_FilterRefresh', 1); + define('_FilterColExp', 1); + define('_FilterHost', 1); + define('_FilterMsg', 1); + + //Session expire time. Unix-Timestamp. To set this value: + //call time(), that returns the seconds from 1.1.1970 (begin Unix-epoch) and add the + //time in seconds when the cookie should expire. + $session_time = (time()+(60*10)); + + //Cookie expire time. Unix-Timestamp. How to set this value, see "session_time". + define('_COOKIE_EXPIRE', (time()+60*60*24*30)); + +?> \ No newline at end of file diff --git a/lang/de.php b/lang/de.php new file mode 100644 index 0000000..01e21b3 --- /dev/null +++ b/lang/de.php @@ -0,0 +1,166 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + +/* +* German language file for phpLogCon +*/ + +define('_MSG001', 'Willkommen bei phpLogCon! Bittle loggen Sie sich zuerst mit Ihrem benutzernamen und Passwort ein'); +define('_MSGUsrnam', 'Benutzername'); +define('_MSGpas', 'Passwort'); +define('_MSGLogSuc', 'Login erfolgreich'); +define('_MSGWel', 'Willkommen bei phpLogCon'); +define('_MSGChoOpt', '! Wählen sie unter den Optionen aus dem obrigen Menü aus'); +define('_MSGQuiInf', 'Kurz-Info (Unter Berücksichtigung der Filtereinstellungen)'); +define('_MSGTop5', 'Top fünf Logs (Unter Berücksichtigung der Filtereinstellungen)'); +define('_MSGNoData', 'Keine Daten gefunden'); +define('_MSGDate', 'Datum'); +define('_MSGFac', 'Facility'); +define('_MSGMsg', 'Nachricht'); +define('_MSGAccDen', 'Zugang nicht gestattet'); +define('_MSGFalLog', 'Sie sind kein registrierter Benutzer oder Sie haben ein falsches Passwort eingegeben'); +define('_MSGBac2Ind', 'Zurück zum Index'); +define('_MSGSesExp', 'Session abgelaufen'); +define('_MSGSesExpQue', 'Session abgelaufen. Haben Sie vielleicht das letzte mal vergessen sich auszuloggen'); +define('_MSGReLog', 'Zurück zum Index um sich neu neu einzuloggen'); +define('_MSGShwEvn', 'Zeige Events'); +define('_MSGNoDBCon', 'Verbindung zum Datenbank-Server fehlgeschlagen'); +define('_MSGChDB', 'Auswahl der Datenbank fehlgeschlagen'); +define('_MSGInvQur', 'Ungültige Abfrage'); +define('_MSGNoRes', 'Kein gültiges Datenbank-Ergebnis'); +define('_MSGNoDBHan', 'Kein gültiger Datenbank-Verbindungs-Handle'); +define('_MSGLogout', 'LogOut'); +define('_MSGSrcExp', 'Nach Ausdruck suchen'); +define('_MSGSrc', 'Suche'); +define('_MSGColExp', 'Ausdruck färben'); +define('_MSGinCol', ' in dieser Farbe: '); +define('_MSGBrw', 'Durchsuchen'); +define('_MSGFilConf', 'Filter Konfiguration'); +define('_MSGUsrConf', 'Benutzer Konfiguration'); +define('_MSGBscSet', 'Generelle Einstellungen'); +define('_MSGConSet', 'Verbindungs Einstellungen'); +define('_MSGConMod', 'Verbindungsmodus'); +define('_MSGFilCon', 'Filter Bedingungen'); +define('_MSGEvnDat', 'Event Datum'); +define('_MSGOrdBy', 'Sortieren nach'); +define('_MSGRef', 'Aktualisierung'); +define('_MSGInfUI', 'InfoEinheit'); +define('_MSGOth', 'Andere'); +define('_MSGPri', 'Priorität'); +define('_MSGFilSet', 'Filter Einstellungen'); +define('_MSGUsrSet', 'Benutzer Einstellungen'); +define('_MSGFilOpt', 'Filter Optionen'); +define('_MSGSwiEvnMan', 'Event Datum manuell auswählen'); +define('_MSGSwiEvnPre', 'Event Datum vordefiniert auswählen'); +define('_MSGShwEvnDet', 'Zeige Event Details'); +define('_MSGBck', 'zurück'); +define('_MSGEvnID', 'EventID'); +define('_MSGClickBrw', ' (Klick um die MonitorWare Datenbank zu durchsuchen) :: (Oder durchsuche '); +define('_MSGEvnCat', 'EventKategorie'); +define('_MSGEvnUsr', 'EventBenutzer'); +define('_MSGFrmHos', 'VonHost'); +define('_MSGNTSev', 'NTSeverity'); +define('_MSGRecAt', 'EmpfangenAm'); +define('_MSGDevRep', 'VomGerätGemeldeteZeit'); +define('_MSGImp', 'Wichtigkeit'); +define('_MSGEvn', 'Event'); +define('_MSGTo', 'bis'); +define('_MSGFrm', 'von'); +define('_MSGLogPg', 'Logs pro Seite'); +define('_MSGHom', 'Startseite'); +define('_MSGHlp', 'Hilfe'); +define('_MSGFOpt', 'Filter Optionen'); +define('_MSGUOpt', 'Benutzer Optionen'); +define('_MSGEvnLogTyp', 'EventLogArt'); +define('_MSGEvnSrc', 'EventQuelle'); +define('_MSG2dy', 'heute'); +define('_MSGYester', 'nur gestern'); +define('_MSGThsH', 'aktuelle Stunde'); +define('_MSGLstH', 'letzte Stunde'); +define('_MSGL2stH', 'letzten 2 Stunden'); +define('_MSGL5stH', 'letzten 5 Stunden'); +define('_MSGL12stH', 'letzten 12 Stunden'); +define('_MSGL2d', 'letzten 2 Tage'); +define('_MSGL3d', 'letzten 3 Tage'); +define('_MSGLw', 'letzte Woche'); +define('_MSGFacDat', 'Facility und Datum'); +define('_MSGPriDat', 'Priorität und Datum'); +define('_MSGNoRef', 'nicht aktualisieren'); +define('_MSGE10s', 'alle 10 sek'); +define('_MSGE30s', 'alle 30 sek'); +define('_MSGEm', 'jede min'); +define('_MSGE2m', 'alle 2 min'); +define('_MSGE15m', 'alle 15 min'); +define('_MSGEn', 'Englisch'); +define('_MSGDe', 'Deutsch'); +define('_MSGFav', 'Favoriten'); +define('_MSGDel', 'Löschen'); +define('_MSGNoFav', 'Keine Favoriten gefunden'); +define('_MSGNewFav', 'Neuer Favorit'); +define('_MSGSiten', 'Seitenname'); +define('_MSGAdd', 'Hinzufügen'); +define('_MSGChg', 'Ändern'); +define('_MSGEnv', 'Umgebung'); +define('_MSGUsrInt', 'Benutzer Maske'); +define('_MSGUEna', 'Aktiviert'); +define('_MSGUDsa', 'Deaktiviert'); +define('_MSGNamInvChr', 'Name und/oder Passwort enthielten ungültige Zeichen'); +define('_MSGSitInvChr', 'Seitenname und/oder Adresse enthielten ungültige Zeichen'); +define('_MSGESec', 'jede Sekunde'); +define('_MSGE5Sec', 'alle 5 Sek'); +define('_MSGE20Sec', 'alle 20 Sek'); +define('_MSGRed', 'Rot'); +define('_MSGBlue', 'Blau'); +define('_MSGGreen', 'Grün'); +define('_MSGYel', 'Gelb'); +define('_MSGOra', 'Orange'); +define('_MSGFilHost', 'Suchen nach IP/Computer'); +define('_MSGSearchMsg', 'Nachricht muss folgendes enthalten'); +define('_MSGDisIU', 'Zeige Info Einheiten'); +define('_MSGEnbQF', 'Anzeigen von Quick-Filtern'); +define('_MSGSty', 'Aussehen'); +define('_MSGHost', 'Computer'); +define('_MSGPRI0', 'EMERGENCY'); +define('_MSGPRI1', 'ALERT'); +define('_MSGPRI2', 'CRITICAL'); +define('_MSGPRI3', 'ERROR'); +define('_MSGPRI4', 'WARNING'); +define('_MSGPRI5', 'NOTICE'); +define('_MSGPRI6', 'INFO'); +define('_MSGPRI7', 'DEBUG'); +define('_MSGNumSLE', 'Anzahl der Syslog Events'); +define('_MSGNumERE', 'Anzahl der EventReporter Events'); +define('_MSGNoMsg', '[Keine Nachricht vorhanden]'); +define('_MSGMenInf1', '- Sie befinden sich zur Zeit im '); +define('_MSGMenInf2', ' Modus auf '); +define('_MSGMenInf3', '. Datenbank: '); +define('_MSGLang', 'Sprache:'); +define('_MSGStyle', 'Stylesheet:'); +define('_MSGAddInfo', 'Zusätzliche Informationen:'); +define('_MSGDebug1', 'Debug:'); +define('_MSGDebug2', 'Zeige Debug Ausgaben'); +define('_MSGSave', 'Speicher/- Ladeoptionen:'); +define('_MSGFilSave1', 'Filter Einstellungen:'); +define('_MSGFilSave2', 'Filter Einstellungen in Datenbank speichern und beim Einloggen auslesen'); +define('_MSGDBOpt', 'Datenbankoptionen:'); +define('_MSGUTC1', 'UTC-Zeit:'); +define('_MSGUTC2', 'Wenn Ihr Datenbank-Server keine UTC-Zeit verwendet, entfernen Sie das Häckchen!'); +define('_MSGSavCook', 'Login behalten (Cookie)?'); diff --git a/lang/en.php b/lang/en.php new file mode 100644 index 0000000..75507a7 --- /dev/null +++ b/lang/en.php @@ -0,0 +1,166 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + +/* +* English language file for phpLogCon +*/ + +define('_MSG001', 'Welcome to phpLogCon! Please login with your username and password first'); +define('_MSGUsrnam', 'Username'); +define('_MSGpas', 'Password'); +define('_MSGLogSuc', 'Login successfully'); +define('_MSGWel', 'Welcome to phpLogCon'); +define('_MSGChoOpt', '! Choose an option from the menu above'); +define('_MSGQuiInf', 'Quick info (under respect of filter settings)'); +define('_MSGTop5', 'Top five logs (under respect of filter settings)'); +define('_MSGNoData', 'No data found'); +define('_MSGDate', 'Date'); +define('_MSGFac', 'Facility'); +define('_MSGPri', 'Priority'); +define('_MSGInfUI', 'InfoUnit'); +define('_MSGMsg', 'Message'); +define('_MSGAccDen', 'Access denied'); +define('_MSGFalLog', 'You are not a subscribed user or Invalid Password'); +define('_MSGBac2Ind', 'Back to Index'); +define('_MSGSesExp', 'Session Expired'); +define('_MSGSesExpQue', 'Session Expired. Maybe you forgot to log out'); +define('_MSGReLog', 'Back to Index to re-login'); +define('_MSGShwEvn', 'Show Events'); +define('_MSGNoDBCon', 'Cannot connect to database-server'); +define('_MSGChDB', 'Failed to changing database'); +define('_MSGInvQur', 'Invalid query'); +define('_MSGNoRes', 'No valid Database-Result'); +define('_MSGNoDBHan', 'No valid Database-Connection-Handle'); +define('_MSGLogout', 'Logout'); +define('_MSGSrcExp', 'Search for Expression'); +define('_MSGSrc', 'Search'); +define('_MSGinCol', ' in this color: '); +define('_MSGBrw', 'Browse'); +define('_MSGBscSet', 'Basic Settings'); +define('_MSGConSet', 'Connection Settings'); +define('_MSGConMod', 'Connection Mode'); +define('_MSGFilCon', 'Filter conditions'); +define('_MSGEvnDat', 'Event´s Date'); +define('_MSGOrdBy', 'Order by'); +define('_MSGRef', 'Refresh'); +define('_MSGOth', 'Other'); +define('_MSGFilSet', 'Filter Settings'); +define('_MSGUsrSet', 'User Settings'); +define('_MSGFilOpt', 'Filter Options'); +define('_MSGSwiEvnMan', 'Switch to select events date manually'); +define('_MSGSwiEvnPre', 'Switch to select events date predefined'); +define('_MSGShwEvnDet', 'Show Events Details'); +define('_MSGBck', 'back'); +define('_MSGEvnID', 'EventID'); +define('_MSGClickBrw', ' (Click for browsing MonitorWare database) :: (Or browse '); +define('_MSG2dy', 'today'); +define('_MSGYester', 'only yesterday'); +define('_MSGThsH', 'this hour'); +define('_MSGLstH', 'last 1 hour'); +define('_MSGL2stH', 'last 2 hours'); +define('_MSGL5stH', 'last 5 hours'); +define('_MSGL12stH', 'last 12 hours'); +define('_MSGL2d', 'last 2 days'); +define('_MSGL3d', 'last 3 days'); +define('_MSGLw', 'last week'); +define('_MSGFacDat', 'Facility and Date'); +define('_MSGPriDat', 'Priority and Date'); +define('_MSGNoRef', 'no refresh'); +define('_MSGE10s', 'every 10 sec'); +define('_MSGE30s', 'every 30 sec'); +define('_MSGEm', 'every min'); +define('_MSGE2m', 'every 2 min'); +define('_MSGE15m', 'every 15 min'); +define('_MSGEn', 'English'); +define('_MSGDe', 'German'); +define('_MSGFav', 'Favorites'); +define('_MSGDel', 'Delete'); +define('_MSGNoFav', 'No favorites found'); +define('_MSGNewFav', 'New favorite'); +define('_MSGSiten', 'Sitename'); +define('_MSGAdd', 'Add'); +define('_MSGChg', 'Change'); +define('_MSGEnv', 'Environment'); +define('_MSGUsrInt', 'User Interface'); +define('_MSGUEna', 'Enabled'); +define('_MSGUDsa', '"Disabled'); +define('_MSGNamInvChr', 'Name and/or password contained invalid characters'); +define('_MSGSitInvChr', 'Sitename and/or address contained invalid characters'); +define('_MSGESec', 'every second'); +define('_MSGE5Sec', 'every 5 sec'); +define('_MSGE20Sec', 'every 20 sec'); +define('_MSGRed', 'Red'); +define('_MSGBlue', 'Blue'); +define('_MSGGreen', 'Green'); +define('_MSGYel', 'Yellow'); +define('_MSGOra', 'Orange'); +define('_MSGSty', 'Style'); +define('_MSGEnbQF', 'Enable Quick Filters:'); +define('_MSGDisIU', 'Display Info Unit'); +define('_MSGColExp', 'Color an Expression'); +define('_MSGFilConf', 'Filter Configuration'); +define('_MSGUsrConf', 'User Configuration'); +define('_MSGHost', 'Host'); +define('_MSGEvnCat', 'EventCategory'); +define('_MSGEvnUsr', 'EventUser'); +define('_MSGFrmHos', 'FromHost'); +define('_MSGNTSev', 'NTSeverity'); +define('_MSGRecAt', 'ReceivedAt'); +define('_MSGDevRep', 'DeviceReportedTime'); +define('_MSGImp', 'Importance'); +define('_MSGEvn', 'Event'); +define('_MSGTo', 'to'); +define('_MSGFrm', 'from'); +define('_MSGLogPg', 'Logs per page'); +define('_MSGHom', 'Home'); +define('_MSGHlp', 'Help'); +define('_MSGFOpt', 'Filter Options'); +define('_MSGUOpt', 'User Options'); +define('_MSGEvnLogTyp', 'EventLogType'); +define('_MSGEvnSrc', 'EventSource'); +define('_MSGFilHost', 'Search only for IP/Host'); +define('_MSGSearchMsg', 'Message must contain'); +define('_MSGPRI0', 'EMERGENCY'); +define('_MSGPRI1', 'ALERT'); +define('_MSGPRI2', 'CRITICAL'); +define('_MSGPRI3', 'ERROR'); +define('_MSGPRI4', 'WARNING'); +define('_MSGPRI5', 'NOTICE'); +define('_MSGPRI6', 'INFO'); +define('_MSGPRI7', 'DEBUG'); +define('_MSGNumSLE', 'Number of Syslog Events'); +define('_MSGNumERE', 'Number of EventReporter Events'); +define('_MSGNoMsg', '[No message available]'); +define('_MSGMenInf1', '- You are currenty in '); +define('_MSGMenInf2', ' mode on '); +define('_MSGMenInf3', '. Database: '); +define('_MSGLang', 'Language:'); +define('_MSGStyle', 'Stylesheet:'); +define('_MSGAddInfo', 'Additional Informations:'); +define('_MSGDebug1', 'Debug:'); +define('_MSGDebug2', 'Show Debug Output'); +define('_MSGSave', 'Save/- Loadoptions:'); +define('_MSGFilSave1', 'Filter Settings:'); +define('_MSGFilSave2', 'Save filter settings in database and load them while logging in'); +define('_MSGDBOpt', 'Databaseoptions:'); +define('_MSGUTC1', 'UTC Time:'); +define('_MSGUTC2', 'When your database-server doesn\'t use UTC time, uncheck this!'); +define('_MSGSavCook', 'Keep you logged in (Cookie)?'); diff --git a/layout/common.js b/layout/common.js new file mode 100644 index 0000000..0696f27 --- /dev/null +++ b/layout/common.js @@ -0,0 +1,19 @@ +function NewWindow(WindowName,X_width,Y_height,Option) +{ + var Addressbar = "location=NO"; //Default + var OptAddressBar = "AddressBar"; //Default adress bar + if (Option == OptAddressBar) + { + Addressbar = "location=YES"; + } + window.open('',WindowName, + 'toolbar=no,' + Addressbar + ',directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + X_width + + ',height=' + Y_height); +} + +function GotoSite() +{ + var szUrl = ""; + szUrl = document.BookmarkConfiguration.favorites.options.selectedIndex; + window.open(szUrl,"",""); +} \ No newline at end of file diff --git a/layout/matrix.css b/layout/matrix.css new file mode 100644 index 0000000..c0a2c59 --- /dev/null +++ b/layout/matrix.css @@ -0,0 +1,219 @@ +P +{ + font-family: Tahoma, Arial; + font-size: 10pt +} +TD +{ + border-width:0; + border-right: black 0px solid; + border-left: black 0px solid; + border-style:solid; + border-color:#000055; +} +H1 +{ + font-weight: bold; + color: #0AAD79; + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + letter-spacing: 3px; +} +a:link,a:active,a:visited +{ + text-decoration: underline; + color : #78DBF7; +} +a:hover +{ + text-decoration: underline; + color : #5B4CF5; +} +body +{ + background-color: #000000; + + margin: 0px; + padding: 0px; + + scrollbar-face-color: #DEE3E7; + scrollbar-highlight-color: #FFFFFF; + scrollbar-shadow-color: #DEE3E7; + scrollbar-3dlight-color: #D1D7DC; + scrollbar-arrow-color: #006699; + scrollbar-track-color: #EFEFEF; + scrollbar-darkshadow-color: #98AAB1; + + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 10pt; + color: #FFFFFF; +} + +table +{ + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 10pt; + color: #FFFFFF; +} +/* + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; + padding-top: 0px; + border-collapse: collapse; +*/ + +.ConfigTable +{ + border: 1px solid; + border-color:#00FF00; + + margin: 1px; + padding-left: 5px; +} + +.EventTable +{ + border: black 0px solid; + padding: 5px; + border-spacing: 2px; +} + +.TDHEADER +{ + background-color: #1D3D33; + + border-right: black 0px solid; + border-left: black 0px solid; + border-top: black 0px solid; + border-bottom: black 0px solid; + + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 10pt; + font-weight : bold; + color: #FFFFFF; + text-decoration: none; +} +.TD1 +{ + background-color: #0D7B5A; + + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 8pt; + font-weight : bold; + color: #FFFFFF; + text-decoration: none; +} +.TD1:link,.TD1:active,.TD1:visited +{ + color : #FFFFFF ; +} +.TD1:hover +{ + background-color: #DCEEE8; + color: #000000; +} +.TD2 +{ + background-color: #2BBA8E; + + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 8pt; + font-weight : bold; + color: #FFFFFF; + text-decoration: none; +} +.TD2:link,.TD2:active,.TD2:visited +{ + color : #000000 ; +} +.TD2:hover +{ + background-color: #DCEEE8; + color: #000000; +} + +.Header1 +{ + background-color: #BCC1C5; + + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 10pt; + font-weight : bold; +} +.PriorityEmergency +{ + color: #FFFFFF; + background-color: #ff4444; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} +.PriorityAlert +{ + color: #FFFFFF; + background-color: #dd00dd; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} +.PriorityCrit +{ + color: #FFFFFF; + background-color: #dd9900; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} +.PriorityError +{ + color: #FFFFFF; + background-color: #CC0000; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} +.PriorityWarning +{ + color: #FFFFFF; + background-color: #FFAA00; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} +.PriorityNotice +{ + color: #FFFFFF; + background-color: #66CC33; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} +.PriorityInfo +{ + color: #000000; + background-color: #ABF1FF; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} +.PriorityDebug +{ + color: #FFFFFF; + background-color: #3333ff; + border-top: black 1px solid; + border-bottom: black 1px solid; + border-right: gray 1px solid; +} + +.Msg +{ + +} +.Msg:link,.Msg:active,.Msg:visited +{ + +} +.Msg:hover +{ + +} \ No newline at end of file diff --git a/layout/matrix.js b/layout/matrix.js new file mode 100644 index 0000000..906c556 --- /dev/null +++ b/layout/matrix.js @@ -0,0 +1,48 @@ +//Matrix Script +var density=0.2; +var colors=new Array('#030','#060','#393','#6C6','#fff'); +var minL=5; var maxL=30; +var minS=30; var maxS=80; +var cW=11; var cH=11; +var ascSt=33; var ascEnd=126; +var DOM=(document.getElementById)?true:false; +var scrW,scrH; +var cl=new Array; + +function init() +{ + scrW=document.body.clientWidth-25-cW; + scrH=document.body.clientHeight; + if (!scrW) + { + scrW = 750; + scrH = 550; + } + for (var clN=0;clN'); + for (var cN=0;cN<=cl[clN][2];cN++) document.write(''+String.fromCharCode(Math.round(Math.random()*(ascEnd-ascSt)+ascSt))+'
'); + document.write(''); + 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]. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + /*! \addtogroup Layout + * + * Here you find the basic structure of the page layout. Changes in the + * following function take affect in the hole phpLogCon projeckt. Note, + * the basic structure of each phpLogCon page must be generated by the + * use of the WriteHead() and WriteFood(). If you make a new phpLogCon + * page, first call WriteHead(). This function generate the hole header + * of the page. WriteHead() itself calls functions to generate the top + * menu bar (MenuTop()) and the menu on the left side (MenuLeft()). + * After this function call you are in the main work area. There you + * can provide your content information. To finialize the page, call + * WriteFood(). This generates the footer on the bottom of the page. + * @{ + */ + + /*! + * Include the stylesheeh + * + */ + + + /*! + * generate the url for pint version + * /return The Url refer to the pint version of the current page. + */ + function GetPrinterURL() + { + global $PHP_SELF, $QUERY_STRING; + + $szURL = $PHP_SELF . "?"; + if(strlen($QUERY_STRING) > 0) + $szURL .= $QUERY_STRING . "&"; + $szURL .= "PrinterVersion=1"; + + return($szURL); + } //end function GetPrintUrl() + + /*! + * Display logo and provide the link to change to print version. ... + * This things are displayed on the top of the page. + * + * Menu Top is called by WriteHead() + * + * \param SiteName This String is displayed on the top of the page (it is visible output!) + * \sa WriteHead() + */ + function MenuTop($SiteName) + { + global $strBasePath, $strBaseRealPath, $PrinterVersion; + +?> + + + + + + +
+

phpLogCon monitoring

+
+ + + + + + + +
+ | + | | | + | + " . strtoupper(_CON_MODE) . "" . _MSGMenInf2 . "" . strtoupper(_DB_APP) . "" . _MSGMenInf3 . "" . strtoupper(_DBNAME) . "";?> +   + +
+ + + + + + <? echo $strTitle; ?> + + + + + + 0) + { + echo ""; + } + + // if refresh enabled, make a meta redirect + if ($_SESSION['refresh'] > 0) + echo ''; + +?> + + +'; ?> + + + + + + +
+ + + + +
+

+ phpLogCon, Copyright © 2003 - 2004 Adiscon GmbH +
+
+ + + + \ No newline at end of file diff --git a/phplogcon.ini b/phplogcon.ini new file mode 100644 index 0000000..e100396 --- /dev/null +++ b/phplogcon.ini @@ -0,0 +1,9 @@ +# ********************************************* +# This is the external config file of phpLogCon. +# ********************************************* + +# wordsdontshow: Here you can enter some words that shouldn't be displayed in the events-display. +# case-INsensitive!! +# e.g.: wordsdontshow=Agent, Service, User +[phplogcon] +wordsdontshow= \ No newline at end of file diff --git a/quick-filter.php b/quick-filter.php new file mode 100644 index 0000000..89a8f0e --- /dev/null +++ b/quick-filter.php @@ -0,0 +1,113 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + +?> + +
+ +', _MSGFilOpt, ''; + + // 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 ' ', _MSGEvnDat, ' '; + include _FORMS.'events-date.php'; + echo ' ', _MSGLogPg, ': '; + include _FORMS.'logs-per-page.php'; + + ShowVarFilter(); + + echo ''; + } + else + { + echo ' '; + include _FORMS.'manually-date.php'; + echo ' '; + include _FORMS.'logs-per-page.php'; + + ShowVarFilter(); + + echo ''; + } + +?> + +
+ +
+'; + //echo "" . _MSGSwiEvnMan . ""; + else + echo ''; + //echo "" . _MSGSwiEvnPre . ''; + +?> +
+ + diff --git a/submit.php b/submit.php new file mode 100644 index 0000000..bb85a0c --- /dev/null +++ b/submit.php @@ -0,0 +1,88 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + +// global _DBNAME, _DBUSERID, _DBPWD, _DBSERVER, $session_time; + include 'include.php'; + + if( !isset($_POST['save_cookies'])) + $_POST['save_cookies'] = 0; + + + if( stristr($_POST['pass'], "'") || stristr($_POST['pass'], '"') || stristr($_POST['usr'], "'") || stristr($_POST['usr'], '"')) + { + WriteHead('phpLogCon :: ' , _MSGAccDen, '', '', _MSGAccDen, 0); + print '
..:: ' . _MSGNamInvChr . ' ::..
'; + echo '
..:: ', _MSGBac2Ind, ' ::..'; + db_close($global_Con); + + exit; + } + else + { + $query = "SELECT UserIDText, Password FROM Users WHERE UserIDText LIKE '" . $_POST['usr'] . "' AND Password LIKE '" . $_POST['pass'] . "'"; + $result = db_exec($global_Con, $query);// or die(db_die_with_error(_MSGInvQur . " :" . $query)); + $num = db_num_rows($result); + $result = db_fetch_singleresult($result); + /* + echo $num . "
"; + echo $result["UserIDText"] . "
"; + echo $result["phplogcon_lastlogin"] . "
"; + exit; + */ + + if ($num == 0) + { + WriteHead("phpLogCon :: " . _MSGAccDen, "", "", _MSGAccDen, 0); + print "
..:: " . _MSGFalLog . " ::..
"; + echo "
..:: " . _MSGBac2Ind . " ::.."; + db_close($global_Con); + exit; + } + else + { + // $dat = now(); + // db_exec($global_Con, "UPDATE users SET phplogcon_lastlogin = ".dbc_sql_timeformat($dat)." WHERE UserIDText LIKE '".$_POST["usr"]."'"); + session_register('save_cookies'); + if($_POST['save_cookies'] == 1) + { + $_SESSION['save_cookies'] = $_POST['save_cookies']; + setcookie("valid", 1, _COOKIE_EXPIRE, "/"); + setcookie("usr", $result["UserIDText"], _COOKIE_EXPIRE, "/"); + } + else + $_SESSION['save_cookies'] = 0; + + session_register("usr"); + $_SESSION["usr"] = $result["UserIDText"]; + + LoadUserConfig(); + // Loading Users Config when enabled + if($_SESSION['savefiltersettings']) + LoadFilterConfig(); + + db_close($global_Con); + header("Location: index.php"); + + } + } +?> \ No newline at end of file diff --git a/user-config-process.php b/user-config-process.php new file mode 100644 index 0000000..f6ce381 --- /dev/null +++ b/user-config-process.php @@ -0,0 +1,143 @@ +. 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"], """) || stristr($_POST["url"], "'") || stristr($_POST["url"], """)) + $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"; + +?> + + + +"; +?> + +Redirecting + +



+
+".$szDescription."

"; +echo "You will be redirected to this page in 1 second."; + +?> +
+ + \ No newline at end of file diff --git a/user-config.php b/user-config.php new file mode 100644 index 0000000..9f30346 --- /dev/null +++ b/user-config.php @@ -0,0 +1,177 @@ +. See AUTHORS to learn who helped make +it become a reality. + +*/#### #### #### #### #### #### #### #### #### #### + + + + require("include.php"); + WriteStandardHeader(_MSGUsrConf); + +?> + +
+
+ + +

..:: ::..

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ : +  
+ +
+ +
+ +  
+ >
+
+ +  
+ >
+
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + +
+ Bookmarks: +  
+'; + $sites = explode(",", $result["PropValue"]); + $sitecntr = count($sites); + for($i = 0; $i < $sitecntr; $i++) + { + $site = explode("|", $sites[$i]); + echo ""; + } + echo ''; + echo "\t\t"; + echo "\t\t"; + echo "Sorry, GoTo Site is disabled at the moment!"; + } + else + echo _MSGNoFav + +?> + +
+ +
: + :
+ URL: + +
+ +
+ + \ No newline at end of file