Merged Beta branch into stable, which now becomes v2.4.0

Also fixed merge conflicts

Merge branch 'beta' into v2-stable

Conflicts:

	ChangeLog
	src/include/functions_common.php
This commit is contained in:
Andre Lorbach 2008-09-24 15:43:33 +02:00
commit b7aed12a28
44 changed files with 3473 additions and 561 deletions

106
ChangeLog
View File

@ -1,7 +1,88 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Version 2.4.0 (v2-stable), 2008-09-24
- Merged beta branch into v2-stable branch.
---------------------------------------------------------------------------
Version 2.3.11 (beta), 2008-09-08
- Fix another parsing issue in the logline parser. Most of RFC 3164
formatted syslog messages should now be correctly splitted into their
fields.
---------------------------------------------------------------------------
Version 2.3.10 (beta), 2008-08-27
- Fixed a few parsing issues with prior RFC 3164 syslog messages.
These messages are now correctly parsed, or better do not cause
any parsing problems anymore.
---------------------------------------------------------------------------
Version 2.3.9 (beta), 2008-08-07
- Fixed a bug in the parsing of RFC 3164 date and time stamps which
occured from the 1st to the 9th of each month. During this time, the
date was not correctly parsed.
- Enhanced detail popup window, it performs much better now and is less
annoying. It still can be turned off very easily.
- Fixed an image alignment problem of the message once and for all.
---------------------------------------------------------------------------
Version 2.3.8 (beta), 2008-07-28
- Fixed a "notice" bug in the installer, which was missing to save the
DBType for MYSQL Datasource.
- Fixed a bug in the pdo logstream class which caused display of empty
rows when no records where found.
- Fixed Bug ID82 from bugtracker. Internal and invalid IP Addresses are
not linked to whois anymore.
- Fixed Line Ending to Unix in some code files.
---------------------------------------------------------------------------
Version 2.3.7 (beta), 2008-07-07
- Added missing db mapping for program field of syslogng - thanks to
Micha "Wolvverine" Panasiewicz
- Added translation for Brazilian Portuguese, thanks to Ricardo Maraschini
---------------------------------------------------------------------------
Version 2.2.0 (v2-stable), 2008-06-10 Version 2.2.0 (v2-stable), 2008-06-10
- Moved beta branch to v2-stable branch. - Moved beta branch to v2-stable branch.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Version 2.3.6 (devel), 2008-06-09
- Added new feature, multiple configureable views which can be configured
and selected for each source seperately. Old configurations can still
be used with the new Views feature. The installer also supports
selecting the default View for the first added source.
---------------------------------------------------------------------------
Version 2.3.5 (devel), 2008-06-06
- Enhanced the detected of IP Addresses and domain names, so the automatic
generated context links match better now.
- Added new option (enabled by default) to resolve IP Addresses into
hostnames. Note that this will only be done if the IP Address is NOT in
square brackets. The resolved names will be cached in the users session,
to speed up the resolving process. The resolved IP Addresses will be
injected behind the IP Address in curly brackets, and a diffirent colour.
---------------------------------------------------------------------------
Version 2.3.4 (devel), 2008-06-02
- Added new feature to automatically link IP and domain names with our
whois search engine. So you can research these informations with one
click.
- Changed Online Search Parameters. For Eventlog related search links,
you will now directly directed to entries in our knowledge base, if
found.
---------------------------------------------------------------------------
Version 2.3.3 (devel), 2008-05-23
- Initial Added the new DB Driver (Logstream) which uses PHP PDO.
PDO is the latest generic database interface for PHP5 and recommended
for best performance. It is possible to use other database engines with
this new logstream class like mssql, postgres sql, odbc, oracle
or even ibm db2.
- Optimized the logic of the pager and increased performance
related to it.
- Added support for the new Database driver into the installation script.
The old driver has been renamed to MYSQL Native and is also
recommended if you use MYSQL as database server.
---------------------------------------------------------------------------
Version 2.3.2 (devel), 2008-05-20
- Implemented Online Search button into the field submenus. The search
uses our new repository at kb.monitorware.com.
- Added pager to the bottom of the index page as well (bugtracker id 76)
- Added filtering support for the new Eventlog fields
- Adding field mapping definitions for Windows Eventlog which are:
SYSLOG_EVENT_LOGTYPE, SYSLOG_EVENT_SOURCE, SYSLOG_EVENT_CATEGORY,
SYSLOG_EVENT_ID and SYSLOG_EVENT_USER
- Simplified columns configuration definition in config.sample.php
- Fixed minor css issues.
---------------------------------------------------------------------------
Version 2.1.6 (beta), 2008-05-19 Version 2.1.6 (beta), 2008-05-19
- Fixed filter bug, if you want to filter with ":", you can do this by - Fixed filter bug, if you want to filter with ":", you can do this by
using "\:" now. using "\:" now.
@ -12,9 +93,30 @@ Version 2.1.6 (beta), 2008-05-19
- Added check for installed PHP Version. phpLogCon will refuse to run - Added check for installed PHP Version. phpLogCon will refuse to run
on PHP4 or lower from now on! on PHP4 or lower from now on!
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Version 2.3.1 (devel), 2008-05-02
- The page title is now created with Source, and other useful informations.
It is also possible to configure a custom title string with the
configuration, which will be prepended into each phpLogcon page.
- Added support for gzip compression (configurable), this will reduce
bandwidth and page load time.
- Added Auto reload function into main list view, can be enabled by default
in the configuration as well. Done using a META REFRESH.
- Added new configuration variable to set the default SourceID. The source
parameter will be appened to all necessary links and forms within
phplogcon, if the session sources differs from the default one.
Version 2.1.5 (beta), 2008-05-05 Version 2.1.5 (beta), 2008-05-05
- Converted all files into UNIX format (^M has been removed) - Converted all files into UNIX format (^M has been removed)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Version 2.3.0 (devel), 2008-04-30
- Added "Back to Listview" button in the detailview.
- Added filter for message type
- Added inline button menus into the listview. Most values can be clicked
now, which opens a menu with additional useful links.
- Added Pagesite Selection into listview, so you can change the amount of
records you want to see on one page at any time you want.
- greatly improved database performance, runs much better now, but there
is still room for further optimization
---------------------------------------------------------------------------
Version 2.1.4 (beta), 2008-04-29 Version 2.1.4 (beta), 2008-04-29
- Added missing facility 10 to 15 from RFC3164 into phhlogcon - Added missing facility 10 to 15 from RFC3164 into phhlogcon
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@ -32,7 +134,7 @@ Version 2.1.2 (beta), 2008-04-28
- Changed database layout from winsyslog to monitorware. - Changed database layout from winsyslog to monitorware.
Added more debug handling Added more debug handling
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Version 2.1.1 (devel), 2008-04-25 Version 2.1.1 (beta), 2008-04-25
- added detail page into phpLogCon. The detail page shows all possible - added detail page into phpLogCon. The detail page shows all possible
details of a syslog message. It also possible to page in the details of a syslog message. It also possible to page in the
detail view. detail view.
@ -43,5 +145,5 @@ Version 2.1.1 (devel), 2008-04-25
duplicated ones from before. duplicated ones from before.
- added full german translation (thanks to Tom Bergfeld for providing it) - added full german translation (thanks to Tom Bergfeld for providing it)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Version 2.1.0 (devel), 2008-04-24 Version 2.1.0 (beta), 2008-04-24
- initial release of the rewritten phpLogCon v2 - initial release of the rewritten phpLogCon v2

142
INSTALL
View File

@ -28,12 +28,13 @@
1. Upload all files from the phplogcon/src/ folder to you webserver. 1. Upload all files from the phplogcon/src/ folder to you webserver.
The other files are not needed on the webserver. The other files are not needed on the webserver.
2. If you webserver has write access to the phplogcon folder, 2. If your webserver has write access to the phplogcon folder,
you can skip the following step: you can skip the following step:
Upload the scripts configure.sh and secure.sh from the Upload the scripts configure.sh and secure.sh from the
contrib folder to your webserver, and set the execution contrib folder to your webserver, into the same folder
flag to them (chmod +x configure.sh secure.sh). where you uploaded the other phplogcon files into. Then set
the execution flag to them (chmod +x configure.sh secure.sh).
Now run ./configure.sh, this will create a blank config.php, Now run ./configure.sh, this will create a blank config.php,
and will also set write access to everyone to it. and will also set write access to everyone to it.
@ -45,6 +46,141 @@
script. The install script will guide you through the phplogcon script. The install script will guide you through the phplogcon
installation, just follow the instructions. installation, just follow the instructions.
3.1 Step 1 - Prerequisites Beginning of installation / welcome site
This is the first page of the installation. It just tells
you, that before installing, some file permission have to
be checked. Simply click "Next" to start the process.
3.2 Step 2 - Verify the file permissions
Here you will see, if the config.php can be written or not.
If it cannot be written, you have to repeat the complete
Step 2.
3.3 Step 3 - Basic Configuration
You can set several basic options here.
- Number of syslog messages per page = 50 (default)
This is the number of syslog messages displayed on each page.
You can increase the value (makes phpLogCon slower) or decrease
the value (makes it faster).
- Message character limit for the main view = 80 (default)
Set the number of characters per message which will be shown
in the last column of the main view. Full messages can be
reviewed by hovering the mouse over it.
- Show message details popup (default yes) = yes (default)
Here you can set, if you want the small window with the complete
message to pop up if you are hovering over a event with the
cursor. If you choose "No", then you have to click on the
message to see the details.
3.4 Step 4 - not implemented yet
3.5 Step 5 - not implemented yet
3.6 Step 6 - not implemented yet
3.7 Step 7 - Create the first source for syslog messages
This is the most important step. Here, you will configure
your first data source, which holds all your syslog data.
Mainly, you have to choose a "Name of the Source" and a
"Source Type". The name will be displayed later in a drop-down
menu with which you choose your active syslog source. The
"Source Type" can be a file, a MySQL database or the PHP PDO
which supports different database types like mssql, PostgreSQL,
odbc, oracle or even ibm db2.
If you choose the diskfile, you have to provide the following
information:
- Logline Type = Syslog / Rsyslog (default) or Adiscon WinSyslog
This tells phpLogCon, how the lines look like. This is
necessary for show the log messages properly.
- Syslog File = /var/log/syslog (default)
This is the position of the logfile in your file system.
If you choose MySQL native as data source, following information
is needed:
- Table Type = monitorware (default)
This is the table layout. Currently, you can use "monitorware"
or "syslogng". For more details see "Note on MySQL Databases"
below.
- Database Host = localhost (default)
This is the host, where the database is located. By default this
is localhost. You can specify any other host if necessary.
- Database Name = phplogcon (default)
The name of the database you want to use.
- Database Tablename = systemevents (default)
This is the name of the table in which the data is stored. The
default tablename corresponds to the tables created with the
MonitorWare Line of products.
- Database User = user (default)
The username for the database.
- Database Password = not set by default
The password for the username.
- Enable Row Counting = No (default)
If configured to "Yes", the amount of rows in the table will be
counted with every query, giving you the total records for your
search, though having a lot of impact on your system when using
a very large database. If configured to "No", the rows will not
be counted, providing you a lot more performance.
If you choose Database (PDO), the following has to be defined:
- Database Storage Engine = MySQL Server (default)
Choose the engine of the database you are using. The databases
are available: MySQL Server, Microsoft SQL Server, ODBC
Database Connection, PostgreSQL, Oracle Call Interface, IBM
DB2, Firebird/Interbase 6, IBM Informix Dynamic Server,
SQLite 2.
- Table Type = monitorware (default)
This is the table layout. Currently, you can use "monitorware"
or "syslogng". For more details see "Note on MySQL Databases"
below.
- Database Host = localhost (default)
This is the host, where the database is located. By default this
is localhost. You can specify any other host if necessary.
- Database Name = phplogcon (default)
The name of the database you want to use.
- Database Tablename = systemevents (default)
This is the name of the table in which the data is stored. The
default tablename corresponds to the tables created with the
MonitorWare Line of products.
- Database User = user (default)
The username for the database.
- Database Password = not set by default
The password for the username.
- Enable Row Counting = No (default)
If configured to "Yes", the amount of rows in the table will be
counted with every query, giving you the total records for your
search, though having a lot of impact on your system when using
a very large database. If configured to "No", the rows will not
be counted, providing you a lot more performance.
3.8 Step 8 - Finish
4. If everything went right, you should see syslog messages already 4. If everything went right, you should see syslog messages already
in your phplogcon installation. You can now remove the install.php in your phplogcon installation. You can now remove the install.php
script now. script now.

View File

@ -175,6 +175,12 @@ abstract class LogStream {
public abstract function GetLastPageUID(); public abstract function GetLastPageUID();
/**
* This function returns the FIRST UID for the FIRST PAGE, if availbale! Otherwise will
* return -1!
*/
public abstract function GetFirstPageUID();
/** /**
* This function returns the current Page number, if availbale! Otherwise will * This function returns the current Page number, if availbale! Otherwise will
* return -1! * return -1!
@ -317,6 +323,62 @@ abstract class LogStream {
} }
// --- // ---
break; break;
case "messagetype":
$tmpKeyName = SYSLOG_MESSAGETYPE;
$tmpFilterType = FILTER_TYPE_NUMBER;
// --- Extra Check to convert string representations into numbers!
if ( isset($tmpValues) )
{
foreach( $tmpValues as $mykey => $szValue )
{
if ( !is_numeric($szValue) )
{
$tmpMsgTypeCode = $this->ConvertMessageTypeString($szValue);
if ( $tmpMsgTypeCode != -1 )
$tmpValues[$mykey] = $tmpMsgTypeCode;
}
}
}
else
{
if ( !is_numeric($tmpArray[FILTER_TMP_VALUE]) )
{
$tmpMsgTypeCode = $this->ConvertMessageTypeString($tmpArray[FILTER_TMP_VALUE]);
if ( $tmpMsgTypeCode != -1 )
$tmpArray[FILTER_TMP_VALUE] = $tmpMsgTypeCode;
}
}
// ---
break;
/* BEGIN Eventlog based fields */
case "eventid":
$tmpKeyName = SYSLOG_EVENT_ID;
$tmpFilterType = FILTER_TYPE_NUMBER;
// --- Extra numeric Check
if ( isset($tmpValues) )
{
foreach( $tmpValues as $mykey => $szValue )
{
if ( is_numeric($szValue) )
$tmpValues[$mykey] = $szValue;
}
}
else
{
if ( !is_numeric($tmpArray[FILTER_TMP_VALUE]) )
$tmpArray[FILTER_TMP_VALUE] = "";
}
// ---
break;
case "eventlogtype":
$tmpKeyName = SYSLOG_EVENT_LOGTYPE;
$tmpFilterType = FILTER_TYPE_STRING;
break;
case "eventlogsource":
$tmpKeyName = SYSLOG_EVENT_SOURCE;
$tmpFilterType = FILTER_TYPE_STRING;
break;
/* END Eventlog based fields */
case "syslogtag": case "syslogtag":
$tmpKeyName = SYSLOG_SYSLOGTAG; $tmpKeyName = SYSLOG_SYSLOGTAG;
$tmpFilterType = FILTER_TYPE_STRING; $tmpFilterType = FILTER_TYPE_STRING;
@ -479,6 +541,24 @@ abstract class LogStream {
return -1; return -1;
} }
/*
* Helper function to convert a messagetype string into a messagetype number
*/
private function ConvertMessageTypeString($szValue)
{
global $content;
foreach ( $content['filter_messagetype_list'] as $mymsgtype )
{
if ( stripos( $mymsgtype['DisplayName'], $szValue) !== false )
return $mymsgtype['ID'];
}
// reached here means we failed to convert the facility!
return -1;
}
} }
?> ?>

View File

@ -47,6 +47,7 @@ class LogStreamConfigDB extends LogStreamConfig {
public $DBType = DB_MYSQL; // Default = MYSQL! public $DBType = DB_MYSQL; // Default = MYSQL!
public $DBTableType = 'winsyslog'; // Default = WINSYSLOG DB Layout! public $DBTableType = 'winsyslog'; // Default = WINSYSLOG DB Layout!
public $DBTableName = 'systemevents'; // Default Tabelname from WINSYSLOG public $DBTableName = 'systemevents'; // Default Tabelname from WINSYSLOG
public $DBEnableRowCounting = true; // Default RowCounting is enabled!
// Runtime configuration variables // Runtime configuration variables
public $RecordsPerQuery = 100; // This will determine how to limit sql statements public $RecordsPerQuery = 100; // This will determine how to limit sql statements

View File

@ -0,0 +1,135 @@
<?php
/*
*********************************************************************
* -> www.phplogcon.org <- *
* ----------------------------------------------------------------- *
* StreamConfig has the capability to create a specific LogStream *
* object depending on a configured LogStream*Config object. *
* *
* All directives are explained within this file *
*
* Copyright (C) 2008 Adiscon GmbH.
*
* This file is part of phpLogCon.
*
* PhpLogCon is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PhpLogCon is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
*********************************************************************
*/
// --- Avoid directly accessing this file!
if ( !defined('IN_PHPLOGCON') )
{
die('Hacking attempt');
exit;
}
// ---
class LogStreamConfigPDO extends LogStreamConfig {
public $DBServer = 'localhost';
public $DBPort = 0;
public $DBName = '';
public $DBUser = '';
public $DBPassword = '';
public $DBType = DB_MYSQL; // Default = MYSQL!
public $DBTableType = 'winsyslog'; // Default = WINSYSLOG DB Layout!
public $DBTableName = 'systemevents'; // Default Tabelname from WINSYSLOG
public $DBEnableRowCounting = true; // Default RowCounting is enabled!
// Runtime configuration variables
public $RecordsPerQuery = 100; // This will determine how to limit sql statements
public $IDsPerQuery = 5000; // When we query ID's, we read a lot more the datarecords at once!
public $SortColumn = SYSLOG_UID; // Default sorting column
public function LogStreamFactory($o)
{
// An instance is created, then include the logstreamdisk class as well!
global $gl_root_path;
require_once($gl_root_path . 'classes/logstreampdo.class.php');
// return LogStreamDisk instance
return new LogStreamPDO($o);
}
public function GetPDODatabaseType()
{
switch ($this->DBType)
{
case DB_MYSQL:
return "mysql";
case DB_MSSQL:
return "odbc";
case DB_ODBC:
return "odbc";
case DB_PGSQL:
return "pgsql";
case DB_OCI:
return "oci";
case DB_DB2:
return "ibm";
case DB_FIREBIRD:
return "firebird";
case DB_INFORMIX:
return "informix";
case DB_SQLITE:
return "sqlite";
default:
return "";
}
}
public function CreateConnectDSN()
{
switch ($this->DBType)
{
case DB_MYSQL:
$myDsn = 'mysql:host=' . $this->DBServer /*. ',' . $this->DBPort*/ . ';dbname=' . $this->DBName;
break;
case DB_MSSQL:
$myDsn = 'odbc:Driver={SQL Server}; Server=' . $this->DBServer . '; Uid=' . $this->DBUser . '; Pwd=' . $this->DBPassword . '; Database=' . $this->DBName . ';';
break;
case DB_ODBC:
$myDsn = 'odbc:dsn=' . $this->DBServer. ';uid=' . $this->DBUser . ';pwd=' . $this->DBPassword . ';Database=' . $this->DBName;
break;
case DB_PGSQL:
$myDsn = 'pgsql:host=' . $this->DBServer . ' dbname=' . $this->DBName . ' user=' . $this->DBUser . ' password=' . $this->DBPassword; // port=5432
break;
case DB_OCI:
$myDsn = 'oci:dbname=' . $this->DBServer . '/' . $this->DBName;
break;
case DB_DB2:
$myDsn = 'ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=' . $this->DBName . '; HOSTNAME=' . $this->DBServer . '; PROTOCOL=TCPIP; UID=' . $this->DBUser . '; PWD=' . $this->DBPassword; // PORT=port ;
break;
case DB_FIREBIRD:
$myDsn = 'firebird:User=' . $this->DBUser . ';Password=' . $this->DBPassword . ';Database=' . $this->DBName . ';DataSource=' . $this->DBServer; //;Port=3050';
break;
case DB_INFORMIX:
$myDsn = 'informix:host=' . $this->DBServer . '; database=' . $this->DBName . '; server=' . $this->DBServer . '; protocol=onsoctcp; EnableScrollableCursors=1';
break;
case DB_SQLITE:
$myDsn = 'sqlite:' . $this->DBName; // DBName is the full Path to the sqlite db file
break;
default:
$myDsn = '';
}
// return my DSN now!
return $myDsn;
}
}
?>

View File

@ -57,20 +57,11 @@ class LogStreamDB extends LogStream {
private $_totalRecordCount = -1; private $_totalRecordCount = -1;
private $_previousPageUID = -1; private $_previousPageUID = -1;
private $_lastPageUID = -1; private $_lastPageUID = -1;
private $_firstPageUID = -1;
private $_currentPageNumber = 0; private $_currentPageNumber = 0;
private $_SQLwhereClause = ""; private $_SQLwhereClause = "";
/* private $_currentOffset = -1;
private $_currentStartPos = -1;
private $_fp = null;
private $_bEOS = false;
const _BUFFER_length = 8192;
private $_buffer = false;
private $_buffer_length = 0;
private $_p_buffer = -1;
*/
// Constructor // Constructor
public function LogStreamDB($streamConfigObj) { public function LogStreamDB($streamConfigObj) {
$this->_logStreamConfigObj = $streamConfigObj; $this->_logStreamConfigObj = $streamConfigObj;
@ -112,12 +103,6 @@ class LogStreamDB extends LogStream {
// Create SQL Where Clause first! // Create SQL Where Clause first!
$this->CreateSQLWhereClause(); $this->CreateSQLWhereClause();
// Obtain count of records
$this->_totalRecordCount = $this->GetRowCountFromTable();
if ( $this->_totalRecordCount <= 0 )
return ERROR_NOMORERECORDS;
// Success, this means we init the Pagenumber to ONE! // Success, this means we init the Pagenumber to ONE!
$this->_currentPageNumber = 1; $this->_currentPageNumber = 1;
@ -275,7 +260,13 @@ class LogStreamDB extends LogStream {
$bFound = false; $bFound = false;
$tmpuID = $uID; $tmpuID = $uID;
$ret = ERROR_NOMORERECORDS; // Set Default error code! $ret = ERROR_NOMORERECORDS; // Set Default error code!
$totalpages = intval($this->_totalRecordCount / $this->_logStreamConfigObj->_pageCount);
// Set totalpages number if available
if ( $this->_totalRecordCount != -1 )
$totalpages = intval($this->_totalRecordCount / $this->_logStreamConfigObj->_pageCount);
else
$totalpages = 1;
while( $bFound == false && $this->ReadNextIDsFromDB() == SUCCESS ) while( $bFound == false && $this->ReadNextIDsFromDB() == SUCCESS )
{ {
foreach ( $this->bufferedRecords as $myRecord ) foreach ( $this->bufferedRecords as $myRecord )
@ -345,14 +336,61 @@ class LogStreamDB extends LogStream {
return $this->_previousPageUID; return $this->_previousPageUID;
} }
/**
* This function returns the FIRST UID for the FIRST PAGE!
* Will be done by a seperated SQL Statement.
*/
public function GetFirstPageUID()
{
global $querycount, $dbmapping;
$szTableType = $this->_logStreamConfigObj->DBTableType;
$szSql = "SELECT MAX(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
$myQuery = mysql_query($szSql, $this->_dbhandle);
if ($myQuery)
{
// obtain first and only row
$myRow = mysql_fetch_row($myQuery);
$this->_firstPageUID = $myRow[0];
// Free query now
mysql_free_result ($myQuery);
// Increment for the Footer Stats
$querycount++;
}
// Return result!
return $this->_firstPageUID;
}
/** /**
* This function returns the first UID for the last PAGE! * This function returns the first UID for the last PAGE!
* Will be done by a seperated SQL Statement. * Will be done by a seperated SQL Statement.
*/ */
public function GetLastPageUID() public function GetLastPageUID()
{ {
global $querycount; global $querycount, $dbmapping;
$szTableType = $this->_logStreamConfigObj->DBTableType;
$szSql = "SELECT MIN(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
$myQuery = mysql_query($szSql, $this->_dbhandle);
if ($myQuery)
{
// obtain first and only row
$myRow = mysql_fetch_row($myQuery);
$this->_lastPageUID = $myRow[0];
// Free query now
mysql_free_result ($myQuery);
// Increment for the Footer Stats
$querycount++;
}
//echo $szSql . "<br>" . $this->_lastPageUID;
//exit;
/* OLD CODE
// Obtain last UID of renough records are available! // Obtain last UID of renough records are available!
if ( $this->_totalRecordCount > $this->_logStreamConfigObj->_pageCount ) if ( $this->_totalRecordCount > $this->_logStreamConfigObj->_pageCount )
{ {
@ -378,8 +416,9 @@ class LogStreamDB extends LogStream {
// Increment for the Footer Stats // Increment for the Footer Stats
$querycount++; $querycount++;
} }
*/
// finally return result! // Return result!
return $this->_lastPageUID; return $this->_lastPageUID;
} }
@ -561,8 +600,6 @@ class LogStreamDB extends LogStream {
//echo $this->_SQLwhereClause; //echo $this->_SQLwhereClause;
//$dbmapping[$szTableType][SYSLOG_UID] //$dbmapping[$szTableType][SYSLOG_UID]
//$this->_SQLwhereClause;
} }
else // No filters means nothing to do! else // No filters means nothing to do!
return SUCCESS; return SUCCESS;
@ -602,6 +639,15 @@ class LogStreamDB extends LogStream {
// Free Query ressources // Free Query ressources
mysql_free_result ($myquery); mysql_free_result ($myquery);
// Only obtain count if enabled and not done before
if ( $this->_logStreamConfigObj->DBEnableRowCounting && $this->_totalRecordCount == -1 )
{
$this->_totalRecordCount = $this->GetRowCountFromTable();
if ( $this->_totalRecordCount <= 0 )
return ERROR_NOMORERECORDS;
}
// Increment for the Footer Stats // Increment for the Footer Stats
$querycount++; $querycount++;
@ -641,6 +687,15 @@ class LogStreamDB extends LogStream {
// Free Query ressources // Free Query ressources
mysql_free_result ($myquery); mysql_free_result ($myquery);
// Only obtain count if enabled and not done before
if ( $this->_logStreamConfigObj->DBEnableRowCounting && $this->_totalRecordCount == -1 )
{
$this->_totalRecordCount = $this->GetRowCountFromTable();
if ( $this->_totalRecordCount <= 0 )
return ERROR_NOMORERECORDS;
}
// Increment for the Footer Stats // Increment for the Footer Stats
$querycount++; $querycount++;
@ -659,8 +714,13 @@ class LogStreamDB extends LogStream {
$szTableType = $this->_logStreamConfigObj->DBTableType; $szTableType = $this->_logStreamConfigObj->DBTableType;
$szSortColumn = $this->_logStreamConfigObj->SortColumn; $szSortColumn = $this->_logStreamConfigObj->SortColumn;
// Create SQL String // Create Basic SQL String
$sqlString = "SELECT " . $dbmapping[$szTableType][SYSLOG_UID]; if ( $this->_logStreamConfigObj->DBEnableRowCounting ) // with SQL_CALC_FOUND_ROWS
$sqlString = "SELECT SQL_CALC_FOUND_ROWS " . $dbmapping[$szTableType][SYSLOG_UID];
else // without row calc
$sqlString = "SELECT " . $dbmapping[$szTableType][SYSLOG_UID];
// Append fields if needed
if ( $includeFields && $this->_arrProperties != null ) if ( $includeFields && $this->_arrProperties != null )
{ {
// Loop through all requested fields // Loop through all requested fields
@ -758,9 +818,24 @@ class LogStreamDB extends LogStream {
*/ */
private function GetRowCountFromTable() private function GetRowCountFromTable()
{ {
if ( $myquery = mysql_query("Select FOUND_ROWS();", $this->_dbhandle) )
{
// Get first and only row!
$myRow = mysql_fetch_array($myquery);
// copy row count
$numRows = $myRow[0];
}
else
$numRows = -1;
// return result!
return $numRows;
/* OLD slow code!
global $dbmapping,$querycount; global $dbmapping,$querycount;
$szTableType = $this->_logStreamConfigObj->DBTableType; $szTableType = $this->_logStreamConfigObj->DBTableType;
// Create Statement and perform query! // Create Statement and perform query!
$szSql = "SELECT count(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause; $szSql = "SELECT count(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
if ($myQuery = mysql_query($szSql, $this->_dbhandle)) if ($myQuery = mysql_query($szSql, $this->_dbhandle))
@ -777,9 +852,7 @@ class LogStreamDB extends LogStream {
} }
else else
$numRows = -1; $numRows = -1;
*/
// return result!
return $numRows;
} }

View File

@ -466,6 +466,15 @@ class LogStreamDisk extends LogStream {
return $this->_previousPageUID; return $this->_previousPageUID;
} }
/**
* This function returns the FIRST UID for the FIRST PAGE!
* NOT IMPLEMENTED RIGHT NOW!
*/
public function GetFirstPageUID()
{
return -1;
}
/** /**
* This function returns the first UID for the last PAGE! * This function returns the first UID for the last PAGE!
* This is not possible in this logstream, so it always returns -1! * This is not possible in this logstream, so it always returns -1!
@ -477,8 +486,8 @@ class LogStreamDisk extends LogStream {
// Helper variables // Helper variables
$myuid = -1; $myuid = -1;
$counter = 0; $counter = 0;
$tmpOldDirection = $this->_readDirection;
// if ( $this->_readDirection == EnumReadDirection::Forward )
if ( $this->_sortOrder == EnumSortingOrder::Ascending ) if ( $this->_sortOrder == EnumSortingOrder::Ascending )
{ {
// Move to the beginning of END file! // Move to the beginning of END file!
@ -487,7 +496,6 @@ class LogStreamDisk extends LogStream {
// Switch reading direction! // Switch reading direction!
$this->_readDirection = EnumReadDirection::Backward; $this->_readDirection = EnumReadDirection::Backward;
} }
// else if ( $this->_readDirection == EnumReadDirection::Backward )
else if ( $this->_sortOrder == EnumSortingOrder::Descending ) else if ( $this->_sortOrder == EnumSortingOrder::Descending )
{ {
// Move to the beginning of the file! // Move to the beginning of the file!
@ -499,17 +507,17 @@ class LogStreamDisk extends LogStream {
// Now we move for one page, we do not need to process the syslog messages! // Now we move for one page, we do not need to process the syslog messages!
$ret = $this->ReadNext($myuid, $tmpArray, false); $ret = $this->ReadNext($myuid, $tmpArray, false);
if ( $ret == SUCCESS )
{
do
{
// Increment Counter
$counter++;
} while ( $counter < $this->_logStreamConfigObj->_pageCount && ($ret = $this->ReadNext($myuid, $tmpArray, false)) == SUCCESS );
}
// Save the current UID as LastPage UID! // Save the current UID as LastPage UID!
$this->_lastPageUID = $myuid; $this->_lastPageUID = $myuid;
// --- Restore reading direction and file position!
$this->_readDirection = $tmpOldDirection;
if ( $this->_readDirection == EnumReadDirection::Forward )
$this->Sseek($myuid, EnumSeek::BOS, 0);
else
$this->Sseek($myuid, EnumSeek::EOS, 0);
// ---
// Return result! // Return result!
return $this->_lastPageUID; return $this->_lastPageUID;

View File

@ -64,31 +64,40 @@ class LogStreamLineParsersyslog extends LogStreamLineParser {
$arrArguments[SYSLOG_MESSAGETYPE] = IUT_Syslog; $arrArguments[SYSLOG_MESSAGETYPE] = IUT_Syslog;
// Sample (Syslog): Mar 10 14:45:44 debandre anacron[3226]: Job `cron.daily' terminated (mailing output) // Sample (Syslog): Mar 10 14:45:44 debandre anacron[3226]: Job `cron.daily' terminated (mailing output)
if ( preg_match("/(... [0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?)\[(.*?)\]:(.*?)$/", $szLine, $out ) ) if ( preg_match("/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) ([a-zA-Z0-9_\-\.]{1,256}) ([A-Za-z0-9_\-\/\.]{1,32})\[(.*?)\]:(.*?)$/", $szLine, $out ) )
{ {
// Copy parsed properties! // Copy parsed properties!
$arrArguments[SYSLOG_DATE] = GetEventTime($out[1]); $arrArguments[SYSLOG_DATE] = GetEventTime($out[1] . " " . $out[2]);
$arrArguments[SYSLOG_HOST] = $out[2]; $arrArguments[SYSLOG_HOST] = $out[3];
$arrArguments[SYSLOG_SYSLOGTAG] = $out[3]; $arrArguments[SYSLOG_SYSLOGTAG] = $out[4];
$arrArguments[SYSLOG_PROCESSID] = $out[4]; $arrArguments[SYSLOG_PROCESSID] = $out[5];
$arrArguments[SYSLOG_MESSAGE] = $out[6];
}
// Sample (Syslog): Mar 10 14:45:39 debandre syslogd 1.4.1#18: restart
else if ( preg_match("/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) ([a-zA-Z0-9_\-\.]{1,256}) ([A-Za-z0-9_\-\/\.]{1,32}):(.*?)$/", $szLine, $out ) )
{
// Copy parsed properties!
$arrArguments[SYSLOG_DATE] = GetEventTime($out[1] . " " . $out[2]);
$arrArguments[SYSLOG_HOST] = $out[3];
$arrArguments[SYSLOG_SYSLOGTAG] = $out[4];
$arrArguments[SYSLOG_MESSAGE] = $out[5]; $arrArguments[SYSLOG_MESSAGE] = $out[5];
} }
// Sample (Syslog): Mar 10 14:45:39 debandre syslogd 1.4.1#18: restart. // Sample (Syslog): Mar 10 14:45:39 debandre syslogd restart
else if ( preg_match("/(... [0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?):(.*?)$/", $szLine, $out ) ) else if ( preg_match("/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) ([a-zA-Z0-9_\-\.]{1,256}) ([A-Za-z0-9_\-\/\.]{1,32}) (.*?)$/", $szLine, $out ) )
{ {
// Copy parsed properties! // Copy parsed properties!
$arrArguments[SYSLOG_DATE] = GetEventTime($out[1]); $arrArguments[SYSLOG_DATE] = GetEventTime($out[1] . " " . $out[2]);
$arrArguments[SYSLOG_HOST] = $out[2]; $arrArguments[SYSLOG_HOST] = $out[3];
$arrArguments[SYSLOG_SYSLOGTAG] = $out[3]; $arrArguments[SYSLOG_SYSLOGTAG] = $out[4];
$arrArguments[SYSLOG_MESSAGE] = $out[4]; $arrArguments[SYSLOG_MESSAGE] = $out[5];
} }
// Sample (Syslog): Mar 7 17:18:35 debandre exiting on signal 15 // Sample (Syslog): Mar 7 17:18:35 debandre exiting on signal 15
else if ( preg_match("/(... [0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?)$/", $szLine, $out ) ) else if ( preg_match("/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?)$/", $szLine, $out ) )
{ {
// Copy parsed properties! // Copy parsed properties!
$arrArguments[SYSLOG_DATE] = GetEventTime($out[1]); $arrArguments[SYSLOG_DATE] = GetEventTime($out[1] . " " . $out[2]);
$arrArguments[SYSLOG_HOST] = $out[2]; $arrArguments[SYSLOG_HOST] = $out[3];
$arrArguments[SYSLOG_MESSAGE] = $out[3]; $arrArguments[SYSLOG_MESSAGE] = $out[4];
} }
// Sample (RSyslog): 2008-03-28T11:07:40+01:00 localhost rger: test 1 // Sample (RSyslog): 2008-03-28T11:07:40+01:00 localhost rger: test 1
else if ( preg_match("/([0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?):(.*?)$/", $szLine, $out ) ) else if ( preg_match("/([0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?):(.*?)$/", $szLine, $out ) )

View File

@ -0,0 +1,860 @@
<?php
/*
*********************************************************************
* -> www.phplogcon.org <-
* -----------------------------------------------------------------
* LogStreamPDO provides access to the data through PDO Interface
*
* \version 2.0.0 Init Version
*
* All directives are explained within this file
*
* Copyright (C) 2008 Adiscon GmbH.
*
* This file is part of phpLogCon.
*
* PhpLogCon is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PhpLogCon is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
*********************************************************************
*/
// --- Avoid directly accessing this file!
if ( !defined('IN_PHPLOGCON') )
{
die('Hacking attempt');
exit;
}
// ---
// --- Required Includes!
require_once($gl_root_path . 'include/constants_errors.php');
// ---
class LogStreamPDO extends LogStream {
private $_dbhandle = null;
// Helper to store the database records
private $bufferedRecords = null;
private $_currentRecordStart = 0;
private $_currentRecordNum = 0;
private $_totalRecordCount = -1;
private $_previousPageUID = -1;
private $_lastPageUID = -1;
private $_firstPageUID = -1;
private $_currentPageNumber = -1;
private $_SQLwhereClause = "";
private $_myDBQuery = null;
// Constructor
public function LogStreamPDO($streamConfigObj) {
$this->_logStreamConfigObj = $streamConfigObj;
// Verify if Extension is enabled
if ( extension_loaded('pdo') == 0 )
DieWithFriendlyErrorMsg("Error, PDO Extensions are not enabled or installed! This Source can not operate.");
/*
if ( $this->_logStreamConfigObj->DBType == DB_MYSQL )
{
// Probe if a function exists!
if ( !function_exists("mysql_connect") )
DieWithFriendlyErrorMsg("Error, MYSQL Extensions are not enabled! Function 'mysql_connect' does not exist.");
}
*/
}
/**
* Open and verifies the database conncetion
*
* @param arrProperties array in: Properties wish list.
* @return integer Error stat
*/
public function Open($arrProperties)
{
global $dbmapping;
// Create DSN String
$myDBDriver = $this->_logStreamConfigObj->GetPDODatabaseType();
$myDsn = $this->_logStreamConfigObj->CreateConnectDSN();
if ( strlen($myDsn) > 0 )
{
// Check if configured driver is actually loaded!
//print_r(PDO::getAvailableDrivers());
if ( !in_array($myDBDriver, PDO::getAvailableDrivers()) )
{
$this->PrintDebugError('PDO Database Driver not loaded: ' . $myDBDriver . "<br>Please check your php configuration extensions");
return ERROR_DB_INVALIDDBDRIVER;
}
try
{
// Try to connect to the database
$this->_dbhandle = new PDO( $myDsn, $this->_logStreamConfigObj->DBUser, $this->_logStreamConfigObj->DBPassword);
//$handle->setAttribute(PDO::ATTR_TIMEOUT, 3);
}
catch (PDOException $e)
{
$this->PrintDebugError('PDO Database Connection failed: ' . $e->getMessage() . "<br>DSN: " . $myDsn);
return ERROR_DB_CONNECTFAILED;
}
}
else
{
// Invalid DB Driver!
return ERROR_DB_INVALIDDBDRIVER;
}
// Copy the Property Array
$this->_arrProperties = $arrProperties;
// Check if DB Mapping exists
if ( !isset($dbmapping[ $this->_logStreamConfigObj->DBTableType ]) )
return ERROR_DB_INVALIDDBMAPPING;
// Create SQL Where Clause first!
$this->CreateSQLWhereClause();
// Only obtain rowcount if enabled and not done before
if ( $this->_logStreamConfigObj->DBEnableRowCounting && $this->_totalRecordCount == -1 )
$this->_totalRecordCount = $this->GetRowCountFromTable();
// Success, this means we init the Pagenumber to ONE!
//$this->_currentPageNumber = 1;
// reached this point means success!
return SUCCESS;
}
/**
* Close the database connection.
*
* @return integer Error state
*/
public function Close()
{
// trigger closing database query!
$this->DestroyMainSQLQuery();
// TODO CLOSE DB CONN?!
return true;
}
/**
* Read the data from a specific uID which means in this
* case beginning with from the Database ID
*
* @param uID integer in/out: unique id of the data row
* @param arrProperitesOut array out: array filled with properties
* @return integer Error state
* @see ReadNext()
*/
public function Read($uID, &$arrProperitesOut)
{
// Seek the first uID!
if ( $this->Sseek($uID, EnumSeek::UID, 0) == SUCCESS)
{
// Read the next record!
$ret = $this->ReadNext($uID, $arrProperitesOut);
}
else
$ret = ERROR_NOMORERECORDS;
// return result!
return $ret;
}
/**
* Read the next line from the file depending on the current
* read direction.
*
* Hint: If the current stream becomes unavailable an error
* stated is retuned. A typical case is if a log rotation
* changed the original data source.
*
* @param uID integer out: uID is the offset of data row
* @param arrProperitesOut array out: properties
* @return integer Error state
* @see ReadNext
*/
public function ReadNext(&$uID, &$arrProperitesOut, $bParseMessage = true)
{
// Helpers needed for DB Mapping
global $dbmapping, $fields;
$szTableType = $this->_logStreamConfigObj->DBTableType;
// define $ret
$ret = SUCCESS;
// No buffer? then read from DB!
if ( $this->bufferedRecords == null )
$ret = $this->ReadNextRecordsFromDB($uID);
else
{
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
{
// We need to load new records, so clear the old ones first!
$this->ResetBufferedRecords();
// Set new Record start, will be used in the SQL Statement!
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
// Now read new ones
$ret = $this->ReadNextRecordsFromDB($uID);
//echo "1mowl " . $this->_currentRecordStart . "=" . $this->_currentRecordNum;
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
$ret = ERROR_NOMORERECORDS;
}
}
if ( $ret == SUCCESS )
{
// Init and set variables
foreach ( $this->_arrProperties as $property )
{
// Check if mapping exists
if ( isset($dbmapping[$szTableType][$property]) )
{
// Copy property if available!
$dbfieldname = $dbmapping[$szTableType][$property];
if ( isset($this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]) )
{
if ( isset($fields[$property]['FieldType']) && $fields[$property]['FieldType'] == FILTER_TYPE_DATE ) // Handle as date!
$arrProperitesOut[$property] = GetEventTime( $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname] );
else
$arrProperitesOut[$property] = $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname];
}
else
$arrProperitesOut[$property] = '';
}
else
$arrProperitesOut[$property] = '';
}
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum;
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]];
// Increment $_currentRecordNum
$this->_currentRecordNum++;
}
// reached here means return result!
return $ret;
}
/**
* Implementation of Seek
*/
public function Sseek(&$uID, $mode, $numrecs)
{
// predefine return value
$ret = SUCCESS;
switch ($mode)
{
case EnumSeek::UID:
// if ( $uID == UID_UNKNOWN ) // set uID to first ID!
{
// No buffer? then read from DB!
if ( $this->bufferedRecords == null )
$ret = $this->ReadNextRecordsFromDB($uID);
if ( $ret == SUCCESS )
{
$this->_currentRecordNum = 0;
$uID = $this->bufferedRecords[ $this->_currentRecordNum ];
}
}
/* else
{
// Obtain fieldname for uID
global $dbmapping;
$uidfieldname = $dbmapping[$this->_logStreamConfigObj->DBTableType][SYSLOG_UID];
// Clear if necessary!
if ( $this->bufferedRecords == null )
$this->ResetBufferedRecords();
// Loop through all records for now, maybe optimized later!
$bFound = false;
$tmpuID = $uID;
$ret = ERROR_NOMORERECORDS; // Set Default error code!
// Set totalpages number if available
if ( $this->_totalRecordCount != -1 )
$totalpages = intval($this->_totalRecordCount / $this->_logStreamConfigObj->_pageCount);
else
$totalpages = 1;
while( $bFound == false && $this->ReadNextIDsFromDB() == SUCCESS )
{
foreach ( $this->bufferedRecords as $myRecord )
{
if ( $myRecord[$uidfieldname] == $uID )
{
$bFound = true;
$ret = SUCCESS;
break; // Break foreach loop!
}
else
{
$tmpuID = $myRecord[$uidfieldname];
// Only Increment $_currentRecordNum
$this->_currentRecordNum++;
}
// Increment our Pagenumber if needed!
if ( $this->_currentRecordNum % $this->_logStreamConfigObj->_pageCount == 0 )
$this->_currentPageNumber++;
}
if ( $this->_currentPageNumber > 1 && $this->_readDirection == EnumReadDirection::Forward)
$this->_currentPageNumber = $totalpages - $this->_currentPageNumber + 1;
//--- Extra check to set the correct $_previousPageUID!
if ( $this->_currentRecordNum > $this->_logStreamConfigObj->_pageCount && isset($this->bufferedRecords[$this->_currentRecordNum - 50][$uidfieldname]) )
{
$this->_previousPageUID = $this->bufferedRecords[$this->_currentRecordNum - $this->_logStreamConfigObj->_pageCount - 1][$uidfieldname];
}
// TODO! Handle the case where previous ID is not set in the bufferedrecords!
//---
// We need to load new records, so clear the old ones first!
$this->ResetBufferedRecords();
// Set new Record start, will be used in the SQL Statement!
$this->_currentRecordStart = $this->_currentRecordNum;
}
// Delete buffered records, then they will be read automatically in ReadNext()
$this->ResetBufferedRecords();
}
*/
break;
}
// Return result!
return $ret;
}
/**
* GetMessageCount will return the count of Message.
* If this count is not available, the function will
* return the default -1
*/
public function GetMessageCount()
{
return $this->_totalRecordCount;
}
/**
* This function returns the first UID for previous PAGE, if availbale!
* Otherwise will return -1!
*/
public function GetPreviousPageUID()
{
return $this->_previousPageUID;
}
/**
* This function returns the FIRST UID for the FIRST PAGE!
* Will be done by a seperated SQL Statement.
*/
public function GetFirstPageUID()
{
global $querycount, $dbmapping;
$szTableType = $this->_logStreamConfigObj->DBTableType;
$szSql = "SELECT MAX(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
$myQuery = $this->_dbhandle->query($szSql);
if ( $myQuery )
{
$myRow = $myQuery->fetchColumn();
$this->_firstPageUID = $myRow; // $myRow[0];
// Free query now
$myQuery->closeCursor();
// Increment for the Footer Stats
$querycount++;
}
//echo $szSql . "<br>" . $this->_firstPageUID;
//exit;
// finally return result!
return $this->_firstPageUID;
}
/**
* This function returns the first UID for the last PAGE!
* Will be done by a seperated SQL Statement.
*/
public function GetLastPageUID()
{
global $querycount, $dbmapping;
$szTableType = $this->_logStreamConfigObj->DBTableType;
$szSql = "SELECT MIN(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
$myQuery = $this->_dbhandle->query($szSql);
if ( $myQuery )
{
$myRow = $myQuery->fetchColumn();
$this->_lastPageUID = $myRow; // $myRow[0];
// Free query now
$myQuery->closeCursor();
// Increment for the Footer Stats
$querycount++;
}
//echo $szSql . "<br>" . $this->_lastPageUID;
//exit;
// finally return result!
return $this->_lastPageUID;
}
/**
* This function returns the current Page number, if availbale!
* Otherwise will return 0! We also assume that this function is
* only called once DB is open!
*/
public function GetCurrentPageNumber()
{
return $this->_currentPageNumber;
}
/*
* Implementation of IsPropertySortable
*
* For now, sorting is only possible for the UID Property!
*/
public function IsPropertySortable($myProperty)
{
global $fields;
// TODO: HARDCODED | FOR NOW only FALSE!
return false;
if ( isset($fields[$myProperty]) && $myProperty == SYSLOG_UID )
return true;
else
return false;
}
/*
* ============= Beginn of private functions =============
*/
/*
* This function expects the filters to already being set earlier.
* Otherwise no usual WHERE Clause can be created!
*/
private function CreateSQLWhereClause()
{
if ( $this->_filters != null )
{
global $dbmapping;
$szTableType = $this->_logStreamConfigObj->DBTableType;
// Reset WhereClause
$this->_SQLwhereClause = "";
// Loop through all available properties
foreach( $this->_arrProperties as $propertyname )
{
// If the property exists in the filter array, we have something to filter for ^^!
if ( array_key_exists($propertyname, $this->_filters) )
{
// Process all filters
foreach( $this->_filters[$propertyname] as $myfilter )
{
switch( $myfilter[FILTER_TYPE] )
{
case FILTER_TYPE_STRING:
// Check if user wants to include or exclude!
if ( $myfilter[FILTER_MODE] == FILTER_MODE_INCLUDE)
$addnod = "";
else
$addnod = " NOT";
// If Syslog message, we have AND handling, otherwise OR!
if ( $propertyname == SYSLOG_MESSAGE )
$addor = " AND ";
else
$addor = " OR ";
// Not create LIKE Filters
if ( isset($tmpfilters[$propertyname]) )
$tmpfilters[$propertyname][FILTER_VALUE] .= $addor . $dbmapping[$szTableType][$propertyname] . $addnod . " LIKE '%" . $myfilter[FILTER_VALUE] . "%'";
else
{
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_STRING;
$tmpfilters[$propertyname][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . $addnod . " LIKE '%" . $myfilter[FILTER_VALUE] . "%'";
}
break;
case FILTER_TYPE_NUMBER:
if ( isset($tmpfilters[$propertyname]) )
$tmpfilters[$propertyname][FILTER_VALUE] .= ", " . $myfilter[FILTER_VALUE];
else
{
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_NUMBER;
$tmpfilters[$propertyname][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . " IN (" . $myfilter[FILTER_VALUE];
}
break;
case FILTER_TYPE_DATE:
if ( isset($tmpfilters[$propertyname]) )
$tmpfilters[$propertyname][FILTER_VALUE] .= " AND ";
else
{
$tmpfilters[$propertyname][FILTER_VALUE] = "";
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_DATE;
}
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
{
// Get current timestamp
$nNowTimeStamp = time();
if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
$nNowTimeStamp -= 60 * 60; // One Hour!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_12HOURS )
$nNowTimeStamp -= 60 * 60 * 12; // 12 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_24HOURS )
$nNowTimeStamp -= 60 * 60 * 24; // 24 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_7DAYS )
$nNowTimeStamp -= 60 * 60 * 24 * 7; // 7 days
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_31DAYS )
$nNowTimeStamp -= 60 * 60 * 24 * 31; // 31 days
else
{
// Set filter to unknown and Abort in this case!
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_UNKNOWN;
break;
}
// Append filter
$tmpfilters[$propertyname][FILTER_VALUE] .= $dbmapping[$szTableType][$propertyname] . " > '" . date("Y-m-d H:i:s", $nNowTimeStamp) . "'";
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_FROM )
{
// Obtain Event struct for the time!
$myeventtime = GetEventTime($myfilter[FILTER_VALUE]);
$tmpfilters[$propertyname][FILTER_VALUE] .= $dbmapping[$szTableType][$propertyname] . " > '" . date("Y-m-d H:i:s", $myeventtime[EVTIME_TIMESTAMP]) . "'";
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_TO )
{
// Obtain Event struct for the time!
$myeventtime = GetEventTime($myfilter[FILTER_VALUE]);
$tmpfilters[$propertyname][FILTER_VALUE] .= $dbmapping[$szTableType][$propertyname] . " < '" . date("Y-m-d H:i:s", $myeventtime[EVTIME_TIMESTAMP]) . "'";
}
break;
default:
// Nothing to do!
break;
}
}
}
}
// Check and combine all filters now!
if ( isset($tmpfilters) )
{
// Append filters
foreach( $tmpfilters as $tmpfilter )
{
// Init WHERE or Append AND
if ( strlen($this->_SQLwhereClause) > 0 )
$this->_SQLwhereClause .= " AND ";
else
$this->_SQLwhereClause = " WHERE ";
switch( $tmpfilter[FILTER_TYPE] )
{
case FILTER_TYPE_STRING:
$this->_SQLwhereClause .= "( " . $tmpfilter[FILTER_VALUE] . ") ";
break;
case FILTER_TYPE_NUMBER:
$this->_SQLwhereClause .= $tmpfilter[FILTER_VALUE] . ") ";
break;
case FILTER_TYPE_DATE:
$this->_SQLwhereClause .= $tmpfilter[FILTER_VALUE];
break;
default:
// Should not happen, wrong filters!
// We add a dummy into the where clause, just as a place holder
$this->_SQLwhereClause .= " 1=1 ";
break;
}
}
}
//echo $this->_SQLwhereClause;
//$dbmapping[$szTableType][SYSLOG_UID]
}
else // No filters means nothing to do!
return SUCCESS;
}
/*
* Create the SQL QUery!
*/
private function CreateMainSQLQuery($uID)
{
global $querycount;
// create query if necessary!
if ( $this->_myDBQuery == null )
{
// Get SQL Statement
$szSql = $this->CreateSQLStatement($uID);
// Perform Database Query
$this->_myDBQuery = $this->_dbhandle->query($szSql);
if ( !$this->_myDBQuery )
{
$this->PrintDebugError( "Invalid SQL: ".$szSql . "<br><br>Errorcode: " . $this->_dbhandle->errorCode() );
return ERROR_DB_QUERYFAILED;
}
// Increment for the Footer Stats
$querycount++;
}
// return success state if reached this point!
return SUCCESS;
}
/*
* Destroy the SQL QUery!
*/
private function DestroyMainSQLQuery()
{
// create query if necessary!
if ( $this->_myDBQuery != null )
{
// Free Query ressources
// $this->_myDBQuery->closeCursor();
$this->_myDBQuery = null;
}
// return success state if reached this point!
return SUCCESS;
}
/*
* This helper function will read the next records into the buffer.
*/
private function ReadNextRecordsFromDB($uID)
{
// Create query if necessary
if ( $this->_myDBQuery == null )
{
// return error if there was one!
if ( ($res = $this->CreateMainSQLQuery($uID)) != SUCCESS )
return $res;
// return specially with NO RECORDS when 0 records are returned! Otherwise it will be -1
if ( $this->_myDBQuery->rowCount() == 0 )
return ERROR_NOMORERECORDS;
}
// Copy rows into the buffer!
$iBegin = $this->_currentRecordNum;
$iCount = 0;
while( $this->_logStreamConfigObj->RecordsPerQuery > $iCount)
{
//Obtain next record
$myRow = $this->_myDBQuery->fetch(PDO::FETCH_ASSOC);
// Check if result was successfull!
if ( $myRow === FALSE || !$myRow )
break;
$this->bufferedRecords[$iBegin] = $myRow;
$iBegin++;
// Increment counter
$iCount++;
}
// return success state if reached this point!
return SUCCESS;
}
/*
* Creates the SQL Statement we are going to use!
*/
private function CreateSQLStatement($uID, $includeFields = true)
{
global $dbmapping;
// Copy helper variables, this is just for better readability
$szTableType = $this->_logStreamConfigObj->DBTableType;
$szSortColumn = $this->_logStreamConfigObj->SortColumn;
// Create Basic SQL String
// if ( $this->_logStreamConfigObj->DBEnableRowCounting ) // with SQL_CALC_FOUND_ROWS
// $sqlString = "SELECT SQL_CALC_FOUND_ROWS " . $dbmapping[$szTableType][SYSLOG_UID];
// else // without row calc
$sqlString = "SELECT " . $dbmapping[$szTableType][SYSLOG_UID];
// Append fields if needed
if ( $includeFields && $this->_arrProperties != null )
{
// Loop through all requested fields
foreach ( $this->_arrProperties as $myproperty )
{
// SYSLOG_UID already added!
if ( $myproperty != SYSLOG_UID && isset($dbmapping[$szTableType][$myproperty]) )
{
// Append field!
$sqlString .= ", " . $dbmapping[$szTableType][$myproperty];
}
}
}
// Append FROM 'table'!
$sqlString .= " FROM " . $this->_logStreamConfigObj->DBTableName;
// Append precreated where clause
$sqlString .= $this->_SQLwhereClause;
// Append UID QUERY!
if ( $uID != -1 )
{
if ( $this->_readDirection == EnumReadDirection::Forward )
$myOperator = ">=";
else
$myOperator = "<=";
if ( strlen($this->_SQLwhereClause) > 0 )
$sqlString .= " AND " . $dbmapping[$szTableType][SYSLOG_UID] . " $myOperator $uID";
else
$sqlString .= " WHERE " . $dbmapping[$szTableType][SYSLOG_UID] . " $myOperator $uID";
}
// Append ORDER clause
if ( $this->_readDirection == EnumReadDirection::Forward )
$sqlString .= " ORDER BY " . $dbmapping[$szTableType][$szSortColumn];
else if ( $this->_readDirection == EnumReadDirection::Backward )
$sqlString .= " ORDER BY " . $dbmapping[$szTableType][$szSortColumn] . " DESC";
//echo $sqlString;
//exit;
// return SQL result string:
return $sqlString;
}
/*
* Reset record buffer in this function!
*/
private function ResetBufferedRecords()
{
if ( isset($this->bufferedRecords) )
{
// Loop through all subrecords first!
foreach ($this->bufferedRecords as $mykey => $myrecord)
unset( $this->bufferedRecords[$mykey] );
// Set buffered records to NULL!
$this->bufferedRecords = null;
}
}
/*
* Helper function to display SQL Errors for now!
*/
private function PrintDebugError($szErrorMsg)
{
global $CFG;
if ( isset($CFG['MiscShowDebugMsg']) && $CFG['MiscShowDebugMsg'] == 1 )
{
$errdesc = $this->_dbhandle == null ? "" : implode( ";", $this->_dbhandle->errorInfo() );
$errno = $this->_dbhandle == null ? "" : $this->_dbhandle->errorCode();
$errormsg ="<table width=\"600\" align=\"center\" class=\"with_border\"><tr><td>";
$errormsg.="<center><H3><font color='red'>Error: " . $szErrorMsg . "</font></H3><br></center>";
$errormsg.="<B>Errordetails:</B><br>";
$errormsg.="Detail Error: $errdesc <br>";
$errormsg.="Error Code: $errno <br>";
$errormsg.="Date: ".date("d.m.Y @ H:i"). "<br>";
$errormsg.="</td></tr></table>";
//Output!
print( $errormsg );
}
}
/*
* Returns the number of possible records by using a select count statement!
*/
private function GetRowCountFromTable()
{
/*
if ( $myquery = mysql_query("Select FOUND_ROWS();", $this->_dbhandle) )
{
// Get first and only row!
$myRow = mysql_fetch_array($myquery);
// copy row count
$numRows = $myRow[0];
}
else
$numRows = -1;
*/
/* OLD slow code! */
global $dbmapping,$querycount;
$szTableType = $this->_logStreamConfigObj->DBTableType;
// Create Statement and perform query!
$szSql = "SELECT count(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
$myQuery = $this->_dbhandle->query($szSql);
if ($myQuery)
{
// obtain first and only row
$myRow = $myQuery->fetchColumn();
$numRows = $myRow; // $myRow[0];
// Increment for the Footer Stats
$querycount++;
// Free query now
$myQuery->closeCursor();
}
else
{
$this->PrintDebugError("RowCount query failed: " . $szSql);
$numRows = -1;
}
// return result!
return $numRows;
}
}
?>

View File

@ -1,56 +1,83 @@
/* Generic Style definitions */ /* Generic Style definitions */
.ExpansionPlus .ExpansionPlus
{ {
background-image: url("../images/icons/navigate_plus.png"); background-image: url("../images/icons/navigate_plus.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: left center; background-position: left center;
padding-left: 20px; padding-left: 20px;
} }
.ExpansionMinus .ExpansionMinus
{ {
background-image: url("../images/icons/navigate_minus.png"); background-image: url("../images/icons/navigate_minus.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: left center; background-position: left center;
padding-left: 20px; padding-left: 20px;
} }
.HiddenContent .HiddenContent
{ {
visibility: hidden; visibility: hidden;
/* position: relative; */ /* position: relative; */
display: none; display: none;
} }
.SelectSavedFilter .SelectSavedFilter
{ {
margin-top: 3px; margin-top: 2px;
border: 1px solid; border: 1px solid;
border-color: #233B51 #124A7C #124A7C #233B51; border-color: #233B51 #124A7C #124A7C #233B51;
} }
.syslogdetails, a.syslogdetails, a.syslogdetails:link, a.syslogdetails:active, a.syslogdetails:visited .syslogdetails, a.syslogdetails, a.syslogdetails:link, a.syslogdetails:active, a.syslogdetails:visited
{ {
font-weight:normal; font-weight:normal;
text-decoration:none; text-decoration:none;
} position:relative;
.syslogdetails overflow:visible;
{ }
position:relative; /*this is the key*/ .syslogdetails
z-index:4; {
} position:relative;
overflow:visible;
.syslogdetails:hover z-index:4;
{ }
font-weight:normal;
z-index:5; .syslogdetails:hover
} {
.syslogdetails span {display: none} position:relative; /*this is the key*/
/*the span will display just on :hover state*/ font-weight:normal;
.syslogdetails:hover span z-index:5;
{ }
display:block; .syslogdetails span
position:absolute; {
top:15px; position:relative;
left:15px; overflow:visible;
} display: none;
z-index:-1;
}
/*the span will display just on :hover state*/
/*
.syslogdetails:hover span
{
display:block;
position:absolute;
top:15px;
left:15px;
}
*/
.syslogdetails_popup span
{
display:block;
position:absolute;
overflow:auto;
z-index:5;
/* top:15px; */
/* left:15px; */
}
.gridline
{
height: 16px;
}

View File

@ -1,8 +1,10 @@
#menu { #menu {
width: 16px; /* set width of menu */ width: 16px; /* set width of menu */
} }
#menu ul { /* remove bullets and list indents */ #menu ul { /* remove bullets and list indents */
position: absolute;
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -11,44 +13,54 @@
/* style, color and size links and headings to suit */ /* style, color and size links and headings to suit */
#menu a, #menu h2 { #menu a, #menu h2 {
display: block; display: block;
border-width: 1px; margin: 2px;
border-style: solid; padding: 1px 1px;
margin: 0;
padding: 2px 3px;
} }
#menu h2 { #menu h2 {
font: bold 11px/16px; font-size: 12px;
font-weight: bold;
text-align: center; text-align: center;
} }
#menu a { #menu a {
text-decoration: none; text-decoration: none;
border-color: #44617D #203040 #203040 #44617D;
} }
#menu a:hover { #menu a:hover {
text-decoration: none; text-decoration: none;
border-color: #44617D #203040 #203040 #44617D;
} }
#menu li { #menu li {
z-index:10;
/* make the list elements a containing block for the nested lists */ /* make the list elements a containing block for the nested lists */
position: relative; position: relative;
} }
#menu ul li ul li {
border-width: 1px;
border-style: solid;
border-color: #44617D #203040 #203040 #44617D;
}
#menu ul ul { #menu ul ul {
z-index:10;
/* border-color: #44617D #203040 #203040 #44617D; */
position: absolute; position: absolute;
top: 16px; top: 12px;
left: 0px; /* to position them to the right of their containing block */ left: 4px; /* to position them to the right of their containing block */
width: 300; /* width is based on the containing block */ width: 350; /* width is based on the containing block */
} }
div#menu ul ul, div#menu ul ul,
div#menu ul li:hover ul ul div#menu ul li:hover ul ul
{display: none;} {
display: none;
}
div#menu ul li:hover ul, div#menu ul li:hover ul,
div#menu ul ul li:hover ul div#menu ul ul li:hover ul
{display: block;} {
display: block;
}

View File

@ -96,9 +96,6 @@ $content['searchstr'] = "";
$content['highlightstr'] = ""; $content['highlightstr'] = "";
$content['EXPAND_HIGHLIGHT'] = "false"; $content['EXPAND_HIGHLIGHT'] = "false";
// Set Page title
$content['TITLE'] = "phpLogCon :: Details";
// --- BEGIN Custom Code // --- BEGIN Custom Code
if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current'] != UID_UNKNOWN ) // && $content['Sources'][$currentSourceID]['SourceType'] == SOURCE_DISK ) if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current'] != UID_UNKNOWN ) // && $content['Sources'][$currentSourceID]['SourceType'] == SOURCE_DISK )
{ {
@ -251,6 +248,10 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current'
$content['fields'][$mycolkey]['fieldvalue'] = GetStringWithHTMLCodes($logArray[$mycolkey]); $content['fields'][$mycolkey]['fieldvalue'] = GetStringWithHTMLCodes($logArray[$mycolkey]);
else // kindly copy! else // kindly copy!
$content['fields'][$mycolkey]['fieldvalue'] = $logArray[$mycolkey]; $content['fields'][$mycolkey]['fieldvalue'] = $logArray[$mycolkey];
// --- HOOK here to add context links!
AddContextLinks($content['fields'][$mycolkey]['fieldvalue']);
// ---
} }
// Increment helpcounter // Increment helpcounter
@ -265,7 +266,7 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current'
{ {
// Enable Pager in any case here! // Enable Pager in any case here!
$content['main_pagerenabled'] = true; $content['main_pagerenabled'] = true;
/*
// --- Handle uid_first page button // --- Handle uid_first page button
if ( $content['uid_fromgetrequest'] == $content['uid_first'] ) if ( $content['uid_fromgetrequest'] == $content['uid_first'] )
$content['main_pager_first_found'] = false; $content['main_pager_first_found'] = false;
@ -279,10 +280,19 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current'
$content['main_pager_first_found'] = false; $content['main_pager_first_found'] = false;
} }
// --- // ---
*/
// --- Handle uid_last page button // --- Handle uid_last page button
// Option the last UID from the stream! // Option the last UID from the stream!
$content['uid_last'] = $stream->GetLastPageUID(); $content['uid_last'] = $stream->GetLastPageUID();
$content['uid_first'] = $stream->GetFirstPageUID();
// --- Handle uid_first page button
if ( $content['uid_current'] == $content['uid_first'] )
$content['main_pager_first_found'] = false;
else
$content['main_pager_first_found'] = true;
// ---
// if we found a last uid, and if it is not the current one (which means we already are on the last page ;)! // if we found a last uid, and if it is not the current one (which means we already are on the last page ;)!
if ( $content['uid_last'] != -1 && $content['uid_last'] != $content['uid_current']) if ( $content['uid_last'] != -1 && $content['uid_last'] != $content['uid_current'])
@ -351,10 +361,27 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current'
} }
// --- // ---
// --- BEGIN CREATE TITLE
$content['TITLE'] = InitPageTitle();
if ( $content['messageenabled'] == "true" )
{
// Append custom title part!
$content['TITLE'] .= " :: Details for '" . $content['uid_current'] . "'";
}
else
{
// APpend to title Page title
$content['TITLE'] .= " :: Unknown uid";
}
// --- END CREATE TITLE
// --- Parsen and Output // --- Parsen and Output
InitTemplateParser(); InitTemplateParser();
$page -> parser($content, "details.html"); $page -> parser($content, "details.html");
$page -> output(); $page -> output();
// --- // ---
?> ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

View File

@ -51,9 +51,12 @@ $CFG['UserDBPass'] = "";
$CFG['MiscShowDebugMsg'] = 0; // if enabled, you will get additional output on certain places $CFG['MiscShowDebugMsg'] = 0; // if enabled, you will get additional output on certain places
$CFG['MiscShowDebugGridCounter'] = 0; // Only for debugging purposes, will add a counter column into the grid! $CFG['MiscShowDebugGridCounter'] = 0; // Only for debugging purposes, will add a counter column into the grid!
$CFG["MiscShowPageRenderStats"] = 1; // If enabled, you will see Pagerender Settings $CFG["MiscShowPageRenderStats"] = 1; // If enabled, you will see Pagerender Settings
$CFG['MiscEnableGzipCompression'] = 1; // If enabled, phplogcon will use gzip compression for output, we recommend
// to have this option enabled, it will highly reduce bandwith usage.
// --- // ---
// --- Default Frontend Options // --- Default Frontend Options
$CFG['PrependTitle'] = ""; // If set, this text will be prepended withint the title tag
$CFG['ViewUseTodayYesterday'] = 1; // If enabled, the date from today and yesterday is displayed as "today" and "yesterday" $CFG['ViewUseTodayYesterday'] = 1; // If enabled, the date from today and yesterday is displayed as "today" and "yesterday"
$CFG['ViewMessageCharacterLimit'] = 80; // Default character limit for the message gets trunscated. $CFG['ViewMessageCharacterLimit'] = 80; // Default character limit for the message gets trunscated.
$CFG['ViewEntriesPerPage'] = 50; // Default number of syslog entries shown per page $CFG['ViewEntriesPerPage'] = 50; // Default number of syslog entries shown per page
@ -61,20 +64,19 @@ $CFG['ViewEnableDetailPopups'] = 1; // If enabled, you will see additional Det
$CFG['ViewDefaultTheme'] = "default"; // This sets the default theme the user is going to see when he opens phplogcon the first time. $CFG['ViewDefaultTheme'] = "default"; // This sets the default theme the user is going to see when he opens phplogcon the first time.
// Currently only "default" and "dark" are available. // Currently only "default" and "dark" are available.
$CFG['ViewDefaultLanguage'] = "en"; // Sets the default display language $CFG['ViewDefaultLanguage'] = "en"; // Sets the default display language
$CFG['ViewEnableAutoReloadSeconds'] = 0; // If "ViewEnableAutoReloadSeconds" is set to anything higher the 0 (which means disabled), this means auto reload is enabled by default.
$CFG['SearchCustomButtonCaption'] = "I'd like to feel sad"; // Default caption for the custom fast search button $CFG['SearchCustomButtonCaption'] = "I'd like to feel sad"; // Default caption for the custom fast search button
$CFG['SearchCustomButtonSearch'] = "error"; // Default search string for the custom search button $CFG['SearchCustomButtonSearch'] = "error"; // Default search string for the custom search button
$CFG['EnableIPAddressResolve'] = 1; // If enabled, IP Addresses inline messages are automatically resolved and the result is added in brackets {} behind the IP Address
// --- // ---
// --- Define which fields you want to see // --- Define which fields you want to see
//$CFG['ShowMessage'] = true; // If enabled, the Message column will be appended to the columns list. //$CFG['ShowMessage'] = true; // If enabled, the Message column will be appended to the columns list.
$CFG['Columns'][] = SYSLOG_DATE; //Eventlog based fields: $CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_HOST, SYSLOG_EVENT_LOGTYPE, SYSLOG_EVENT_SOURCE, /*SYSLOG_EVENT_CATEGORY, */SYSLOG_EVENT_ID, SYSLOG_MESSAGE );
$CFG['Columns'][] = SYSLOG_FACILITY; //$CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_SEVERITY, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGETYPE, SYSLOG_MESSAGE );
$CFG['Columns'][] = SYSLOG_SEVERITY; $CFG['DefaultViewsID'] = "";
$CFG['Columns'][] = SYSLOG_HOST;
$CFG['Columns'][] = SYSLOG_SYSLOGTAG;
$CFG['Columns'][] = SYSLOG_MESSAGETYPE;
$CFG['Columns'][] = SYSLOG_MESSAGE;
// --- // ---
// --- Predefined Searches! // --- Predefined Searches!
@ -90,22 +92,24 @@ $CFG['Search'][] = array ( "DisplayName" => "All messages from last 31 days", "S
// --- Source Options // --- Source Options
/* Example for DiskType Source: /* Example for DiskType Source:
$CFG['Sources'][Source1]['ID'] = "Source1"; $CFG['Sources']['Source1']['ID'] = "Source1";
$CFG['Sources'][Source1]['Name'] = "Syslog Disk File"; $CFG['Sources']['Source1']['Name'] = "Syslog Disk File";
$CFG['Sources'][Source1]['SourceType'] = SOURCE_DISK; $CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK;
$CFG['Sources'][Source1]['LogLineType'] = "syslog"; $CFG['Sources']['Source1']['LogLineType'] = "syslog";
$CFG['Sources'][Source1]['DiskFile'] = "/var/log/syslog"; $CFG['Sources']['Source1']['DiskFile'] = "/var/log/syslog";
$CFG['Sources']['Source1']['ViewID'] = "SYSLOG";
$CFG['Sources'][Source2]['ID'] = "Source5"; $CFG['Sources']['Source2']['ID'] = "Source5";
$CFG['Sources'][Source2]['Name'] = "WinSyslog DB"; $CFG['Sources']['Source2']['Name'] = "WinSyslog DB";
$CFG['Sources'][Source2]['SourceType'] = SOURCE_DB; $CFG['Sources']['Source2']['SourceType'] = SOURCE_DB;
$CFG['Sources'][Source2]['DBTableType'] = "winsyslog"; $CFG['Sources']['Source2']['DBTableType'] = "winsyslog";
$CFG['Sources'][Source2]['DBType'] = DB_MYSQL; $CFG['Sources']['Source2']['DBType'] = DB_MYSQL;
$CFG['Sources'][Source2]['DBServer'] = "localhost"; $CFG['Sources']['Source2']['DBServer'] = "localhost";
$CFG['Sources'][Source2]['DBName'] = "phplogcon"; $CFG['Sources']['Source2']['DBName'] = "phplogcon";
$CFG['Sources'][Source2]['DBUser'] = "root"; $CFG['Sources']['Source2']['DBUser'] = "root";
$CFG['Sources'][Source2]['DBPassword'] = ""; $CFG['Sources']['Source2']['DBPassword'] = "";
$CFG['Sources'][Source2]['DBTableName'] = "systemevents"; $CFG['Sources']['Source2']['DBTableName'] = "systemevents";
$CFG['Sources']['Source2']['ViewID'] = "SYSLOG";
*/ */
// --- %Insert Source Here% // --- %Insert Source Here%

View File

@ -55,7 +55,9 @@ define('ERROR_DB_CANNOTSELECTDB', 11);
define('ERROR_DB_QUERYFAILED', 12); define('ERROR_DB_QUERYFAILED', 12);
define('ERROR_DB_NOPROPERTIES', 13); define('ERROR_DB_NOPROPERTIES', 13);
define('ERROR_DB_INVALIDDBMAPPING', 14); define('ERROR_DB_INVALIDDBMAPPING', 14);
define('ERROR_DB_INVALIDDBDRIVER', 16);
define('ERROR_FILE_NOT_READABLE', 15); define('ERROR_FILE_NOT_READABLE', 15);
?> ?>

View File

@ -105,8 +105,9 @@ $content['filter_severity_list'][] = array( "ID" => SYSLOG_DEBUG, "DisplayName"
// --- // ---
// Init MessageType LIST // Init MessageType LIST
$content['filter_messagetype_list'][] = array( "ID" => IUT_Unknown, "DisplayName" => "Unknown", "selected" => "" ); //$content['filter_messagetype_list'][] = array( "ID" => IUT_Unknown, "DisplayName" => "Unknown", "selected" => "" );
$content['filter_messagetype_list'][] = array( "ID" => IUT_Syslog, "DisplayName" => "Syslog", "selected" => "" ); $content['filter_messagetype_list'][] = array( "ID" => IUT_Syslog, "DisplayName" => "Syslog", "selected" => "" );
$content['filter_messagetype_list'][] = array( "ID" => IUT_NT_EventReport, "DisplayName" => "EventReporter", "selected" => "" ); $content['filter_messagetype_list'][] = array( "ID" => IUT_NT_EventReport, "DisplayName" => "WinEventLog", "selected" => "" );
$content['filter_messagetype_list'][] = array( "ID" => IUT_File_Monitor, "DisplayName" => "File Monitor", "selected" => "" );
?> ?>

View File

@ -60,6 +60,7 @@ define('STR_DEBUG_ERROR_WTF', "WTF OMFG");
// --- Source Type defines // --- Source Type defines
define('SOURCE_DISK', '1'); define('SOURCE_DISK', '1');
define('SOURCE_DB', '2'); define('SOURCE_DB', '2');
define('SOURCE_PDO', '3');
// --- // ---
// --- // ---

View File

@ -70,6 +70,13 @@ define('FILTER_TYPE_UNKNOWN', 99);
define('DB_MYSQL', 0); define('DB_MYSQL', 0);
define('DB_MSSQL', 1); define('DB_MSSQL', 1);
define('DB_ODBC', 2); define('DB_ODBC', 2);
define('DB_PGSQL', 3);
define('DB_OCI', 4);
define('DB_DB2', 5);
define('DB_FIREBIRD', 6);
define('DB_INFORMIX', 7);
define('DB_SQLITE', 8);
// --- Predefine fields array! // --- Predefine fields array!
$fields[SYSLOG_UID]['FieldID'] = SYSLOG_UID; $fields[SYSLOG_UID]['FieldID'] = SYSLOG_UID;
@ -89,7 +96,7 @@ $fields[SYSLOG_HOST]['FieldCaptionID'] = 'LN_FIELDS_HOST';
$fields[SYSLOG_HOST]['FieldType'] = FILTER_TYPE_STRING; $fields[SYSLOG_HOST]['FieldType'] = FILTER_TYPE_STRING;
$fields[SYSLOG_HOST]['Sortable'] = true; $fields[SYSLOG_HOST]['Sortable'] = true;
$fields[SYSLOG_HOST]['DefaultWidth'] = "80"; $fields[SYSLOG_HOST]['DefaultWidth'] = "80";
$fields[SYSLOG_HOST]['FieldAlign'] = "center"; $fields[SYSLOG_HOST]['FieldAlign'] = "left";
$fields[SYSLOG_MESSAGETYPE]['FieldID'] = SYSLOG_MESSAGETYPE; $fields[SYSLOG_MESSAGETYPE]['FieldID'] = SYSLOG_MESSAGETYPE;
$fields[SYSLOG_MESSAGETYPE]['FieldCaptionID'] = 'LN_FIELDS_MESSAGETYPE'; $fields[SYSLOG_MESSAGETYPE]['FieldCaptionID'] = 'LN_FIELDS_MESSAGETYPE';
$fields[SYSLOG_MESSAGETYPE]['FieldType'] = FILTER_TYPE_NUMBER; $fields[SYSLOG_MESSAGETYPE]['FieldType'] = FILTER_TYPE_NUMBER;
@ -115,7 +122,7 @@ $fields[SYSLOG_SYSLOGTAG]['FieldCaptionID'] = 'LN_FIELDS_SYSLOGTAG';
$fields[SYSLOG_SYSLOGTAG]['FieldType'] = FILTER_TYPE_STRING; $fields[SYSLOG_SYSLOGTAG]['FieldType'] = FILTER_TYPE_STRING;
$fields[SYSLOG_SYSLOGTAG]['Sortable'] = true; $fields[SYSLOG_SYSLOGTAG]['Sortable'] = true;
$fields[SYSLOG_SYSLOGTAG]['DefaultWidth'] = "85"; $fields[SYSLOG_SYSLOGTAG]['DefaultWidth'] = "85";
$fields[SYSLOG_SYSLOGTAG]['FieldAlign'] = "center"; $fields[SYSLOG_SYSLOGTAG]['FieldAlign'] = "left";
$fields[SYSLOG_PROCESSID]['FieldID'] = SYSLOG_PROCESSID; $fields[SYSLOG_PROCESSID]['FieldID'] = SYSLOG_PROCESSID;
$fields[SYSLOG_PROCESSID]['FieldCaptionID'] = 'LN_FIELDS_PROCESSID'; $fields[SYSLOG_PROCESSID]['FieldCaptionID'] = 'LN_FIELDS_PROCESSID';
$fields[SYSLOG_PROCESSID]['FieldType'] = FILTER_TYPE_NUMBER; $fields[SYSLOG_PROCESSID]['FieldType'] = FILTER_TYPE_NUMBER;
@ -124,6 +131,36 @@ $fields[SYSLOG_PROCESSID]['DefaultWidth'] = "65";
$fields[SYSLOG_PROCESSID]['FieldAlign'] = "center"; $fields[SYSLOG_PROCESSID]['FieldAlign'] = "center";
// TODO! EventLog specific // TODO! EventLog specific
$fields[SYSLOG_EVENT_ID]['FieldID'] = SYSLOG_EVENT_ID;
$fields[SYSLOG_EVENT_ID]['FieldCaptionID'] = 'LN_FIELDS_EVENTID';
$fields[SYSLOG_EVENT_ID]['FieldType'] = FILTER_TYPE_NUMBER;
$fields[SYSLOG_EVENT_ID]['Sortable'] = true;
$fields[SYSLOG_EVENT_ID]['DefaultWidth'] = "65";
$fields[SYSLOG_EVENT_ID]['FieldAlign'] = "center";
$fields[SYSLOG_EVENT_LOGTYPE]['FieldID'] = SYSLOG_EVENT_LOGTYPE;
$fields[SYSLOG_EVENT_LOGTYPE]['FieldCaptionID'] = 'LN_FIELDS_EVENTLOGTYPE';
$fields[SYSLOG_EVENT_LOGTYPE]['FieldType'] = FILTER_TYPE_STRING;
$fields[SYSLOG_EVENT_LOGTYPE]['Sortable'] = true;
$fields[SYSLOG_EVENT_LOGTYPE]['DefaultWidth'] = "100";
$fields[SYSLOG_EVENT_LOGTYPE]['FieldAlign'] = "left";
$fields[SYSLOG_EVENT_SOURCE]['FieldID'] = SYSLOG_EVENT_SOURCE;
$fields[SYSLOG_EVENT_SOURCE]['FieldCaptionID'] = 'LN_FIELDS_EVENTSOURCE';
$fields[SYSLOG_EVENT_SOURCE]['FieldType'] = FILTER_TYPE_STRING;
$fields[SYSLOG_EVENT_SOURCE]['Sortable'] = true;
$fields[SYSLOG_EVENT_SOURCE]['DefaultWidth'] = "100";
$fields[SYSLOG_EVENT_SOURCE]['FieldAlign'] = "left";
$fields[SYSLOG_EVENT_CATEGORY]['FieldID'] = SYSLOG_EVENT_CATEGORY;
$fields[SYSLOG_EVENT_CATEGORY]['FieldCaptionID'] = 'LN_FIELDS_EVENTCATEGORY';
$fields[SYSLOG_EVENT_CATEGORY]['FieldType'] = FILTER_TYPE_NUMBER;
$fields[SYSLOG_EVENT_CATEGORY]['Sortable'] = true;
$fields[SYSLOG_EVENT_CATEGORY]['DefaultWidth'] = "50";
$fields[SYSLOG_EVENT_CATEGORY]['FieldAlign'] = "center";
$fields[SYSLOG_EVENT_USER]['FieldID'] = SYSLOG_EVENT_USER;
$fields[SYSLOG_EVENT_USER]['FieldCaptionID'] = 'LN_FIELDS_EVENTUSER';
$fields[SYSLOG_EVENT_USER]['FieldType'] = FILTER_TYPE_STRING;
$fields[SYSLOG_EVENT_USER]['Sortable'] = true;
$fields[SYSLOG_EVENT_USER]['DefaultWidth'] = "85";
$fields[SYSLOG_EVENT_USER]['FieldAlign'] = "left";
// Message is the last element, this order is important for the Detail page for now! // Message is the last element, this order is important for the Detail page for now!
$fields[SYSLOG_MESSAGE]['FieldID'] = SYSLOG_MESSAGE; $fields[SYSLOG_MESSAGE]['FieldID'] = SYSLOG_MESSAGE;
@ -157,6 +194,15 @@ $dbmapping['syslogng'][SYSLOG_MESSAGE] = "msg";
//TODO $dbmapping['syslogng'][SYSLOG_FACILITY] = "Facility"; //TODO $dbmapping['syslogng'][SYSLOG_FACILITY] = "Facility";
//TODO $dbmapping['syslogng'][SYSLOG_SEVERITY] = "Priority" //TODO $dbmapping['syslogng'][SYSLOG_SEVERITY] = "Priority"
$dbmapping['syslogng'][SYSLOG_SYSLOGTAG] = "tag"; $dbmapping['syslogng'][SYSLOG_SYSLOGTAG] = "tag";
$dbmapping['syslogng'][SYSLOG_PROCESSID] = "program";
// Convert all fieldnames to lowercase to avoid problems with case sensitive array keys later
foreach( $dbmapping as &$myMapping )
{
foreach( $myMapping as &$myField )
$myField = strtolower($myField);
}
// --- // ---
// EventTime Constants // EventTime Constants
@ -164,4 +210,4 @@ define('EVTIME_TIMESTAMP', '0');
define('EVTIME_TIMEZONE', '1'); define('EVTIME_TIMEZONE', '1');
define('EVTIME_MICROSECONDS', '2'); define('EVTIME_MICROSECONDS', '2');
?> ?>

View File

@ -43,17 +43,6 @@ if ( !defined('IN_PHPLOGCON') )
include($gl_root_path . 'include/constants_general.php'); include($gl_root_path . 'include/constants_general.php');
include($gl_root_path . 'include/constants_logstream.php'); include($gl_root_path . 'include/constants_logstream.php');
/*
if ( is_file($gl_root_path . 'config.php') )
include($gl_root_path . 'config.php');
else
{
// Check for installscript!
if ( !defined('IN_PHPLOGCON_INSTALL') )
CheckForInstallPhp();
}
*/
include($gl_root_path . 'classes/class_template.php'); include($gl_root_path . 'classes/class_template.php');
include($gl_root_path . 'include/functions_themes.php'); include($gl_root_path . 'include/functions_themes.php');
include($gl_root_path . 'include/functions_db.php'); include($gl_root_path . 'include/functions_db.php');
@ -73,8 +62,8 @@ $LANG_EN = "en"; // Used for fallback
$LANG = "en"; // Default language $LANG = "en"; // Default language
// Default Template vars // Default Template vars
$content['BUILDNUMBER'] = "2.2.0"; $content['BUILDNUMBER'] = "2.4.0";
$content['TITLE'] = "PhpLogCon - Release " . $content['BUILDNUMBER']; // Title of the Page $content['TITLE'] = "phpLogCon :: Release " . $content['BUILDNUMBER']; // Default page title
$content['BASEPATH'] = $gl_root_path; $content['BASEPATH'] = $gl_root_path;
$content['EXTRA_METATAGS'] = ""; $content['EXTRA_METATAGS'] = "";
$content['EXTRA_JAVASCRIPT'] = ""; $content['EXTRA_JAVASCRIPT'] = "";
@ -96,14 +85,14 @@ function InitBasicPhpLogCon()
// Check RunMode first! // Check RunMode first!
CheckAndSetRunMode(); CheckAndSetRunMode();
// Get and Set RunTime Informations
InitRuntimeInformations();
// Set the default line sep // Set the default line sep
SetLineBreakVar(); SetLineBreakVar();
// Start the PHP Session // Start the PHP Session
StartPHPSession(); StartPHPSession();
// Init View Configs prior loading config.php!
InitViewConfigs();
} }
function InitPhpLogConConfigFile($bHandleMissing = true) function InitPhpLogConConfigFile($bHandleMissing = true)
@ -119,13 +108,14 @@ function InitPhpLogConConfigFile($bHandleMissing = true)
// Easier DB Access // Easier DB Access
define('DB_CONFIG', $CFG['UserDBPref'] . "config"); define('DB_CONFIG', $CFG['UserDBPref'] . "config");
// If DEBUG Mode is enabled, we prepend the UID field into the col list! // Legacy support for old columns definition format!
if ( $CFG['MiscShowDebugMsg'] == 1 ) if ( isset($CFG['Columns']) && is_array($CFG['Columns']) )
array_unshift($CFG['Columns'], SYSLOG_UID); AppendLegacyColumns();
// Now Copy all entries into content variable // --- Now Copy all entries into content variable
foreach ($CFG as $key => $value ) foreach ($CFG as $key => $value )
$content[$key] = $value; $content[$key] = $value;
// ---
// For MiscShowPageRenderStats // For MiscShowPageRenderStats
if ( $CFG['MiscShowPageRenderStats'] == 1 ) if ( $CFG['MiscShowPageRenderStats'] == 1 )
@ -185,6 +175,9 @@ function InitPhpLogCon()
// Will init the config file! // Will init the config file!
InitPhpLogConConfigFile(); InitPhpLogConConfigFile();
// Moved here, because we do not need if GZIP needs to be enabled before the config is loaded!
InitRuntimeInformations();
// Establish DB Connection // Establish DB Connection
if ( $CFG['UserDBEnabled'] ) if ( $CFG['UserDBEnabled'] )
DB_Connect(); DB_Connect();
@ -201,6 +194,12 @@ function InitPhpLogCon()
// Init Predefined Searches List // Init Predefined Searches List
CreatePredefinedSearches(); CreatePredefinedSearches();
// Init predefined paging sizes
CreatePagesizesList();
// Init predefined reload times
CreateReloadTimesList();
// --- Enable PHP Debug Mode // --- Enable PHP Debug Mode
InitPhpDebugMode(); InitPhpDebugMode();
// --- // ---
@ -230,10 +229,15 @@ function CreateSourceTypesList( $selectedSource )
$content['SOURCETYPES'][SOURCE_DISK]['DisplayName'] = $content['LN_GEN_SOURCE_DISK']; $content['SOURCETYPES'][SOURCE_DISK]['DisplayName'] = $content['LN_GEN_SOURCE_DISK'];
if ( $selectedSource == $content['SOURCETYPES'][SOURCE_DISK]['type'] ) { $content['SOURCETYPES'][SOURCE_DISK]['selected'] = "selected"; } else { $content['SOURCETYPES'][SOURCE_DISK]['selected'] = ""; } if ( $selectedSource == $content['SOURCETYPES'][SOURCE_DISK]['type'] ) { $content['SOURCETYPES'][SOURCE_DISK]['selected'] = "selected"; } else { $content['SOURCETYPES'][SOURCE_DISK]['selected'] = ""; }
// SOURCE_DB // SOURCE_DB ( MYSQL NATIVE )
$content['SOURCETYPES'][SOURCE_DB]['type'] = SOURCE_DB; $content['SOURCETYPES'][SOURCE_DB]['type'] = SOURCE_DB;
$content['SOURCETYPES'][SOURCE_DB]['DisplayName'] = $content['LN_GEN_SOURCE_DB']; $content['SOURCETYPES'][SOURCE_DB]['DisplayName'] = $content['LN_GEN_SOURCE_DB'];
if ( $selectedSource == $content['SOURCETYPES'][SOURCE_DB]['type'] ) { $content['SOURCETYPES'][SOURCE_DB]['selected'] = "selected"; } else { $content['SOURCETYPES'][SOURCE_DISK]['selected'] = ""; } if ( $selectedSource == $content['SOURCETYPES'][SOURCE_DB]['type'] ) { $content['SOURCETYPES'][SOURCE_DB]['selected'] = "selected"; } else { $content['SOURCETYPES'][SOURCE_DB]['selected'] = ""; }
// SOURCE_PDO ( PDO DB Wrapper)
$content['SOURCETYPES'][SOURCE_PDO]['type'] = SOURCE_PDO;
$content['SOURCETYPES'][SOURCE_PDO]['DisplayName'] = $content['LN_GEN_SOURCE_PDO'];
if ( $selectedSource == $content['SOURCETYPES'][SOURCE_PDO]['type'] ) { $content['SOURCETYPES'][SOURCE_PDO]['selected'] = "selected"; } else { $content['SOURCETYPES'][SOURCE_PDO]['selected'] = ""; }
} }
function CreateDBTypesList( $selectedDBType ) function CreateDBTypesList( $selectedDBType )
@ -242,20 +246,105 @@ function CreateDBTypesList( $selectedDBType )
// DB_MYSQL // DB_MYSQL
$content['DBTYPES'][DB_MYSQL]['type'] = DB_MYSQL; $content['DBTYPES'][DB_MYSQL]['type'] = DB_MYSQL;
$content['DBTYPES'][DB_MYSQL]['DisplayName'] = "Mysql"; $content['DBTYPES'][DB_MYSQL]['typeastext'] = "DB_MYSQL";
$content['DBTYPES'][DB_MYSQL]['DisplayName'] = $content['LN_GEN_DB_MYSQL'];
if ( $selectedDBType == $content['DBTYPES'][DB_MYSQL]['type'] ) { $content['DBTYPES'][DB_MYSQL]['selected'] = "selected"; } else { $content['DBTYPES'][DB_MYSQL]['selected'] = ""; } if ( $selectedDBType == $content['DBTYPES'][DB_MYSQL]['type'] ) { $content['DBTYPES'][DB_MYSQL]['selected'] = "selected"; } else { $content['DBTYPES'][DB_MYSQL]['selected'] = ""; }
/* LATER ...
// DB_MSSQL // DB_MSSQL
$content['DBTYPES'][DB_MSSQL]['type'] = DB_MSSQL; $content['DBTYPES'][DB_MSSQL]['type'] = DB_MSSQL;
$content['DBTYPES'][DB_MSSQL]['DisplayName'] = "Microsoft SQL Server"; $content['DBTYPES'][DB_MSSQL]['typeastext'] = "DB_MSSQL";
$content['DBTYPES'][DB_MSSQL]['DisplayName'] = $content['LN_GEN_DB_MSSQL'];
if ( $selectedDBType == $content['DBTYPES'][DB_MSSQL]['type'] ) { $content['DBTYPES'][DB_MSSQL]['selected'] = "selected"; } else { $content['DBTYPES'][DB_MSSQL]['selected'] = ""; } if ( $selectedDBType == $content['DBTYPES'][DB_MSSQL]['type'] ) { $content['DBTYPES'][DB_MSSQL]['selected'] = "selected"; } else { $content['DBTYPES'][DB_MSSQL]['selected'] = ""; }
// DB_ODBC // DB_ODBC
$content['DBTYPES'][DB_ODBC]['type'] = DB_MSSQL; $content['DBTYPES'][DB_ODBC]['type'] = DB_ODBC;
$content['DBTYPES'][DB_ODBC]['DisplayName'] = "ODBC Database Source"; $content['DBTYPES'][DB_ODBC]['typeastext'] = "DB_ODBC";
if ( $selectedDBType == $content['DBTYPES'][DB_ODBC]['type'] ) { $content['DBTYPES'][DB_ODBC]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_MSSQL]['selected'] = ""; } $content['DBTYPES'][DB_ODBC]['DisplayName'] = $content['LN_GEN_DB_ODBC'];
*/ if ( $selectedDBType == $content['DBTYPES'][DB_ODBC]['type'] ) { $content['DBTYPES'][DB_ODBC]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_ODBC]['selected'] = ""; }
// DB_PGSQL
$content['DBTYPES'][DB_PGSQL]['type'] = DB_PGSQL;
$content['DBTYPES'][DB_PGSQL]['typeastext'] = "DB_PGSQL";
$content['DBTYPES'][DB_PGSQL]['DisplayName'] = $content['LN_GEN_DB_PGSQL'];
if ( $selectedDBType == $content['DBTYPES'][DB_PGSQL]['type'] ) { $content['DBTYPES'][DB_PGSQL]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_PGSQL]['selected'] = ""; }
// DB_OCI
$content['DBTYPES'][DB_OCI]['type'] = DB_OCI;
$content['DBTYPES'][DB_OCI]['typeastext'] = "DB_OCI";
$content['DBTYPES'][DB_OCI]['DisplayName'] = $content['LN_GEN_DB_OCI'];
if ( $selectedDBType == $content['DBTYPES'][DB_OCI]['type'] ) { $content['DBTYPES'][DB_OCI]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_OCI]['selected'] = ""; }
// DB_DB2
$content['DBTYPES'][DB_DB2]['type'] = DB_DB2;
$content['DBTYPES'][DB_DB2]['typeastext'] = "DB_DB2";
$content['DBTYPES'][DB_DB2]['DisplayName'] = $content['LN_GEN_DB_DB2'];
if ( $selectedDBType == $content['DBTYPES'][DB_DB2]['type'] ) { $content['DBTYPES'][DB_DB2]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_DB2]['selected'] = ""; }
// DB_FIREBIRD
$content['DBTYPES'][DB_FIREBIRD]['type'] = DB_FIREBIRD;
$content['DBTYPES'][DB_FIREBIRD]['typeastext'] = "DB_FIREBIRD";
$content['DBTYPES'][DB_FIREBIRD]['DisplayName'] = $content['LN_GEN_DB_FIREBIRD'];
if ( $selectedDBType == $content['DBTYPES'][DB_FIREBIRD]['type'] ) { $content['DBTYPES'][DB_FIREBIRD]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_FIREBIRD]['selected'] = ""; }
// DB_INFORMIX
$content['DBTYPES'][DB_INFORMIX]['type'] = DB_INFORMIX;
$content['DBTYPES'][DB_INFORMIX]['typeastext'] = "DB_INFORMIX";
$content['DBTYPES'][DB_INFORMIX]['DisplayName'] = $content['LN_GEN_DB_INFORMIX'];
if ( $selectedDBType == $content['DBTYPES'][DB_INFORMIX]['type'] ) { $content['DBTYPES'][DB_INFORMIX]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_INFORMIX]['selected'] = ""; }
// DB_SQLITE
$content['DBTYPES'][DB_SQLITE]['type'] = DB_SQLITE;
$content['DBTYPES'][DB_SQLITE]['typeastext'] = "DB_SQLITE";
$content['DBTYPES'][DB_SQLITE]['DisplayName'] = $content['LN_GEN_DB_SQLITE'];
if ( $selectedDBType == $content['DBTYPES'][DB_SQLITE]['type'] ) { $content['DBTYPES'][DB_SQLITE]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_SQLITE]['selected'] = ""; }
}
function CreatePagesizesList()
{
global $CFG, $content;
$iCounter = 0;
$content['pagesizes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => $content['LN_GEN_PRECONFIGURED'] . " (" . $CFG['ViewEntriesPerPage'] . ")", "Value" => $CFG['ViewEntriesPerPage'] ); $iCounter++;
$content['pagesizes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 25 " . $content['LN_GEN_RECORDSPERPAGE'], "Value" => 25 ); $iCounter++;
$content['pagesizes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 50 " . $content['LN_GEN_RECORDSPERPAGE'], "Value" => 50 ); $iCounter++;
$content['pagesizes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 75 " . $content['LN_GEN_RECORDSPERPAGE'], "Value" => 75 ); $iCounter++;
$content['pagesizes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 100 " . $content['LN_GEN_RECORDSPERPAGE'], "Value" => 100 ); $iCounter++;
$content['pagesizes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 250 " . $content['LN_GEN_RECORDSPERPAGE'], "Value" => 250 ); $iCounter++;
$content['pagesizes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 500 " . $content['LN_GEN_RECORDSPERPAGE'], "Value" => 500 ); $iCounter++;
// Set default selected pagesize
$content['pagesizes'][ $_SESSION['PAGESIZE_ID'] ]["Selected"] = "selected";
// The content variable will now contain the user selected oaging size
$content["ViewEntriesPerPage"] = $content['pagesizes'][ $_SESSION['PAGESIZE_ID'] ]["Value"];
}
function CreateReloadTimesList()
{
global $CFG, $content;
// $CFG['ViewEnableAutoReloadSeconds']
$iCounter = 0;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => $content['LN_AUTORELOAD_DISABLED'], "Value" => 0 ); $iCounter++;
if ( isset($CFG['ViewEnableAutoReloadSeconds']) && $CFG['ViewEnableAutoReloadSeconds'] > 0 )
{
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => $content['LN_AUTORELOAD_PRECONFIGURED'] . " (" . $CFG['ViewEnableAutoReloadSeconds'] . " " . $content['LN_AUTORELOAD_SECONDS'] . ") ", "Value" => $CFG['ViewEnableAutoReloadSeconds'] ); $iCounter++;
}
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 5 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 5 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 10 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 10 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 15 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 15 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 30 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 30 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 60 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 60 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 5 " . $content['LN_AUTORELOAD_MINUTES'], "Value" => 300 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 10 " . $content['LN_AUTORELOAD_MINUTES'], "Value" => 600 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 15 " . $content['LN_AUTORELOAD_MINUTES'], "Value" => 900 ); $iCounter++;
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 30 " . $content['LN_AUTORELOAD_MINUTES'], "Value" => 1800 ); $iCounter++;
// Set default selected autoreloadid
$content['reloadtimes'][ $_SESSION['AUTORELOAD_ID'] ]["Selected"] = "selected";
// The content variable will now contain the user selected oaging size
$content["ViewEnableAutoReloadSeconds"] = $content['reloadtimes'][ $_SESSION['AUTORELOAD_ID'] ]["Value"];
} }
@ -301,17 +390,30 @@ function InitPhpDebugMode()
function CheckAndSetRunMode() function CheckAndSetRunMode()
{ {
global $RUNMODE; global $RUNMODE, $MaxExecutionTime;
// Set to command line mode if argv is set! // Set to command line mode if argv is set!
if ( !isset($_SERVER["GATEWAY_INTERFACE"]) ) if ( !isset($_SERVER["GATEWAY_INTERFACE"]) )
$RUNMODE = RUNMODE_COMMANDLINE; $RUNMODE = RUNMODE_COMMANDLINE;
// Obtain max_execution_time
$MaxExecutionTime = ini_get("max_execution_time");
} }
function InitRuntimeInformations() function InitRuntimeInformations()
{ {
global $content; global $content, $CFG;
// TODO| maybe not needed! // TODO| maybe not needed!
// Enable GZIP Compression if enabled!
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && (isset($CFG['MiscEnableGzipCompression']) && $CFG['MiscEnableGzipCompression'] == 1) )
{
// This starts gzip compression!
ob_start("ob_gzhandler");
$content['GzipCompressionEnmabled'] = "yes";
}
else
$content['GzipCompressionEnmabled'] = "no";
} }
function CreateDebugModes() function CreateDebugModes()
@ -334,17 +436,22 @@ function InitFrontEndVariables()
{ {
global $content; global $content;
$content['MENU_FOLDER_OPEN'] = "image=" . $content['BASEPATH'] . "images/icons/folder_closed.png"; $content['MENU_FOLDER_OPEN'] = $content['BASEPATH'] . "images/icons/folder_closed.png";
$content['MENU_FOLDER_CLOSED'] = "overimage=" . $content['BASEPATH'] . "images/icons/folder.png"; $content['MENU_FOLDER_CLOSED'] = $content['BASEPATH'] . "images/icons/folder.png";
$content['MENU_HOMEPAGE'] = "image=" . $content['BASEPATH'] . "images/icons/home.png"; $content['MENU_HOMEPAGE'] = $content['BASEPATH'] . "images/icons/home.png";
$content['MENU_LINK'] = "image=" . $content['BASEPATH'] . "images/icons/link.png"; $content['MENU_LINK'] = $content['BASEPATH'] . "images/icons/link.png";
$content['MENU_PREFERENCES'] = "image=" . $content['BASEPATH'] . "images/icons/preferences.png"; $content['MENU_LINK_VIEW'] = $content['BASEPATH'] . "images/icons/link_view.png";
$content['MENU_ADMINENTRY'] = "image=" . $content['BASEPATH'] . "images/icons/star_blue.png"; $content['MENU_VIEW'] = $content['BASEPATH'] . "images/icons/view.png";
$content['MENU_ADMINLOGOFF'] = "image=" . $content['BASEPATH'] . "images/icons/exit.png"; $content['MENU_PREFERENCES'] = $content['BASEPATH'] . "images/icons/preferences.png";
$content['MENU_ADMINUSERS'] = "image=" . $content['BASEPATH'] . "images/icons/businessmen.png"; $content['MENU_ADMINENTRY'] = $content['BASEPATH'] . "images/icons/star_blue.png";
$content['MENU_SEARCH'] = "image=" . $content['BASEPATH'] . "images/icons/view.png"; $content['MENU_ADMINLOGOFF'] = $content['BASEPATH'] . "images/icons/exit.png";
$content['MENU_SELECTION_DISABLED'] = "image=" . $content['BASEPATH'] . "images/icons/selection.png"; $content['MENU_ADMINUSERS'] = $content['BASEPATH'] . "images/icons/businessmen.png";
$content['MENU_SELECTION_ENABLED'] = "image=" . $content['BASEPATH'] . "images/icons/selection_delete.png"; $content['MENU_SEARCH'] = $content['BASEPATH'] . "images/icons/view.png";
$content['MENU_SELECTION_DISABLED'] = $content['BASEPATH'] . "images/icons/selection.png";
$content['MENU_SELECTION_ENABLED'] = $content['BASEPATH'] . "images/icons/selection_delete.png";
$content['MENU_TEXT_FIND'] = $content['BASEPATH'] . "images/icons/text_find.png";
$content['MENU_NETWORK'] = $content['BASEPATH'] . "images/icons/earth_network.png";
$content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png"; $content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png";
$content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png"; $content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png";
@ -354,11 +461,18 @@ function InitFrontEndVariables()
$content['MENU_NAV_RIGHT'] = $content['BASEPATH'] . "images/icons/navigate_right.png"; $content['MENU_NAV_RIGHT'] = $content['BASEPATH'] . "images/icons/navigate_right.png";
$content['MENU_NAV_CLOSE'] = $content['BASEPATH'] . "images/icons/navigate_close.png"; $content['MENU_NAV_CLOSE'] = $content['BASEPATH'] . "images/icons/navigate_close.png";
$content['MENU_NAV_OPEN'] = $content['BASEPATH'] . "images/icons/navigate_open.png"; $content['MENU_NAV_OPEN'] = $content['BASEPATH'] . "images/icons/navigate_open.png";
$content['MENU_PAGER_BEGIN_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_beginning.png"; $content['MENU_PAGER_BEGIN_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_beginning.png";
$content['MENU_PAGER_PREVIOUS_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_rewind.png"; $content['MENU_PAGER_PREVIOUS_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_rewind.png";
$content['MENU_PAGER_NEXT_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_fast_forward.png"; $content['MENU_PAGER_NEXT_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_fast_forward.png";
$content['MENU_PAGER_END_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_end.png"; $content['MENU_PAGER_END_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_end.png";
$content['MENU_BULLET_BLUE'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_blue.png";
$content['MENU_BULLET_GREEN'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_green.png";
$content['MENU_BULLET_RED'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_red.png";
$content['MENU_BULLET_YELLOW'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_yellow.png";
$content['MENU_BULLET_GREY'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_grey.png";
$content['MENU_ICON_GOOGLE'] = $content['BASEPATH'] . "images/icons/googleicon.png";
} }
// Lang Helper for Strings with ONE variable // Lang Helper for Strings with ONE variable
@ -430,6 +544,22 @@ function InitConfigurationValues()
} }
} }
// Paging Size handling!
if ( !isset($_SESSION['PAGESIZE_ID']) )
{
// Default is 0!
$_SESSION['PAGESIZE_ID'] = 0;
}
// Auto reload handling!
if ( !isset($_SESSION['AUTORELOAD_ID']) )
{
if ( isset($CFG['ViewEnableAutoReloadSeconds']) && $CFG['ViewEnableAutoReloadSeconds'] > 0 )
$_SESSION['AUTORELOAD_ID'] = 1; // Autoreload ID will be the first item!
else // Default is 0, which means auto reload disabled
$_SESSION['AUTORELOAD_ID'] = 0;
}
// Theme Handling // Theme Handling
if ( !isset($content['web_theme']) ) { $content['web_theme'] = $CFG['ViewDefaultTheme'] /*"default"*/; } if ( !isset($content['web_theme']) ) { $content['web_theme'] = $CFG['ViewDefaultTheme'] /*"default"*/; }
if ( isset($_SESSION['CUSTOM_THEME']) && VerifyTheme($_SESSION['CUSTOM_THEME']) ) if ( isset($_SESSION['CUSTOM_THEME']) && VerifyTheme($_SESSION['CUSTOM_THEME']) )
@ -535,6 +665,29 @@ function DieWithFriendlyErrorMsg( $szerrmsg )
exit; exit;
} }
/*
* Helper function to initialize the page title!
*/
function InitPageTitle()
{
global $content, $CFG, $currentSourceID;
if ( isset($CFG['PrependTitle']) && strlen($CFG['PrependTitle']) > 0 )
$szReturn = $CFG['PrependTitle'] . " :: ";
else
$szReturn = "";
if ( isset($currentSourceID) && isset($content['Sources'][$currentSourceID]['Name']) )
$szReturn .= "Source '" . $content['Sources'][$currentSourceID]['Name'] . "' :: ";
// Append phpLogCon
$szReturn .= "phpLogCon";
// return result
return $szReturn;
}
function GetStringWithHTMLCodes($myStr) function GetStringWithHTMLCodes($myStr)
{ {
// Replace all special characters with valid html representations // Replace all special characters with valid html representations
@ -649,7 +802,12 @@ function GetEventTime($szTimStr)
} }
else else
{ {
die ("wtf GetEventTime unparsable time - " . $szTimStr ); $eventtime[EVTIME_TIMESTAMP] = 0;
$eventtime[EVTIME_TIMEZONE] = date_default_timezone_get(); // WTF TODO!
$eventtime[EVTIME_MICROSECONDS] = 0;
// Print Error!
OutputDebugMessage("GetEventTime got an unparsable time '" . $szTimStr . "', returning 0");
} }
// return result! // return result!
@ -692,6 +850,123 @@ function GetMonthFromString($szMonth)
} }
} }
/*
* AddContextLinks
*/
function AddContextLinks(&$sourceTxt)
{
global $szTLDDomains, $CFG;
// Return if not enabled!
if ( !isset($CFG['EnableIPAddressResolve']) || $CFG['EnableIPAddressResolve'] == 1 )
{
// Search for IP's and Add Reverse Lookup first!
$sourceTxt = preg_replace( '/([^\[])\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/e', "'\\1\\2.\\3.\\4.\\5' . ReverseResolveIP('\\2.\\3.\\4.\\5', '<font class=\"highlighted\"> {', '} </font>')", $sourceTxt );
}
// Create if not set!
if ( !isset($szTLDDomains) )
CreateTopLevelDomainSearch();
// Create Search Array
$search = array
(
'/\.([\w\d\_\-]+)\.(' . $szTLDDomains . ')([^a-zA-Z0-9\.])/e',
/* (?:127)| */ '/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/e',
);
// Create Replace Array
$replace = array
(
"'.' . InsertLookupLink(\"\", \"\\1.\\2\", \"\", \"\\3\")",
"InsertLookupLink(\"\\1.\\2.\\3.\\4\", \"\", \"\", \"\")",
);
// Replace and return!
$sourceTxt = preg_replace( $search, $replace, $sourceTxt );
//echo $outTxt . " <br>" ;
//return $outTxt;
}
/*
* Helper to create a Lookup Link!
*/
function InsertLookupLink( $szIP, $szDomain, $prepend, $append )
{
// Create string
$szReturn = $prepend;
if ( strlen($szIP) > 0 )
{
// Split IP into array
$IPArray = explode(".", $szIP);
if (
(intval($IPArray[0]) == 10 ) ||
(intval($IPArray[0]) == 127 ) ||
(intval($IPArray[0]) == 172 && intval($IPArray[1]) >= 16 && intval($IPArray[1]) <= 31) ||
(intval($IPArray[0]) == 192 && intval($IPArray[1]) == 168) ||
(intval($IPArray[0]) == 255 )
)
// Do not create a LINK in this case!
$szReturn .= '<b>' . $szIP . '</b>';
else
// Normal LINK!
$szReturn .= '<a href="http://kb.monitorware.com/kbsearch.php?sa=whois&oid=ip&origin=phplogcon&q=' . $szIP . '" target="_top" class="contextlink">' . $szIP . '</a>';
}
else if ( strlen($szDomain) > 0 )
$szReturn .= '<a href="http://kb.monitorware.com/kbsearch.php?sa=whois&oid=name&origin=phplogcon&q=' . $szDomain . '" target="_top" class="contextlink">' . $szDomain . '</a>';
$szReturn .= $append;
// return result
return $szReturn;
}
/*
* Reserve Resolve IP Address!
*/
function ReverseResolveIP( $szIP, $prepend, $append )
{
global $gl_starttime, $MaxExecutionTime;
// Substract 5 savety seconds!
$scriptruntime = intval(microtime_float() - $gl_starttime);
if ( $scriptruntime > ($MaxExecutionTime-5) )
return "";
// Abort if these IP's are postet
if ( strpos($szIP, "0.0.0.0") !== false | strpos($szIP, "127.") !== false | strpos($szIP, "255.255.255.255") !== false )
return "";
else
{
// Resolve name if needed
if ( !isset($_SESSION['dns_cache'][$szIP]) )
$_SESSION['dns_cache'][$szIP] = gethostbyaddr($szIP);
// Abort if IP and RESOLVED name are the same ^^!
if ( $_SESSION['dns_cache'][$szIP] == $szIP || strlen($_SESSION['dns_cache'][$szIP]) <= 0 )
return;
// Create string
$szReturn = $prepend;
$szReturn .= $_SESSION['dns_cache'][$szIP];
$szReturn .= $append;
// return result
return $szReturn;
}
}
/*
* Helper function to create a top level domain search string ONCE per process!
*/
function CreateTopLevelDomainSearch()
{
// Current list taken from http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains!
global $szTLDDomains;
$szTLDDomains = "co.th|com.au|co.uk|co.jp";
$szTLDDomains .= "aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|cTLD|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw";
}
// --- BEGIN Usermanagement Function --- // --- BEGIN Usermanagement Function ---
function StartPHPSession() function StartPHPSession()
@ -820,4 +1095,4 @@ function RedirectToDatabaseUpgrade()
// --- END Usermanagement Function --- // --- END Usermanagement Function ---
?> ?>

View File

@ -64,6 +64,23 @@
if ( !isset($mysource['LogLineType']) ) if ( !isset($mysource['LogLineType']) )
$content['Sources'][$iSourceID]['LogLineType'] = "syslog"; $content['Sources'][$iSourceID]['LogLineType'] = "syslog";
// Set different view if necessary
if ( isset($_SESSION[$iSourceID . "-View"]) )
{
// Overwrite configured view!
$content['Sources'][$iSourceID]['ViewID'] = $_SESSION[$iSourceID . "-View"];
}
else
{
if ( isset($mysource['ViewID']) )
// Set to configured Source ViewID
$content['Sources'][$iSourceID]['ViewID'] = $mysource['ViewID'];
else
// Not configured, maybe old legacy cfg. Set default view.
$content['Sources'][$iSourceID]['ViewID'] = strlen($CFG['DefaultViewsID']) > 0 ? $CFG['DefaultViewsID'] : "SYSLOG";
}
// Only for the display box // Only for the display box
$content['Sources'][$iSourceID]['selected'] = ""; $content['Sources'][$iSourceID]['selected'] = "";
@ -85,7 +102,12 @@
$content['Sources'][$iSourceID]['ObjRef'] = new LogStreamConfigDB(); $content['Sources'][$iSourceID]['ObjRef'] = new LogStreamConfigDB();
$content['Sources'][$iSourceID]['ObjRef']->DBServer = $mysource['DBServer']; $content['Sources'][$iSourceID]['ObjRef']->DBServer = $mysource['DBServer'];
$content['Sources'][$iSourceID]['ObjRef']->DBName = $mysource['DBName']; $content['Sources'][$iSourceID]['ObjRef']->DBName = $mysource['DBName'];
$content['Sources'][$iSourceID]['ObjRef']->DBType = $mysource['DBType']; // Workaround a little bug from the installer script
if ( isset($mysource['DBType']) )
$content['Sources'][$iSourceID]['ObjRef']->DBType = $mysource['DBType'];
else
$content['Sources'][$iSourceID]['ObjRef']->DBType = DB_MYSQL;
$content['Sources'][$iSourceID]['ObjRef']->DBTableName = $mysource['DBTableName']; $content['Sources'][$iSourceID]['ObjRef']->DBTableName = $mysource['DBTableName'];
// Legacy handling for tabletype! // Legacy handling for tabletype!
@ -98,6 +120,25 @@
if ( isset($mysource['DBPort']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBPort = $mysource['DBPort']; } if ( isset($mysource['DBPort']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBPort = $mysource['DBPort']; }
if ( isset($mysource['DBUser']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBUser = $mysource['DBUser']; } if ( isset($mysource['DBUser']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBUser = $mysource['DBUser']; }
if ( isset($mysource['DBPassword']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBPassword = $mysource['DBPassword']; } if ( isset($mysource['DBPassword']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBPassword = $mysource['DBPassword']; }
if ( isset($mysource['DBEnableRowCounting']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBEnableRowCounting = $mysource['DBEnableRowCounting']; }
}
else if ( $mysource['SourceType'] == SOURCE_PDO )
{
// Perform necessary include
require_once($gl_root_path . 'classes/logstreamconfigpdo.class.php');
$content['Sources'][$iSourceID]['ObjRef'] = new LogStreamConfigPDO();
$content['Sources'][$iSourceID]['ObjRef']->DBServer = $mysource['DBServer'];
$content['Sources'][$iSourceID]['ObjRef']->DBName = $mysource['DBName'];
$content['Sources'][$iSourceID]['ObjRef']->DBType = $mysource['DBType'];
$content['Sources'][$iSourceID]['ObjRef']->DBTableName = $mysource['DBTableName'];
$content['Sources'][$iSourceID]['ObjRef']->DBTableType = strtolower($mysource['DBTableType']);
// Optional parameters!
if ( isset($mysource['DBPort']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBPort = $mysource['DBPort']; }
if ( isset($mysource['DBUser']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBUser = $mysource['DBUser']; }
if ( isset($mysource['DBPassword']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBPassword = $mysource['DBPassword']; }
if ( isset($mysource['DBEnableRowCounting']) ) { $content['Sources'][$iSourceID]['ObjRef']->DBEnableRowCounting = $mysource['DBEnableRowCounting']; }
} }
else else
{ {
@ -131,13 +172,88 @@
$currentSourceID = $_SESSION['currentSourceID']; $currentSourceID = $_SESSION['currentSourceID'];
else else
{ {
// No Source stored in session, then to so now! if ( isset($CFG['DefaultSourceID']) && isset($content['Sources'][ $CFG['DefaultSourceID'] ]) )
$_SESSION['currentSourceID'] = $currentSourceID; // Set Source to preconfigured sourceID!
$_SESSION['currentSourceID'] = $CFG['DefaultSourceID'];
else
// No Source stored in session, then to so now!
$_SESSION['currentSourceID'] = $currentSourceID;
} }
} }
// Set for the selection box in the header // Set for the selection box in the header
$content['Sources'][$currentSourceID]['selected'] = "selected"; $content['Sources'][$currentSourceID]['selected'] = "selected";
// --- Additional handling needed for the current view!
global $currentViewID;
$currentViewID = $content['Sources'][$currentSourceID]['ViewID'];
// Set selected state for correct View, for selection box ^^
$content['Views'][ $currentViewID ]['selected'] = "selected";
// If DEBUG Mode is enabled, we prepend the UID field into the col list!
if ( $CFG['MiscShowDebugMsg'] == 1 && isset($content['Views'][$currentViewID]) )
array_unshift( $content['Views'][$currentViewID]['Columns'], SYSLOG_UID);
// ---
} }
?> /*
* This function Inits preconfigured Views.
*/
function InitViewConfigs()
{
global $CFG, $content, $currentViewID;
// Predefined phpLogCon Views
$CFG['Views']['SYSLOG']= array(
'ID' => "SYSLOG",
'DisplayName' =>"Syslog Fields",
'Columns' => array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_SEVERITY, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_PROCESSID, SYSLOG_MESSAGETYPE, SYSLOG_MESSAGE ),
);
$CFG['Views']['EVTRPT']= array(
'ID' => "EVTRPT",
'DisplayName' =>"EventLog Fields",
'Columns' => array ( SYSLOG_DATE, SYSLOG_HOST, SYSLOG_SEVERITY, SYSLOG_EVENT_LOGTYPE, SYSLOG_EVENT_SOURCE, SYSLOG_EVENT_ID, SYSLOG_EVENT_USER, SYSLOG_MESSAGE ),
);
// Set default of 'DefaultViewsID'
$CFG['DefaultViewsID'] = "SYSLOG";
// Loop through views now and copy into content array!
foreach ( $CFG['Views'] as $key => $view )
{
$content['Views'][$key] = $view;
/*
// Set View from session if available!
if ( isset($_SESSION['currentSourceID']) )
{
$currentSourceID = $_SESSION['currentSourceID'];
if ( isset($_SESSION[$currentSourceID . "-View"]) && )
$content['Views'][$key]['selected'] = "selected";
}
*/
}
}
/*
* This function Inits preconfigured Views.
*/
function AppendLegacyColumns()
{
global $CFG, $content;
// Init View from legacy Columns
$CFG['Views']['LEGACY']= array(
'ID' => "LEGACY",
'DisplayName' =>"Legacy Columns Configuration",
'Columns' => $CFG['Columns'],
);
// set default to legacy of no default view is specified!
if ( !isset($CFG['DefaultViewsID']) || strlen($CFG['DefaultViewsID']) <= 0 )
$CFG['DefaultViewsID'] = "LEGACY";
}
?>

View File

@ -150,27 +150,25 @@ function InitFilterHelpers()
if ( $filters['filter_lastx_default'] == DATE_LASTX_31DAYS ) { $content['filter_daterange_last_x_list'][4]['selected'] = "selected"; } else { $content['filter_daterange_last_x_list'][4]['selected'] = ""; } if ( $filters['filter_lastx_default'] == DATE_LASTX_31DAYS ) { $content['filter_daterange_last_x_list'][4]['selected'] = "selected"; } else { $content['filter_daterange_last_x_list'][4]['selected'] = ""; }
// --- // ---
// Init Default Syslog Facility from SESSION! // --- Init Default Syslog Facility from SESSION!
if ( isset($_SESSION['filter_facility']) ) if ( isset($_SESSION['filter_facility']) )
$filters['filter_facility'] = intval($_SESSION['filter_facility']); $filters['filter_facility'] = intval($_SESSION['filter_facility']);
else else
$filters['filter_facility'] = array ( SYSLOG_KERN, SYSLOG_USER, SYSLOG_MAIL, SYSLOG_DAEMON, SYSLOG_AUTH, SYSLOG_SYSLOG, SYSLOG_LPR, SYSLOG_NEWS, SYSLOG_UUCP, SYSLOG_CRON, SYSLOG_LOCAL0, SYSLOG_LOCAL1, SYSLOG_LOCAL2, SYSLOG_LOCAL3, SYSLOG_LOCAL4, SYSLOG_LOCAL5, SYSLOG_LOCAL6, SYSLOG_LOCAL7 ); $filters['filter_facility'] = array ( SYSLOG_KERN, SYSLOG_USER, SYSLOG_MAIL, SYSLOG_DAEMON, SYSLOG_AUTH, SYSLOG_SYSLOG, SYSLOG_LPR, SYSLOG_NEWS, SYSLOG_UUCP, SYSLOG_CRON, SYSLOG_SECURITY, SYSLOG_FTP, SYSLOG_NTP, SYSLOG_LOGAUDIT, SYSLOG_LOGALERT, SYSLOG_CLOCK, SYSLOG_LOCAL0, SYSLOG_LOCAL1, SYSLOG_LOCAL2, SYSLOG_LOCAL3, SYSLOG_LOCAL4, SYSLOG_LOCAL5, SYSLOG_LOCAL6, SYSLOG_LOCAL7 );
// $filters['filter_facility'] = SYSLOG_LOCAL0;
$iCount = count($content['filter_facility_list']); $iCount = count($content['filter_facility_list']);
for ( $i = 0; $i < $iCount; $i++ ) for ( $i = 0; $i < $iCount; $i++ )
{ {
// echo $content['filter_facility_list'][$i]["ID"] . "-" . $filters['filter_facility'] . "<br>";
if ( in_array($content['filter_facility_list'][$i]["ID"], $filters['filter_facility']) ) if ( in_array($content['filter_facility_list'][$i]["ID"], $filters['filter_facility']) )
$content['filter_facility_list'][$i]["selected"] = "selected"; $content['filter_facility_list'][$i]["selected"] = "selected";
} }
// ---
// Init Default Syslog Severity from SESSION! // --- Init Default Syslog Severity from SESSION!
if ( isset($_SESSION['filter_severity']) ) if ( isset($_SESSION['filter_severity']) )
$filters['filter_severity'] = intval($_SESSION['filter_severity']); $filters['filter_severity'] = intval($_SESSION['filter_severity']);
else else
$filters['filter_severity'] = array ( SYSLOG_EMERG, SYSLOG_ALERT, SYSLOG_CRIT, SYSLOG_ERR, SYSLOG_WARNING, SYSLOG_NOTICE, SYSLOG_INFO, SYSLOG_DEBUG ); $filters['filter_severity'] = array ( SYSLOG_EMERG, SYSLOG_ALERT, SYSLOG_CRIT, SYSLOG_ERR, SYSLOG_WARNING, SYSLOG_NOTICE, SYSLOG_INFO, SYSLOG_DEBUG );
// $filters['filter_severity'] = SYSLOG_NOTICE;
$iCount = count($content['filter_severity_list']); $iCount = count($content['filter_severity_list']);
for ( $i = 0; $i < $iCount; $i++ ) for ( $i = 0; $i < $iCount; $i++ )
@ -178,6 +176,21 @@ function InitFilterHelpers()
if ( in_array( $content['filter_severity_list'][$i]["ID"], $filters['filter_severity']) ) if ( in_array( $content['filter_severity_list'][$i]["ID"], $filters['filter_severity']) )
$content['filter_severity_list'][$i]["selected"] = "selected"; $content['filter_severity_list'][$i]["selected"] = "selected";
} }
// ---
// --- Init Default Message Type from SESSION!
if ( isset($_SESSION['filter_messagetype']) )
$filters['filter_messagetype'] = intval($_SESSION['filter_messagetype']);
else
$filters['filter_messagetype'] = array ( IUT_Syslog, IUT_NT_EventReport, IUT_File_Monitor );
$iCount = count($content['filter_messagetype_list']);
for ( $i = 0; $i < $iCount; $i++ )
{
if ( in_array( $content['filter_messagetype_list'][$i]["ID"], $filters['filter_messagetype']) )
$content['filter_messagetype_list'][$i]["selected"] = "selected";
}
// ---
} }
@ -254,4 +267,4 @@ function GetTimeStampFromTimeString($szTimeString)
} }
} }
?> ?>

View File

@ -67,13 +67,36 @@ function InstallFileReminder()
function CreateCurrentUrl() function CreateCurrentUrl()
{ {
global $content; global $content, $CFG;
$content['CURRENTURL'] = $_SERVER['PHP_SELF']; // . "?" . $_SERVER['QUERY_STRING'] $content['CURRENTURL'] = $_SERVER['PHP_SELF']; // . "?" . $_SERVER['QUERY_STRING']
// Init additional_url helper variable // Init additional_url helper variable
$content['additional_url'] = ""; $content['additional_url'] = "";
$content['additional_url_uidonly'] = ""; $content['additional_url_uidonly'] = "";
$content['additional_url_sortingonly'] = ""; $content['additional_url_sortingonly'] = "";
$content['additional_url_sourceonly'] = "";
// Hidden Vars Counter
$hvCounter = 0;
// Append SourceID into everything!
if ( (isset($CFG['DefaultSourceID']) && isset($content['Sources'][ $CFG['DefaultSourceID'] ])) && isset($_SESSION['currentSourceID']) )
{
// If the DefaultSourceID differes from the SourceID in our Session, we will append the sourceid within all URL's!
if ( $CFG['DefaultSourceID'] != $_SESSION['currentSourceID'] )
{
// $content['additional_url'] .= "&sourceid=" . $_SESSION['currentSourceID'];
$content['additional_url_uidonly'] = "&sourceid=" . $_SESSION['currentSourceID'];
$content['additional_url_sortingonly'] = "&sourceid=" . $_SESSION['currentSourceID'];
$content['additional_url_sourceonly'] = "&sourceid=" . $_SESSION['currentSourceID'];
// For forms!
$content['HIDDENVARS_SOURCE'][$hvCounter]['varname'] = "sourceid";
$content['HIDDENVARS_SOURCE'][$hvCounter]['varvalue'] = $_SESSION['currentSourceID'];
$hvCounter++;
}
}
// Now the query string: // Now the query string:
if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0 ) if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0 )
@ -82,18 +105,21 @@ function CreateCurrentUrl()
$content['CURRENTURL'] .= "?"; $content['CURRENTURL'] .= "?";
$queries = explode ("&", $_SERVER['QUERY_STRING']); $queries = explode ("&", $_SERVER['QUERY_STRING']);
$counter = 0;
for ( $i = 0; $i < count($queries); $i++ ) for ( $i = 0; $i < count($queries); $i++ )
{ {
// Some properties need to be filtered out. // Some properties need to be filtered out.
if ( strpos($queries[$i], "direction") === false ) if (
strpos($queries[$i], "direction") === false
&&
strpos($queries[$i], "skipone") === false
)
{ {
$tmpvars = explode ("=", $queries[$i]); $tmpvars = explode ("=", $queries[$i]);
if ( isset($tmpvars[1]) ) // Only if value param is set! if ( isset($tmpvars[1]) ) // Only if value param is set!
{ {
// For forms! // For forms!
$content['HIDDENVARS'][$counter]['varname'] = $tmpvars[0]; $content['HIDDENVARS'][$hvCounter]['varname'] = $tmpvars[0];
$content['HIDDENVARS'][$counter]['varvalue'] = $tmpvars[1]; $content['HIDDENVARS'][$hvCounter]['varvalue'] = $tmpvars[1];
if ( strlen($tmpvars[1]) > 0 ) if ( strlen($tmpvars[1]) > 0 )
{ {
@ -110,11 +136,16 @@ function CreateCurrentUrl()
if ( strlen($content['additional_url_sortingonly']) <= 0 ) if ( strlen($content['additional_url_sortingonly']) <= 0 )
$content['additional_url_sortingonly'] .= "&" . $tmpvars[0] . "=" . $tmpvars[1]; $content['additional_url_sortingonly'] .= "&" . $tmpvars[0] . "=" . $tmpvars[1];
} }
else if ( $tmpvars[0] == "sourceid" )
{
// Skip this entry
continue;
}
else else
$content['additional_url'] .= "&" . $tmpvars[0] . "=" . $tmpvars[1]; $content['additional_url'] .= "&" . $tmpvars[0] . "=" . $tmpvars[1];
} }
$counter++; $hvCounter++;
} }
} }
} }

View File

@ -63,6 +63,30 @@ if ( isset($_GET['uid']) )
else else
$content['uid_current'] = UID_UNKNOWN; $content['uid_current'] = UID_UNKNOWN;
// --- Set Autoreload as meta refresh
if ( $content['uid_current'] == UID_UNKNOWN )
{
$content['ViewEnableAutoReloadSeconds_visible'] = true;
if ( $content['ViewEnableAutoReloadSeconds'] > 0 )
$content['EXTRA_METATAGS'] = '<META HTTP-EQUIV=REFRESH CONTENT=' . $content['ViewEnableAutoReloadSeconds'] . '>' . "\r\n";
}
else
$content['ViewEnableAutoReloadSeconds_visible'] = false;
// Read direction parameter
if ( isset($_GET['direction']) && $_GET['direction'] == "desc" )
$content['read_direction'] = EnumReadDirection::Forward;
else
$content['read_direction'] = EnumReadDirection::Backward;
// If direction is DESC, should we SKIP one?
if ( isset($_GET['skipone']) && $_GET['skipone'] == "true" )
$content['skipone'] = true;
else
$content['skipone'] = false;
// ---
// Init Pager variables // Init Pager variables
// $content['uid_previous'] = UID_UNKNOWN; // $content['uid_previous'] = UID_UNKNOWN;
$content['uid_next'] = UID_UNKNOWN; $content['uid_next'] = UID_UNKNOWN;
@ -74,24 +98,12 @@ $content['main_pager_previous_found'] = false;
$content['main_pager_next_found'] = false; $content['main_pager_next_found'] = false;
$content['main_pager_last_found'] = false; $content['main_pager_last_found'] = false;
if ( isset($_GET['direction']) && $_GET['direction'] == "desc" )
$content['read_direction'] = EnumReadDirection::Forward;
else
$content['read_direction'] = EnumReadDirection::Backward;
// Init Sorting variables // Init Sorting variables
$content['sorting'] = ""; $content['sorting'] = "";
$content['searchstr'] = ""; $content['searchstr'] = "";
$content['highlightstr'] = ""; $content['highlightstr'] = "";
$content['EXPAND_HIGHLIGHT'] = "false"; $content['EXPAND_HIGHLIGHT'] = "false";
//if ( isset($content['myserver']) )
// $content['TITLE'] = "phpLogCon :: Home :: Server '" . $content['myserver']['Name'] . "'"; // Title of the Page
//else
$content['TITLE'] = "phpLogCon :: Home";
// --- BEGIN Define Helper functions // --- BEGIN Define Helper functions
function HighLightString($highlightArray, $strmsg) function HighLightString($highlightArray, $strmsg)
{ {
@ -106,6 +118,10 @@ function HighLightString($highlightArray, $strmsg)
return $strmsg; return $strmsg;
} }
function PrepareStringForSearch($myString)
{
return str_replace(" ", "+", $myString);
}
// --- // ---
// --- Read and process filters from search dialog! // --- Read and process filters from search dialog!
@ -171,6 +187,16 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) || (isset($_POST['filte
} }
// --- // ---
// --- BEGIN CREATE TITLE
$content['TITLE'] = InitPageTitle();
// Append custom title part!
if ( isset($content['searchstr']) && strlen($content['searchstr']) > 0 )
$content['TITLE'] .= " :: Results for the search '" . $content['searchstr'] . "'"; // Append search
else
$content['TITLE'] .= " :: All Syslogmessages";
// --- END CREATE TITLE
// --- BEGIN Custom Code // --- BEGIN Custom Code
if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$currentSourceID]['SourceType'] == SOURCE_DISK ) if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$currentSourceID]['SourceType'] == SOURCE_DISK )
{ {
@ -180,6 +206,9 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// Create LogStream Object // Create LogStream Object
$stream = $stream_config->LogStreamFactory($stream_config); $stream = $stream_config->LogStreamFactory($stream_config);
$stream->SetFilter($content['searchstr']); $stream->SetFilter($content['searchstr']);
// Copy current used columns here!
$content['Columns'] = $content['Views'][$currentViewID]['Columns'];
// --- Init the fields we need // --- Init the fields we need
foreach($content['Columns'] as $mycolkey) foreach($content['Columns'] as $mycolkey)
@ -191,6 +220,11 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
$content['fields'][$mycolkey]['FieldType'] = $fields[$mycolkey]['FieldType']; $content['fields'][$mycolkey]['FieldType'] = $fields[$mycolkey]['FieldType'];
$content['fields'][$mycolkey]['FieldSortable'] = $stream->IsPropertySortable($mycolkey); // $fields[$mycolkey]['Sortable']; $content['fields'][$mycolkey]['FieldSortable'] = $stream->IsPropertySortable($mycolkey); // $fields[$mycolkey]['Sortable'];
$content['fields'][$mycolkey]['DefaultWidth'] = $fields[$mycolkey]['DefaultWidth']; $content['fields'][$mycolkey]['DefaultWidth'] = $fields[$mycolkey]['DefaultWidth'];
if ( $mycolkey == SYSLOG_MESSAGE )
$content['fields'][$mycolkey]['colspan'] = ''; //' colspan="2" ';
else
$content['fields'][$mycolkey]['colspan'] = '';
} }
} }
// --- // ---
@ -199,13 +233,16 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
if ( $res == SUCCESS ) if ( $res == SUCCESS )
{ {
// TODO Implement ORDER // TODO Implement ORDER
$stream->SetReadDirection($content['read_direction']); $stream->SetReadDirection($content['read_direction']);
// Read First and LAST UID's before start reading the stream!
$content['uid_last'] = $stream->GetLastPageUID();
$content['uid_first'] = $stream->GetFirstPageUID();
// Set current ID and init Counter // Set current ID and init Counter
$uID = $content['uid_current']; $uID = $content['uid_current'];
$counter = 0; $counter = 0;
// If uID is known, we need to init READ first - this will also seek for available records first! // If uID is known, we need to init READ first - this will also seek for available records first!
if ($uID != UID_UNKNOWN) if ($uID != UID_UNKNOWN)
{ {
@ -214,15 +251,28 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
} }
else else
$ret = $stream->ReadNext($uID, $logArray); $ret = $stream->ReadNext($uID, $logArray);
// --- If Forward direction is used, we need to SKIP one entry!
if ( $ret == SUCCESS && $content['read_direction'] == EnumReadDirection::Forward )
{
// Ok the current ID is our NEXT ID in this reading direction, so we save it!
$content['uid_next'] = $uID;
// Skip this entry and move to the next // --- Check if Read was successfull!
$stream->ReadNext($uID, $logArray); if ( $ret == SUCCESS )
{
// If Forward direction is used, we need to SKIP one entry!
if ( $content['read_direction'] == EnumReadDirection::Forward )
{
// Ok the current ID is our NEXT ID in this reading direction, so we save it!
$content['uid_next'] = $uID;
if ( $content['skipone'] )
{
// Skip this entry and move to the next
$stream->ReadNext($uID, $logArray);
}
}
}
else
{
// This will disable to Main SyslogView and show an error message
$content['syslogmessagesenabled'] = "false";
$content['detailederror'] = "No syslog messages found.";
} }
// --- // ---
@ -265,10 +315,14 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
if ( isset($fields[$mycolkey]) && isset($logArray[$mycolkey]) ) if ( isset($fields[$mycolkey]) && isset($logArray[$mycolkey]) )
{ {
// Set defaults // Set defaults
$content['syslogmessages'][$counter]['values'][$mycolkey]['FieldColumn'] = $mycolkey;
$content['syslogmessages'][$counter]['values'][$mycolkey]['uid'] = $uID;
$content['syslogmessages'][$counter]['values'][$mycolkey]['FieldAlign'] = $fields[$mycolkey]['FieldAlign']; $content['syslogmessages'][$counter]['values'][$mycolkey]['FieldAlign'] = $fields[$mycolkey]['FieldAlign'];
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldcssclass'] = $content['syslogmessages'][$counter]['cssclass']; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldcssclass'] = $content['syslogmessages'][$counter]['cssclass'];
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = ""; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = "";
$content['syslogmessages'][$counter]['values'][$mycolkey]['isnowrap'] = "nowrap";
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasdetails'] = "false"; $content['syslogmessages'][$counter]['values'][$mycolkey]['hasdetails'] = "false";
$content['syslogmessages'][$counter]['values'][$mycolkey]['detailimagealign'] = "TOP";
// Set default link // Set default link
$content['syslogmessages'][$counter]['values'][$mycolkey]['detaillink'] = "#"; $content['syslogmessages'][$counter]['values'][$mycolkey]['detaillink'] = "#";
@ -298,6 +352,19 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// Use default colour! // Use default colour!
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $facility_colors[SYSLOG_LOCAL0] . '" '; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $facility_colors[SYSLOG_LOCAL0] . '" ';
} }
// Set OnClick Menu for SYSLOG_FACILITY
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=facility%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . GetFacilityDisplayName( $logArray[$mycolkey] ). "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_FACILITY . '&q=' . GetFacilityDisplayName($logArray[$mycolkey]),
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_FACILITY'] . " '" . GetFacilityDisplayName($logArray[$mycolkey]) . "'",
'IconSource' => $content['MENU_NETWORK']
);
} }
else if ( $mycolkey == SYSLOG_SEVERITY ) else if ( $mycolkey == SYSLOG_SEVERITY )
{ {
@ -314,6 +381,19 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// Use default colour! // Use default colour!
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $severity_colors[SYSLOG_INFO] . '" '; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $severity_colors[SYSLOG_INFO] . '" ';
} }
// Set OnClick Menu for SYSLOG_SEVERITY
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=severity%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . GetSeverityDisplayName( $logArray[$mycolkey] ). "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_SEVERITY . '&q=' . GetSeverityDisplayName($logArray[$mycolkey]),
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_SEVERITY'] . " '" . GetSeverityDisplayName($logArray[$mycolkey]) . "'",
'IconSource' => $content['MENU_NETWORK']
);
} }
else if ( $mycolkey == SYSLOG_MESSAGETYPE ) else if ( $mycolkey == SYSLOG_MESSAGETYPE )
{ {
@ -330,7 +410,30 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// Use default colour! // Use default colour!
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $msgtype_colors[IUT_Unknown] . '" '; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $msgtype_colors[IUT_Unknown] . '" ';
} }
// Set OnClick Menu for SYSLOG_MESSAGETYPE
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=messagetype%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . GetMessageTypeDisplayName( $logArray[$mycolkey] ). "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
}
/* Eventlog based fields */
else if ( $mycolkey == SYSLOG_EVENT_ID )
{
// Set OnClick Menu for SYSLOG_EVENT_ID
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=eventid%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_EVENT_ID . '&q=' . $logArray[$mycolkey],
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_EVENTID'] . " '" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_NETWORK']
);
} }
} }
else if ( $content['fields'][$mycolkey]['FieldType'] == FILTER_TYPE_STRING ) else if ( $content['fields'][$mycolkey]['FieldType'] == FILTER_TYPE_STRING )
@ -341,13 +444,16 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// Special Handling for the Syslog Message! // Special Handling for the Syslog Message!
if ( $mycolkey == SYSLOG_MESSAGE ) if ( $mycolkey == SYSLOG_MESSAGE )
{ {
// No NOWRAP for Syslog Message!
$content['syslogmessages'][$counter]['values'][$mycolkey]['isnowrap'] = "";
// Set truncasted message for display // Set truncasted message for display
if ( isset($logArray[SYSLOG_MESSAGE]) ) if ( isset($logArray[SYSLOG_MESSAGE]) )
{ {
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = GetStringWithHTMLCodes(strlen($logArray[SYSLOG_MESSAGE]) > $CFG['ViewMessageCharacterLimit'] ? substr($logArray[SYSLOG_MESSAGE], 0, $CFG['ViewMessageCharacterLimit'] ) . " ..." : $logArray[SYSLOG_MESSAGE]); $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = GetStringWithHTMLCodes(strlen($logArray[SYSLOG_MESSAGE]) > $CFG['ViewMessageCharacterLimit'] ? substr($logArray[SYSLOG_MESSAGE], 0, $CFG['ViewMessageCharacterLimit'] ) . " ..." : $logArray[SYSLOG_MESSAGE]);
// Enable LINK property! for this field // Enable LINK property! for this field
$content['syslogmessages'][$counter]['values'][$mycolkey]['haslink'] = true; $content['syslogmessages'][$counter]['values'][$mycolkey]['ismessagefield'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['detaillink'] = "details.php?uid=" . $uID; $content['syslogmessages'][$counter]['values'][$mycolkey]['detaillink'] = "details.php?uid=" . $uID;
} }
else else
@ -359,11 +465,16 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
if ( isset($content['highlightwords']) ) if ( isset($content['highlightwords']) )
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = HighLightString( $content['highlightwords'], $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] ); $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = HighLightString( $content['highlightwords'], $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] );
// --- HOOK here to add context links!
AddContextLinks($content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue']);
// ---
if ( isset($CFG['ViewEnableDetailPopups']) && $CFG['ViewEnableDetailPopups'] == 1 ) if ( isset($CFG['ViewEnableDetailPopups']) && $CFG['ViewEnableDetailPopups'] == 1 )
{ {
$content['syslogmessages'][$counter]['values'][$mycolkey]['popupcaption'] = GetAndReplaceLangStr( $content['LN_GRID_POPUPDETAILS'], $logArray[SYSLOG_UID]); $content['syslogmessages'][$counter]['values'][$mycolkey]['popupcaption'] = GetAndReplaceLangStr( $content['LN_GRID_POPUPDETAILS'], $logArray[SYSLOG_UID]);
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasdetails'] = "true"; $content['syslogmessages'][$counter]['values'][$mycolkey]['hasdetails'] = "true";
$content['syslogmessages'][$counter]['values'][$mycolkey]['detailimagealign'] = "left"; // Other alignment needed!
foreach($content['syslogmessages'][$counter]['values'] as $mykey => $myfield) foreach($content['syslogmessages'][$counter]['values'] as $mykey => $myfield)
{ {
// Set Caption! // Set Caption!
@ -386,11 +497,83 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
$content['syslogmessages'][$counter]['values'][$mycolkey]['messagesdetails'][$myIndex]['detailfieldvalue'] = HighLightString( $content['highlightwords'],GetStringWithHTMLCodes($logArray[SYSLOG_MESSAGE]) ); $content['syslogmessages'][$counter]['values'][$mycolkey]['messagesdetails'][$myIndex]['detailfieldvalue'] = HighLightString( $content['highlightwords'],GetStringWithHTMLCodes($logArray[SYSLOG_MESSAGE]) );
else else
$content['syslogmessages'][$counter]['values'][$mycolkey]['messagesdetails'][$myIndex]['detailfieldvalue'] = GetStringWithHTMLCodes($logArray[SYSLOG_MESSAGE]); $content['syslogmessages'][$counter]['values'][$mycolkey]['messagesdetails'][$myIndex]['detailfieldvalue'] = GetStringWithHTMLCodes($logArray[SYSLOG_MESSAGE]);
// --- HOOK here to add context links!
AddContextLinks( $content['syslogmessages'][$counter]['values'][$mycolkey]['messagesdetails'][$myIndex]['detailfieldvalue'] );
// ---
} }
else // Just set field value else // Just set field value
$content['syslogmessages'][$counter]['values'][$mycolkey]['messagesdetails'][$myIndex]['detailfieldvalue'] = $myfield['fieldvalue']; $content['syslogmessages'][$counter]['values'][$mycolkey]['messagesdetails'][$myIndex]['detailfieldvalue'] = $myfield['fieldvalue'];
} }
} }
if ( strlen($content['searchstr']) > 0 )
{
// Set OnClick Menu for SYSLOG_MESSAGE
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasdropdownbutton'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?uid=' . $uID,
'DisplayName' => $content['LN_VIEW_MESSAGECENTERED'],
'IconSource' => $content['MENU_BULLET_GREEN']
);
}
}
else if ( $mycolkey == SYSLOG_SYSLOGTAG )
{
// Set OnClick Menu for SYSLOG_SYSLOGTAG
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=syslogtag%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_SYSLOGTAG . '&q=' . $logArray[$mycolkey],
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_SYSLOGTAG'] . " '" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_NETWORK']
);
}
else if ( $mycolkey == SYSLOG_HOST )
{
// Set OnClick Menu for SYSLOG_HOST
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=source%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
}
/* Eventlog based fields */
else if ( $mycolkey == SYSLOG_EVENT_LOGTYPE )
{
// Set OnClick Menu for SYSLOG_EVENT_LOGTYPE
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=eventlogtype%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_EVENT_LOGTYPE . '&q=' . $logArray[$mycolkey],
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_EVENTLOGTYPE'] . " '" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_NETWORK']
);
}
else if ( $mycolkey == SYSLOG_EVENT_SOURCE )
{
// Set OnClick Menu for SYSLOG_EVENT_SOURCE
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=eventlogsource%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_EVENT_SOURCE . '&q=' . $logArray[$mycolkey],
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_EVENTSOURCE'] . " '" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_NETWORK']
);
} }
} }
} }
@ -399,15 +582,18 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// Increment Counter // Increment Counter
$counter++; $counter++;
} while ($counter < $CFG['ViewEntriesPerPage'] && ($ret = $stream->ReadNext($uID, $logArray)) == SUCCESS); } while ($counter < $content['ViewEntriesPerPage'] && ($ret = $stream->ReadNext($uID, $logArray)) == SUCCESS);
//print_r ( $content['syslogmessages'] ); //print_r ( $content['syslogmessages'] );
if ( $content['main_recordcount'] == -1 || $content['main_recordcount'] > $CFG['ViewEntriesPerPage'] ) if ( $content['main_recordcount'] == -1 || $content['main_recordcount'] > $content['ViewEntriesPerPage'] )
{ {
// Enable Pager in any case here! // Enable Pager in any case here!
$content['main_pagerenabled'] = true; $content['main_pagerenabled'] = true;
// temporary store the current last $uID
$lastUid = $uID;
// --- Handle uid_next page button // --- Handle uid_next page button
if ( $content['read_direction'] == EnumReadDirection::Backward ) if ( $content['read_direction'] == EnumReadDirection::Backward )
{ {
@ -419,16 +605,8 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
else if ( $content['uid_current'] != UID_UNKNOWN ) else if ( $content['uid_current'] != UID_UNKNOWN )
$content['main_pager_next_found'] = false; $content['main_pager_next_found'] = false;
} }
else if ( $content['read_direction'] == EnumReadDirection::Forward )
{
// User clicked back, so there is a next page for sure
$content['main_pager_next_found'] = true;
// As we went back, we need to change the currend uid to the latest read one
$content['uid_current'] = $uID;
}
// --- // ---
// --- Handle uid_previous page button // --- Handle uid_previous page button
if ( $content['uid_current'] != UID_UNKNOWN ) if ( $content['uid_current'] != UID_UNKNOWN )
{ {
@ -455,20 +633,37 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// --- // ---
// --- Handle uid_last page button // --- Handle uid_last page button
// Option the last UID from the stream! //!!!!!!!!
$content['uid_last'] = $stream->GetLastPageUID();
// if we found a last uid, and if it is not the current one (which means we already are on the last page ;)! // if we found a last uid, and if it is not the current one (which means we already are on the last page ;)!
if ( $content['uid_last'] != -1 && $content['uid_last'] != $content['uid_current']) if ( $content['uid_last'] != -1 && $content['uid_last'] != $content['uid_current'])
$content['main_pager_last_found'] = true; $content['main_pager_last_found'] = true;
else else
$content['main_pager_last_found'] = false; $content['main_pager_last_found'] = false;
//echo $content['uid_last']; //echo $content['uid_last'];
// Handle next button only if Forward is used now!
if ( $content['read_direction'] == EnumReadDirection::Forward )
{
if ( $content['uid_current'] == $content['uid_last'] )
// Last page already !
$content['main_pager_next_found'] = false;
else
// User clicked back, so there is a next page for sure
$content['main_pager_next_found'] = true;
// As we went back, we need to change the currend uid to the latest read one
$content['uid_current'] = $lastUid;
}
// --- // ---
// --- Handle uid_first page button // --- Handle uid_first page button
if ( $content['uid_current'] == $content['uid_first'] ) if ( $content['main_pager_previous_found'] == false ||
$content['uid_current'] == UID_UNKNOWN ||
$content['uid_current'] == $content['uid_first'] )
{
$content['main_pager_first_found'] = false; $content['main_pager_first_found'] = false;
$content['main_pager_previous_found'] = false; // If there is no FIRST, there is no going back!
}
else else
$content['main_pager_first_found'] = true; $content['main_pager_first_found'] = true;
// --- // ---
@ -484,7 +679,6 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
// print_r( $content['syslogmessages'] ); // print_r( $content['syslogmessages'] );
} }
// This will enable to Main SyslogView // This will enable to Main SyslogView
$content['syslogmessagesenabled'] = "true"; $content['syslogmessagesenabled'] = "true";
} }
@ -499,8 +693,7 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
else if ( $res == ERROR_FILE_NOT_READABLE ) else if ( $res == ERROR_FILE_NOT_READABLE )
$content['detailederror'] = "Syslog file is not readable, read access may be denied. "; $content['detailederror'] = "Syslog file is not readable, read access may be denied. ";
else else
$content['detailederror'] = "Unknown or unhandled error occured."; $content['detailederror'] = "Unknown or unhandled error occured (Error Code " . $res . ") ";
} }
// Close file! // Close file!

View File

@ -228,6 +228,17 @@ else if ( $content['INSTALL_STEP'] == 3 )
$content['ViewEnableDetailPopups_true'] = ""; $content['ViewEnableDetailPopups_true'] = "";
$content['ViewEnableDetailPopups_false'] = "checked"; $content['ViewEnableDetailPopups_false'] = "checked";
} }
if ( isset($_SESSION['EnableIPAddressResolve']) ) { $content['EnableIPAddressResolve'] = $_SESSION['EnableIPAddressResolve']; } else { $content['EnableIPAddressResolve'] = 1; }
if ( $content['EnableIPAddressResolve'] == 1 )
{
$content['EnableIPAddressResolve_true'] = "checked";
$content['EnableIPAddressResolve_false'] = "";
}
else
{
$content['EnableIPAddressResolve_true'] = "";
$content['EnableIPAddressResolve_false'] = "checked";
}
// --- // ---
// Disable the bottom next button, as the Form in this step has its own button! // Disable the bottom next button, as the Form in this step has its own button!
@ -315,6 +326,12 @@ else if ( $content['INSTALL_STEP'] == 4 )
$_SESSION['ViewEnableDetailPopups'] = intval( DB_RemoveBadChars($_POST['ViewEnableDetailPopups']) ); $_SESSION['ViewEnableDetailPopups'] = intval( DB_RemoveBadChars($_POST['ViewEnableDetailPopups']) );
else else
$_SESSION['ViewEnableDetailPopups'] = 1; // Fallback default! $_SESSION['ViewEnableDetailPopups'] = 1; // Fallback default!
if ( isset($_POST['EnableIPAddressResolve']) )
$_SESSION['EnableIPAddressResolve'] = intval( DB_RemoveBadChars($_POST['EnableIPAddressResolve']) );
else
$_SESSION['EnableIPAddressResolve'] = 1; // Fallback default!
// --- // ---
// If UserDB is disabled, skip next step! // If UserDB is disabled, skip next step!
@ -347,7 +364,7 @@ else if ( $content['INSTALL_STEP'] == 5 )
$totaldbdefs = str_replace( "`logcon_", "`" . $_SESSION["UserDBPref"], $totaldbdefs ); $totaldbdefs = str_replace( "`logcon_", "`" . $_SESSION["UserDBPref"], $totaldbdefs );
// Now split by sql command // Now split by sql command
$mycommands = split( ";\r\n", $totaldbdefs ); $mycommands = split( ";\n", $totaldbdefs );
// check for different linefeed // check for different linefeed
if ( count($mycommands) <= 1 ) if ( count($mycommands) <= 1 )
@ -463,6 +480,17 @@ else if ( $content['INSTALL_STEP'] == 7 )
if ( isset($_SESSION['SourceType']) ) { $content['SourceType'] = $_SESSION['SourceType']; } else { $content['SourceType'] = SOURCE_DISK; } if ( isset($_SESSION['SourceType']) ) { $content['SourceType'] = $_SESSION['SourceType']; } else { $content['SourceType'] = SOURCE_DISK; }
CreateSourceTypesList($content['SourceType']); CreateSourceTypesList($content['SourceType']);
if ( isset($_SESSION['SourceName']) ) { $content['SourceName'] = $_SESSION['SourceName']; } else { $content['SourceName'] = "My Syslog Source"; } if ( isset($_SESSION['SourceName']) ) { $content['SourceName'] = $_SESSION['SourceName']; } else { $content['SourceName'] = "My Syslog Source"; }
// Init default View
if ( isset($_SESSION['SourceViewID']) ) { $content['SourceViewID'] = $_SESSION['SourceViewID']; } else { $content['SourceViewID'] = 'SYSLOG'; }
foreach ( $content['Views'] as $myView )
{
if ( $myView['ID'] == $content['SourceViewID'] )
$content['Views'][ $myView['ID'] ]['selected'] = "selected";
else
$content['Views'][ $myView['ID'] ]['selected'] = "";
}
// SOURCE_DISK specific // SOURCE_DISK specific
if ( isset($_SESSION['SourceLogLineType']) ) { $content['SourceLogLineType'] = $_SESSION['SourceLogLineType']; } else { $content['SourceLogLineType'] = ""; } if ( isset($_SESSION['SourceLogLineType']) ) { $content['SourceLogLineType'] = $_SESSION['SourceLogLineType']; } else { $content['SourceLogLineType'] = ""; }
@ -478,6 +506,17 @@ else if ( $content['INSTALL_STEP'] == 7 )
if ( isset($_SESSION['SourceDBTableName']) ) { $content['SourceDBTableName'] = $_SESSION['SourceDBTableName']; } else { $content['SourceDBTableName'] = "systemevents"; } if ( isset($_SESSION['SourceDBTableName']) ) { $content['SourceDBTableName'] = $_SESSION['SourceDBTableName']; } else { $content['SourceDBTableName'] = "systemevents"; }
if ( isset($_SESSION['SourceDBUser']) ) { $content['SourceDBUser'] = $_SESSION['SourceDBUser']; } else { $content['SourceDBUser'] = "user"; } if ( isset($_SESSION['SourceDBUser']) ) { $content['SourceDBUser'] = $_SESSION['SourceDBUser']; } else { $content['SourceDBUser'] = "user"; }
if ( isset($_SESSION['SourceDBPassword']) ) { $content['SourceDBPassword'] = $_SESSION['SourceDBPassword']; } else { $content['SourceDBPassword'] = ""; } if ( isset($_SESSION['SourceDBPassword']) ) { $content['SourceDBPassword'] = $_SESSION['SourceDBPassword']; } else { $content['SourceDBPassword'] = ""; }
if ( isset($_SESSION['SourceDBEnableRowCounting']) ) { $content['SourceDBEnableRowCounting'] = $_SESSION['SourceDBEnableRowCounting']; } else { $content['SourceDBEnableRowCounting'] = "false"; }
if ( $content['SourceDBEnableRowCounting'] == "true" )
{
$content['SourceDBEnableRowCounting_true'] = "checked";
$content['SourceDBEnableRowCounting_false'] = "";
}
else
{
$content['SourceDBEnableRowCounting_true'] = "";
$content['SourceDBEnableRowCounting_false'] = "checked";
}
// Check for Error Msg // Check for Error Msg
if ( isset($_GET['errormsg']) ) if ( isset($_GET['errormsg']) )
@ -499,6 +538,12 @@ else if ( $content['INSTALL_STEP'] == 8 )
else else
RevertOneStep( $content['INSTALL_STEP']-1, $content['LN_CFG_PARAMMISSING'] . $content['LN_CFG_NAMEOFTHESOURCE'] ); RevertOneStep( $content['INSTALL_STEP']-1, $content['LN_CFG_PARAMMISSING'] . $content['LN_CFG_NAMEOFTHESOURCE'] );
if ( isset($_POST['SourceViewID']) )
$_SESSION['SourceViewID'] = DB_RemoveBadChars($_POST['SourceViewID']);
else
RevertOneStep( $content['INSTALL_STEP']-1, $content['LN_CFG_PARAMMISSING'] . $content['LN_CFG_VIEW'] );
// Check DISK Parameters! // Check DISK Parameters!
if ( $_SESSION['SourceType'] == SOURCE_DISK) if ( $_SESSION['SourceType'] == SOURCE_DISK)
{ {
@ -516,7 +561,7 @@ else if ( $content['INSTALL_STEP'] == 8 )
if ( !is_file($_SESSION['SourceDiskFile']) ) if ( !is_file($_SESSION['SourceDiskFile']) )
RevertOneStep( $content['INSTALL_STEP']-1, "Failed to open the syslog file " .$_SESSION['SourceDiskFile'] . "! Check if the file exists and phplogcon has sufficient rights to it<br>" ); RevertOneStep( $content['INSTALL_STEP']-1, "Failed to open the syslog file " .$_SESSION['SourceDiskFile'] . "! Check if the file exists and phplogcon has sufficient rights to it<br>" );
} }
else if ( $_SESSION['SourceType'] == SOURCE_DB) else if ( $_SESSION['SourceType'] == SOURCE_DB || $_SESSION['SourceType'] == SOURCE_PDO )
{ {
if ( isset($_POST['SourceDBType']) ) if ( isset($_POST['SourceDBType']) )
$_SESSION['SourceDBType'] = DB_RemoveBadChars($_POST['SourceDBType']); $_SESSION['SourceDBType'] = DB_RemoveBadChars($_POST['SourceDBType']);
@ -552,7 +597,14 @@ else if ( $content['INSTALL_STEP'] == 8 )
$_SESSION['SourceDBPassword'] = DB_RemoveBadChars($_POST['SourceDBPassword']); $_SESSION['SourceDBPassword'] = DB_RemoveBadChars($_POST['SourceDBPassword']);
else else
$_SESSION['SourceDBPassword'] = ""; $_SESSION['SourceDBPassword'] = "";
if ( isset($_POST['SourceDBEnableRowCounting']) )
{
$_SESSION['SourceDBEnableRowCounting'] = DB_RemoveBadChars($_POST['SourceDBEnableRowCounting']);
if ( $_SESSION['SourceDBEnableRowCounting'] != "true" )
$_SESSION['SourceDBEnableRowCounting'] = "false";
}
// TODO: Check database connectivity! // TODO: Check database connectivity!
} }
@ -563,10 +615,12 @@ else if ( $content['INSTALL_STEP'] == 8 )
$patterns[] = "/\\\$CFG\['ViewMessageCharacterLimit'\] = [0-9]{1,2};/"; $patterns[] = "/\\\$CFG\['ViewMessageCharacterLimit'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['ViewEntriesPerPage'\] = [0-9]{1,2};/"; $patterns[] = "/\\\$CFG\['ViewEntriesPerPage'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['ViewEnableDetailPopups'\] = [0-9]{1,2};/"; $patterns[] = "/\\\$CFG\['ViewEnableDetailPopups'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['EnableIPAddressResolve'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['UserDBEnabled'\] = [0-9]{1,2};/"; $patterns[] = "/\\\$CFG\['UserDBEnabled'\] = [0-9]{1,2};/";
$replacements[] = "\$CFG['ViewMessageCharacterLimit'] = " . $_SESSION['ViewMessageCharacterLimit'] . ";"; $replacements[] = "\$CFG['ViewMessageCharacterLimit'] = " . $_SESSION['ViewMessageCharacterLimit'] . ";";
$replacements[] = "\$CFG['ViewEntriesPerPage'] = " . $_SESSION['ViewEntriesPerPage'] . ";"; $replacements[] = "\$CFG['ViewEntriesPerPage'] = " . $_SESSION['ViewEntriesPerPage'] . ";";
$replacements[] = "\$CFG['ViewEnableDetailPopups'] = " . $_SESSION['ViewEnableDetailPopups'] . ";"; $replacements[] = "\$CFG['ViewEnableDetailPopups'] = " . $_SESSION['ViewEnableDetailPopups'] . ";";
$replacements[] = "\$CFG['EnableIPAddressResolve'] = " . $_SESSION['EnableIPAddressResolve'] . ";";
$replacements[] = "\$CFG['UserDBEnabled'] = " . $_SESSION['UserDBEnabled'] . ";"; $replacements[] = "\$CFG['UserDBEnabled'] = " . $_SESSION['UserDBEnabled'] . ";";
//User Database Options //User Database Options
@ -576,24 +630,48 @@ else if ( $content['INSTALL_STEP'] == 8 )
} }
//Add the first source! //Add the first source!
$firstsource = "\$CFG['Sources']['Source1']['ID'] = 'Source1';\r\n" . $firstsource = "\$CFG['DefaultSourceID'] = 'Source1';\n\n" .
"\$CFG['Sources']['Source1']['Name'] = '" . $_SESSION['SourceName'] . "';\r\n" . "\$CFG['Sources']['Source1']['ID'] = 'Source1';\n" .
"\$CFG['Sources']['Source1']['SourceType'] = " . $_SESSION['SourceType'] . ";\r\n"; "\$CFG['Sources']['Source1']['Name'] = '" . $_SESSION['SourceName'] . "';\n" .
"\$CFG['Sources']['Source1']['ViewID'] = '" . $_SESSION['SourceViewID'] . "';\n";
if ( $_SESSION['SourceType'] == SOURCE_DISK ) if ( $_SESSION['SourceType'] == SOURCE_DISK )
{ {
$firstsource .= "\$CFG['Sources']['Source1']['LogLineType'] = '" . $_SESSION['SourceLogLineType'] . "';\r\n" . $firstsource .= "\$CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK;\n" .
"\$CFG['Sources']['Source1']['DiskFile'] = '" . $_SESSION['SourceDiskFile'] . "';\r\n" . "\$CFG['Sources']['Source1']['LogLineType'] = '" . $_SESSION['SourceLogLineType'] . "';\n" .
"\$CFG['Sources']['Source1']['DiskFile'] = '" . $_SESSION['SourceDiskFile'] . "';\n" .
""; "";
} }
else if ( $_SESSION['SourceType'] == SOURCE_DB ) else if ( $_SESSION['SourceType'] == SOURCE_DB )
{ {
$firstsource .= "\$CFG['Sources']['Source1']['DBTableType'] = '" . $_SESSION['SourceDBTableType'] . "';\r\n" . // Need to create the LIST first!
"\$CFG['Sources']['Source1']['DBType'] = '" . $_SESSION['SourceDBType'] . "';\r\n" . CreateDBTypesList($_SESSION['SourceDBType']);
"\$CFG['Sources']['Source1']['DBServer'] = '" . $_SESSION['SourceDBServer'] . "';\r\n" .
"\$CFG['Sources']['Source1']['DBName'] = '" . $_SESSION['SourceDBName'] . "';\r\n" . $firstsource .= "\$CFG['Sources']['Source1']['SourceType'] = SOURCE_DB;\n" .
"\$CFG['Sources']['Source1']['DBUser'] = '" . $_SESSION['SourceDBUser'] . "';\r\n" . "\$CFG['Sources']['Source1']['DBTableType'] = '" . $_SESSION['SourceDBTableType'] . "';\n" .
"\$CFG['Sources']['Source1']['DBPassword'] = '" . $_SESSION['SourceDBPassword'] . "';\r\n" . "\$CFG['Sources']['Source1']['DBType'] = " . $content['DBTYPES'][$_SESSION['SourceDBType']]['typeastext'] . ";\n" .
"\$CFG['Sources']['Source1']['DBTableName'] = '" . $_SESSION['SourceDBTableName'] . "';\r\n" . "\$CFG['Sources']['Source1']['DBServer'] = '" . $_SESSION['SourceDBServer'] . "';\n" .
"\$CFG['Sources']['Source1']['DBName'] = '" . $_SESSION['SourceDBName'] . "';\n" .
"\$CFG['Sources']['Source1']['DBUser'] = '" . $_SESSION['SourceDBUser'] . "';\n" .
"\$CFG['Sources']['Source1']['DBPassword'] = '" . $_SESSION['SourceDBPassword'] . "';\n" .
"\$CFG['Sources']['Source1']['DBTableName'] = '" . $_SESSION['SourceDBTableName'] . "';\n" .
"\$CFG['Sources']['Source1']['DBEnableRowCounting'] = " . $_SESSION['SourceDBEnableRowCounting'] . ";\n" .
"";
}
else if ( $_SESSION['SourceType'] == SOURCE_PDO )
{
// Need to create the LIST first!
CreateDBTypesList($_SESSION['SourceDBType']);
$firstsource .= "\$CFG['Sources']['Source1']['SourceType'] = SOURCE_PDO;\n" .
"\$CFG['Sources']['Source1']['DBTableType'] = '" . $_SESSION['SourceDBTableType'] . "';\n" .
"\$CFG['Sources']['Source1']['DBType'] = " . $content['DBTYPES'][$_SESSION['SourceDBType']]['typeastext'] . ";\n" .
"\$CFG['Sources']['Source1']['DBServer'] = '" . $_SESSION['SourceDBServer'] . "';\n" .
"\$CFG['Sources']['Source1']['DBName'] = '" . $_SESSION['SourceDBName'] . "';\n" .
"\$CFG['Sources']['Source1']['DBUser'] = '" . $_SESSION['SourceDBUser'] . "';\n" .
"\$CFG['Sources']['Source1']['DBPassword'] = '" . $_SESSION['SourceDBPassword'] . "';\n" .
"\$CFG['Sources']['Source1']['DBTableName'] = '" . $_SESSION['SourceDBTableName'] . "';\n" .
"\$CFG['Sources']['Source1']['DBEnableRowCounting'] = " . $_SESSION['SourceDBEnableRowCounting'] . ";\n" .
""; "";
} }
$patterns[] = "/\/\/ --- \%Insert Source Here\%/"; $patterns[] = "/\/\/ --- \%Insert Source Here\%/";
@ -686,4 +764,4 @@ function ImportDataFile($szFileName)
} }
// --- // ---
?> ?>

View File

@ -67,6 +67,30 @@ function togglevisibility(ElementNameToggle, ElementNameButton)
} }
} }
/*
* Helper function to hide a div area
*/
function showvisibility(ElementNameToggle, ElementNameButton)
{
var toggle = document.getElementById(ElementNameToggle);
// Button is optional
if (ElementNameButton != null)
{
var button = document.getElementById(ElementNameButton);
}
else
var button = null;
if (button != null)
{
button.className = "topmenu2 ExpansionMinus";
}
toggle.style.visibility = "visible";
toggle.style.display = "inline";
}
/* /*
* Helper function to hide a div area * Helper function to hide a div area
*/ */
@ -133,4 +157,142 @@ function toggleFormareaVisibility(FormFieldName, FirstHiddenArea, SecondHiddenAr
hidevisibility(FirstHiddenArea); hidevisibility(FirstHiddenArea);
togglevisibility(SecondHiddenArea); togglevisibility(SecondHiddenArea);
} }
} }
// helper array to keep track of the timeouts!
var runningTimeouts = new Array();
var defaultMenuTimeout = 1500;
/*
* Toggle display type from NONE to BLOCK
*/
function ToggleDisplayTypeById(ObjID)
{
var obj = document.getElementById(ObjID);
if (obj != null)
{
if (obj.style.display == '' || obj.style.display == 'none')
{
obj.style.display='block';
// Set Timeout to make sure the menu disappears
ToggleDisplaySetTimeout(ObjID);
}
else
{
obj.style.display='none';
// Abort Timeout if set!
ToggleDisplayClearTimeout(ObjID);
}
}
}
function ToggleDisplaySetTimeout(ObjID)
{
// Set Timeout
var szTimeOut = "ToggleDisplayOffTypeById('" + ObjID + "')";
runningTimeouts[ObjID] = window.setTimeout(szTimeOut, defaultMenuTimeout);
}
function ToggleDisplayClearTimeout(ObjID)
{
// Abort Timeout if set!
if ( runningTimeouts[ObjID] != null )
{
window.clearTimeout(runningTimeouts[ObjID]);
}
}
function ToggleDisplayEnhanceTimeOut(ObjID)
{
// First clear timeout
ToggleDisplayClearTimeout(ObjID);
// Set new timeout
ToggleDisplaySetTimeout(ObjID);
}
/*
* Make Style sheet display OFF in any case
*/
function ToggleDisplayOffTypeById(ObjID)
{
var obj = document.getElementById(ObjID);
if (obj != null)
{
obj.style.display='none';
}
}
/*
* Debug Helper function to read possible properties of an object
*/
function DebugShowElementsById(ObjName)
{
var obj = document.getElementById(ObjName);
for (var key in obj) {
document.write(obj[key]);
}
}
/*
* Detail popup handling functions
*/
var myPopupHovering = false;
function HoveringPopup(event, parentObj)
{
// This will allow the detail window to be relocated
myPopupHovering = true;
}
function FinishHoveringPopup(event, parentObj)
{
// This will avoid moving the detail window when it is open
myPopupHovering = false;
}
function initPopupWindow(parentObj)
{
// Change CSS Class
parentObj.className='syslogdetails_popup';
}
function FinishPopupWindow(parentObj)
{
// Change CSS Class
parentObj.className='syslogdetails';
}
function disableEventPropagation(myEvent)
{
/* This workaround is specially for our beloved Internet Explorer */
if ( window.event)
{
window.event.cancelBubble = true;
}
}
function movePopupWindow(myEvent, ObjName, PopupContentWidth, parentObj)
{
var obj = document.getElementById(ObjName);
var middle = PopupContentWidth / 2;
// alert ( parentObj.className ) ;
if (myPopupHovering == false)
{
obj.style.left = (myEvent.clientX - middle) + 'px';
}
}
function GoToPopupTarget(myTarget, parentObj)
{
if (!myPopupHovering)
{
// Change document location
document.location=myTarget;
}
else /* Close Popup */
{
FinishPopupWindow(parentObj);
}
}

View File

@ -43,6 +43,19 @@ $content['LN_GEN_PAGE'] = "Seite";
$content['LN_GEN_PREDEFINEDSEARCHES'] = "Vordefinierte Suchkriterien"; $content['LN_GEN_PREDEFINEDSEARCHES'] = "Vordefinierte Suchkriterien";
$content['LN_GEN_SOURCE_DISK'] = "Datei"; $content['LN_GEN_SOURCE_DISK'] = "Datei";
$content['LN_GEN_SOURCE_DB'] = "Datenbank"; $content['LN_GEN_SOURCE_DB'] = "Datenbank";
$content['LN_GEN_RECORDSPERPAGE'] = "records per page";
$content['LN_GEN_PRECONFIGURED'] = "Preconfigured";
$content['LN_GEN_AVAILABLESEARCHES'] = "Available searches";
$content['LN_GEN_DB_MYSQL'] = "Mysql Server";
$content['LN_GEN_DB_MSSQL'] = "Microsoft SQL Server";
$content['LN_GEN_DB_ODBC'] = "ODBC Database Source";
$content['LN_GEN_DB_PGSQL'] = "PostgreSQL";
$content['LN_GEN_DB_OCI'] = "Oracle Call Interface";
$content['LN_GEN_DB_DB2'] = " IBM DB2";
$content['LN_GEN_DB_FIREBIRD'] = "Firebird/Interbase 6";
$content['LN_GEN_DB_INFORMIX'] = "IBM Informix Dynamic Server";
$content['LN_GEN_DB_SQLITE'] = "SQLite 2";
$content['LN_GEN_SELECTVIEW'] = "Select View";
// Index Site // Index Site
$content['LN_ERROR_INSTALLFILEREMINDER'] = "Warnung! Du hast das Installationsscript 'install.php' noch nicht aus dem phpLogCon Hauptordner entfernt!"; $content['LN_ERROR_INSTALLFILEREMINDER'] = "Warnung! Du hast das Installationsscript 'install.php' noch nicht aus dem phpLogCon Hauptordner entfernt!";
@ -56,11 +69,23 @@ $content['LN_SEARCH_ADVANCED'] = "Erweiterte Suche";
$content['LN_SEARCH'] = "Suche"; $content['LN_SEARCH'] = "Suche";
$content['LN_SEARCH_RESET'] = "Suche zur&uuml;cksetzen"; $content['LN_SEARCH_RESET'] = "Suche zur&uuml;cksetzen";
$content['LN_SEARCH_PERFORMADVANCED'] = "Erweiterte Suche starten"; $content['LN_SEARCH_PERFORMADVANCED'] = "Erweiterte Suche starten";
$content['LN_VIEW_MESSAGECENTERED'] = "Back to unfiltered view with this message at top";
$content['LN_VIEW_RELATEDMSG'] = "View related syslog messages";
$content['LN_VIEW_FILTERFOR'] = "Filter message for ";
$content['LN_VIEW_SEARCHFOR'] = "Search online for ";
$content['LN_VIEW_SEARCHFORGOOGLE'] = "Search Google for ";
$content['LN_GEN_MESSAGEDETAILS'] = "Message Details";
$content['LN_HIGHLIGHT'] = "Hightlight >>"; $content['LN_HIGHLIGHT'] = "Hightlight >>";
$content['LN_HIGHLIGHT_OFF'] = "Hightlight <<"; $content['LN_HIGHLIGHT_OFF'] = "Hightlight <<";
$content['LN_HIGHLIGHT_WORDS'] = "Hightlight-W&ouml;rter durch ein Komma voneinander trennen"; $content['LN_HIGHLIGHT_WORDS'] = "Hightlight-W&ouml;rter durch ein Komma voneinander trennen";
$content['LN_AUTORELOAD'] = "Set auto reload";
$content['LN_AUTORELOAD_DISABLED'] = "Auto reload disabled";
$content['LN_AUTORELOAD_PRECONFIGURED'] = "Preconfigured auto reload ";
$content['LN_AUTORELOAD_SECONDS'] = "seconds";
$content['LN_AUTORELOAD_MINUTES'] = "minutes";
$content['LN_ERROR_NORECORDS'] = "Es wurden keine syslog-Eintr&auml;ge gefunden."; $content['LN_ERROR_NORECORDS'] = "Es wurden keine syslog-Eintr&auml;ge gefunden.";
// Filter Options // Filter Options
@ -84,6 +109,7 @@ $content['LN_FILTER_OTHERS'] = "Andere Filter";
$content['LN_FILTER_MESSAGE'] = "Syslog Meldungen"; $content['LN_FILTER_MESSAGE'] = "Syslog Meldungen";
$content['LN_FILTER_SYSLOGTAG'] = "Syslogtag"; $content['LN_FILTER_SYSLOGTAG'] = "Syslogtag";
$content['LN_FILTER_SOURCE'] = "Quelle (Hostname)"; $content['LN_FILTER_SOURCE'] = "Quelle (Hostname)";
$content['LN_FILTER_MESSAGETYPE'] = "Message Type";
// Field Captions // Field Captions
$content['LN_FIELDS_DATE'] = "Datum"; $content['LN_FIELDS_DATE'] = "Datum";
@ -95,6 +121,11 @@ $content['LN_FIELDS_PROCESSID'] = "Prozess ID";
$content['LN_FIELDS_MESSAGETYPE'] = "Meldungstyp"; $content['LN_FIELDS_MESSAGETYPE'] = "Meldungstyp";
$content['LN_FIELDS_UID'] = "uID"; $content['LN_FIELDS_UID'] = "uID";
$content['LN_FIELDS_MESSAGE'] = "Meldung"; $content['LN_FIELDS_MESSAGE'] = "Meldung";
$content['LN_FIELDS_EVENTID'] = "Event ID";
$content['LN_FIELDS_EVENTLOGTYPE'] = "Eventlogtype";
$content['LN_FIELDS_EVENTSOURCE'] = "Event Source";
$content['LN_FIELDS_EVENTCATEGORY'] = "Event Category";
$content['LN_FIELDS_EVENTUSER'] = "Event User";
// Install Page // Install Page
$content['LN_CFG_DBSERVER'] = "Datenbank Host"; $content['LN_CFG_DBSERVER'] = "Datenbank Host";
@ -114,9 +145,11 @@ $content['LN_CFG_DBSTORAGEENGINE'] = "Datenbank Typ";
$content['LN_CFG_DBTABLENAME'] = "Datenbank Tabellenname"; $content['LN_CFG_DBTABLENAME'] = "Datenbank Tabellenname";
$content['LN_CFG_NAMEOFTHESOURCE'] = "Name der Quelle"; $content['LN_CFG_NAMEOFTHESOURCE'] = "Name der Quelle";
$content['LN_CFG_FIRSTSYSLOGSOURCE'] = "Erste Syslog Quelle"; $content['LN_CFG_FIRSTSYSLOGSOURCE'] = "Erste Syslog Quelle";
$content['LN_CFG_VIEW'] = "Select View";
// Details page // Details page
$content['LN_DETAILS_FORSYSLOGMSG'] = "Details für syslog-Nachrichten mit der ID"; $content['LN_DETAILS_FORSYSLOGMSG'] = "Details für syslog-Nachrichten mit der ID";
$content['LN_DETAILS_DETAILSFORMSG'] = "Details für Nachrichten-ID"; $content['LN_DETAILS_DETAILSFORMSG'] = "Details für Nachrichten-ID";
$content['LN_DETAIL_BACKTOLIST'] = "Back to Listview";
?> ?>

View File

@ -42,7 +42,22 @@ $content['LN_GEN_PAGERSIZE'] = "Records per page";
$content['LN_GEN_PAGE'] = "Page"; $content['LN_GEN_PAGE'] = "Page";
$content['LN_GEN_PREDEFINEDSEARCHES'] = "Predefined Searches"; $content['LN_GEN_PREDEFINEDSEARCHES'] = "Predefined Searches";
$content['LN_GEN_SOURCE_DISK'] = "Diskfile"; $content['LN_GEN_SOURCE_DISK'] = "Diskfile";
$content['LN_GEN_SOURCE_DB'] = "Database"; $content['LN_GEN_SOURCE_DB'] = "MYSQL Native";
$content['LN_GEN_SOURCE_PDO'] = "Database (PDO)";
$content['LN_GEN_RECORDSPERPAGE'] = "records per page";
$content['LN_GEN_PRECONFIGURED'] = "Preconfigured";
$content['LN_GEN_AVAILABLESEARCHES'] = "Available searches";
$content['LN_GEN_DB_MYSQL'] = "Mysql Server";
$content['LN_GEN_DB_MSSQL'] = "Microsoft SQL Server";
$content['LN_GEN_DB_ODBC'] = "ODBC Database Source";
$content['LN_GEN_DB_PGSQL'] = "PostgreSQL";
$content['LN_GEN_DB_OCI'] = "Oracle Call Interface";
$content['LN_GEN_DB_DB2'] = " IBM DB2";
$content['LN_GEN_DB_FIREBIRD'] = "Firebird/Interbase 6";
$content['LN_GEN_DB_INFORMIX'] = "IBM Informix Dynamic Server";
$content['LN_GEN_DB_SQLITE'] = "SQLite 2";
$content['LN_GEN_SELECTVIEW'] = "Select View";
// Main Index Site // Main Index Site
$content['LN_ERROR_INSTALLFILEREMINDER'] = "Warning! You still have NOT removed the 'install.php' from your phpLogCon main directory!"; $content['LN_ERROR_INSTALLFILEREMINDER'] = "Warning! You still have NOT removed the 'install.php' from your phpLogCon main directory!";
@ -56,11 +71,23 @@ $content['LN_SEARCH_ADVANCED'] = "Advanced Search";
$content['LN_SEARCH'] = "Search"; $content['LN_SEARCH'] = "Search";
$content['LN_SEARCH_RESET'] = "Reset search"; $content['LN_SEARCH_RESET'] = "Reset search";
$content['LN_SEARCH_PERFORMADVANCED'] = "Perform Advanced Search"; $content['LN_SEARCH_PERFORMADVANCED'] = "Perform Advanced Search";
$content['LN_VIEW_MESSAGECENTERED'] = "Back to unfiltered view with this message at top";
$content['LN_VIEW_RELATEDMSG'] = "View related syslog messages";
$content['LN_VIEW_FILTERFOR'] = "Filter message for ";
$content['LN_VIEW_SEARCHFOR'] = "Search online for ";
$content['LN_VIEW_SEARCHFORGOOGLE'] = "Search Google for ";
$content['LN_GEN_MESSAGEDETAILS'] = "Message Details";
$content['LN_HIGHLIGHT'] = "Hightlight >>"; $content['LN_HIGHLIGHT'] = "Hightlight >>";
$content['LN_HIGHLIGHT_OFF'] = "Hightlight <<"; $content['LN_HIGHLIGHT_OFF'] = "Hightlight <<";
$content['LN_HIGHLIGHT_WORDS'] = "Hightlight words comma separated"; $content['LN_HIGHLIGHT_WORDS'] = "Hightlight words comma separated";
$content['LN_AUTORELOAD'] = "Set auto reload";
$content['LN_AUTORELOAD_DISABLED'] = "Auto reload disabled";
$content['LN_AUTORELOAD_PRECONFIGURED'] = "Preconfigured auto reload ";
$content['LN_AUTORELOAD_SECONDS'] = "seconds";
$content['LN_AUTORELOAD_MINUTES'] = "minutes";
$content['LN_ERROR_NORECORDS'] = "No syslog records found."; $content['LN_ERROR_NORECORDS'] = "No syslog records found.";
// Filter Options // Filter Options
@ -84,6 +111,7 @@ $content['LN_FILTER_OTHERS'] = "Other Filters";
$content['LN_FILTER_MESSAGE'] = "Syslog Message"; $content['LN_FILTER_MESSAGE'] = "Syslog Message";
$content['LN_FILTER_SYSLOGTAG'] = "Syslogtag"; $content['LN_FILTER_SYSLOGTAG'] = "Syslogtag";
$content['LN_FILTER_SOURCE'] = "Source (Hostname)"; $content['LN_FILTER_SOURCE'] = "Source (Hostname)";
$content['LN_FILTER_MESSAGETYPE'] = "Message Type";
// Field Captions // Field Captions
$content['LN_FIELDS_DATE'] = "Date"; $content['LN_FIELDS_DATE'] = "Date";
@ -95,6 +123,11 @@ $content['LN_FIELDS_PROCESSID'] = "ProcessID";
$content['LN_FIELDS_MESSAGETYPE'] = "Messagetype"; $content['LN_FIELDS_MESSAGETYPE'] = "Messagetype";
$content['LN_FIELDS_UID'] = "uID"; $content['LN_FIELDS_UID'] = "uID";
$content['LN_FIELDS_MESSAGE'] = "Message"; $content['LN_FIELDS_MESSAGE'] = "Message";
$content['LN_FIELDS_EVENTID'] = "Event ID";
$content['LN_FIELDS_EVENTLOGTYPE'] = "Eventlog Type";
$content['LN_FIELDS_EVENTSOURCE'] = "Event Source";
$content['LN_FIELDS_EVENTCATEGORY'] = "Event Category";
$content['LN_FIELDS_EVENTUSER'] = "Event User";
// Install Page // Install Page
$content['LN_CFG_DBSERVER'] = "Database Host"; $content['LN_CFG_DBSERVER'] = "Database Host";
@ -114,9 +147,12 @@ $content['LN_CFG_DBSTORAGEENGINE'] = "Database Storage Engine";
$content['LN_CFG_DBTABLENAME'] = "Database Tablename"; $content['LN_CFG_DBTABLENAME'] = "Database Tablename";
$content['LN_CFG_NAMEOFTHESOURCE'] = "Name of the Source"; $content['LN_CFG_NAMEOFTHESOURCE'] = "Name of the Source";
$content['LN_CFG_FIRSTSYSLOGSOURCE'] = "First Syslog Source"; $content['LN_CFG_FIRSTSYSLOGSOURCE'] = "First Syslog Source";
$content['LN_CFG_DBROWCOUNTING'] = "Enable Row Counting";
$content['LN_CFG_VIEW'] = "Select View";
// Details page // Details page
$content['LN_DETAILS_FORSYSLOGMSG'] = "Details for the syslog messages with id"; $content['LN_DETAILS_FORSYSLOGMSG'] = "Details for the syslog messages with id";
$content['LN_DETAILS_DETAILSFORMSG'] = "Details for message id"; $content['LN_DETAILS_DETAILSFORMSG'] = "Details for message id";
$content['LN_DETAIL_BACKTOLIST'] = "Back to Listview";
?> ?>

1
src/lang/pt_BR/info.txt Normal file
View File

@ -0,0 +1 @@
Portugu&ecirc;s

160
src/lang/pt_BR/main.php Normal file
View File

@ -0,0 +1,160 @@
<?php
/*
*********************************************************************
* -> www.phplogcon.org <-
* -----------------------------------------------------------------
*
* Copyright (C) 2008 Adiscon GmbH.
*
* This file is part of phpLogCon.
*
* Translation by Ricardo Maraschini
* [mailto:ricardo.maraschini@opservices.com.br]
*
* PhpLogCon is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PhpLogCon is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
*********************************************************************
*/
global $content;
// Global Stuff
$content['LN_MAINTITLE'] = "Controle de Logs";
$content['LN_MAIN_SELECTSTYLE'] = "Estilo";
$content['LN_GEN_LANGUAGE'] = "Linguagem";
$content['LN_GEN_SELECTSOURCE'] = "Origem";
$content['LN_GEN_MOREPAGES'] = "Mais que uma p&aacute;gina dispon&iacute;vel";
$content['LN_GEN_FIRSTPAGE'] = "Primeira P&aacute;gina";
$content['LN_GEN_LASTPAGE'] = "&Uacute;ltima P&aacute;gina";
$content['LN_GEN_NEXTPAGE'] = "Pr&oacute;xima P&aacute;gina";
$content['LN_GEN_PREVIOUSPAGE'] = "P&aacute;gina Anterior";
$content['LN_GEN_RECORDCOUNT'] = "Total de registros encontrados";
$content['LN_GEN_PAGERSIZE'] = "Registros/p&aacute;gina";
$content['LN_GEN_PAGE'] = "P&aacute;gina";
$content['LN_GEN_PREDEFINEDSEARCHES'] = "Buscas pr&eacute;-definidas";
$content['LN_GEN_SOURCE_DISK'] = "Arquivo em disco";
$content['LN_GEN_SOURCE_DB'] = "Base de dados";
$content['LN_GEN_SOURCE_PDO'] = "Base de dados (PDO)";
$content['LN_GEN_RECORDSPERPAGE'] = "registros por p&aacute;gina";
$content['LN_GEN_PRECONFIGURED'] = "Pr&eacute;-configurado";
$content['LN_GEN_AVAILABLESEARCHES'] = "Buscas dispon&iacute;veis";
$content['LN_GEN_DB_MYSQL'] = "Servidor MySQL";
$content['LN_GEN_DB_MSSQL'] = "Microsoft SQL Server";
$content['LN_GEN_DB_ODBC'] = "Conex&atilde;o via ODBC";
$content['LN_GEN_DB_PGSQL'] = "PostgreSQL";
$content['LN_GEN_DB_OCI'] = "Oracle Call Interface";
$content['LN_GEN_DB_DB2'] = " IBM DB2";
$content['LN_GEN_DB_FIREBIRD'] = "Firebird/Interbase 6";
$content['LN_GEN_DB_INFORMIX'] = "IBM Informix Dynamic Server";
$content['LN_GEN_DB_SQLITE'] = "SQLite 2";
$content['LN_GEN_SELECTVIEW'] = "Vis&atilde;o";
// Main Index Site
$content['LN_ERROR_INSTALLFILEREMINDER'] = "Aten&ccedil;&atilde;o! Voc&ecirc; ainda N&Atilde;O removeu o arquivo 'install.php' do diret&oacute;rio de seu phpLogCon!";
$content['LN_TOP_NUM'] = "N&atilde;o.";
$content['LN_TOP_UID'] = "uID";
$content['LN_GRID_POPUPDETAILS'] = "Detalhes para a mensagem ID '%1'";
$content['LN_SEARCH_USETHISBLA'] = "Use o formul&aacute;rio abaixo";
$content['LN_SEARCH_FILTER'] = "Busca (filtro):";
$content['LN_SEARCH_ADVANCED'] = "Busca Avan&ccedil;ada";
$content['LN_SEARCH'] = "Busca";
$content['LN_SEARCH_RESET'] = "Limpa";
$content['LN_SEARCH_PERFORMADVANCED'] = "Realizar Busca Avan&ccedil;ada";
$content['LN_VIEW_MESSAGECENTERED'] = "Eliminar filtros e visualizar esta mensagem no topo";
$content['LN_VIEW_RELATEDMSG'] = "Ver mensagens relacionadas";
$content['LN_VIEW_FILTERFOR'] = "Filtrar mensagens por ";
$content['LN_VIEW_SEARCHFOR'] = "Busca online por ";
$content['LN_VIEW_SEARCHFORGOOGLE'] = "Busca no Google por ";
$content['LN_GEN_MESSAGEDETAILS'] = "Detalhes da Mensagem";
$content['LN_HIGHLIGHT'] = "Destacar >>";
$content['LN_HIGHLIGHT_OFF'] = "Destacar <<";
$content['LN_HIGHLIGHT_WORDS'] = "Utilize uma lista de palavras separadas por v&iacute;rgula";
$content['LN_AUTORELOAD'] = "Recarregamento";
$content['LN_AUTORELOAD_DISABLED'] = "Auto recarregamento desabilitado";
$content['LN_AUTORELOAD_PRECONFIGURED'] = "Auto recarregamento pr&eacute;-configurado ";
$content['LN_AUTORELOAD_SECONDS'] = "segundos";
$content['LN_AUTORELOAD_MINUTES'] = "minutos";
$content['LN_ERROR_NORECORDS'] = "Sem mensagens encontradas.";
// Filter Options
$content['LN_FILTER_DATE'] = "Intervalo Data/Hora";
$content['LN_FILTER_DATEMODE'] = "Selecionar Modo";
$content['LN_DATEMODE_ALL'] = "Todo o tempo";
$content['LN_DATEMODE_RANGE'] = "Intervalo de tempo";
$content['LN_DATEMODE_LASTX'] = "Tempo X desde hoje";
$content['LN_FILTER_DATEFROM'] = "Data a partir de ";
$content['LN_FILTER_DATETO'] = "At&eacute;";
$content['LN_FILTER_DATELASTX'] = "Tempo desde";
$content['LN_FILTER_ADD2SEARCH'] = "Adicionar a busca";
$content['LN_DATE_LASTX_HOUR'] = "&Uacute;ltima hora";
$content['LN_DATE_LASTX_12HOURS'] = "&Uacute;ltimas 12 horas";
$content['LN_DATE_LASTX_24HOURS'] = "&Uacute;ltimas 24 horas";
$content['LN_DATE_LASTX_7DAYS'] = "&Uacute;ltimos 7 dias";
$content['LN_DATE_LASTX_31DAYS'] = "&Uacute;ltimos 31 dias";
$content['LN_FILTER_FACILITY'] = "Facility";
$content['LN_FILTER_SEVERITY'] = "Severidade";
$content['LN_FILTER_OTHERS'] = "Outros Filtros";
$content['LN_FILTER_MESSAGE'] = "Mensagem Syslog";
$content['LN_FILTER_SYSLOGTAG'] = "Syslogtag";
$content['LN_FILTER_SOURCE'] = "Origem (Hostname)";
$content['LN_FILTER_MESSAGETYPE'] = "Tipo de mensagem";
// Field Captions
$content['LN_FIELDS_DATE'] = "Data";
$content['LN_FIELDS_FACILITY'] = "Facility";
$content['LN_FIELDS_SEVERITY'] = "Severidade";
$content['LN_FIELDS_HOST'] = "Host";
$content['LN_FIELDS_SYSLOGTAG'] = "Syslogtag";
$content['LN_FIELDS_PROCESSID'] = "PID";
$content['LN_FIELDS_MESSAGETYPE'] = "Tipo";
$content['LN_FIELDS_UID'] = "uID";
$content['LN_FIELDS_MESSAGE'] = "Mensagem";
$content['LN_FIELDS_EVENTID'] = "ID do Evento";
$content['LN_FIELDS_EVENTLOGTYPE'] = "Tipo do Evento";
$content['LN_FIELDS_EVENTSOURCE'] = "Origem do Evento";
$content['LN_FIELDS_EVENTCATEGORY'] = "Categoria do Evento";
$content['LN_FIELDS_EVENTUSER'] = "Evento de Usu&acute;rio";
// Install Page
$content['LN_CFG_DBSERVER'] = "Servidor BD";
$content['LN_CFG_DBPORT'] = "Porta BD";
$content['LN_CFG_DBNAME'] = "Nome BD";
$content['LN_CFG_DBPREF'] = "Prefixo para as tabelas";
$content['LN_CFG_DBUSER'] = "Usu&aacute;rio";
$content['LN_CFG_DBPASSWORD'] = "Password";
$content['LN_CFG_PARAMMISSING'] = "O seguinte par&acirc;metro esta faltando: ";
$content['LN_CFG_SOURCETYPE'] = "Tipo de Origem";
$content['LN_CFG_DISKTYPEOPTIONS'] = "Op&ccedil;&oatilde;oes de disco";
$content['LN_CFG_LOGLINETYPE'] = "Formato linha do log";
$content['LN_CFG_SYSLOGFILE'] = "Arquivo Syslog";
$content['LN_CFG_DATABASETYPEOPTIONS'] = "Op&ccedil;&oatilde;es BD";
$content['LN_CFG_DBTABLETYPE'] = "Tipo de tabela";
$content['LN_CFG_DBSTORAGEENGINE'] = "Engine BD";
$content['LN_CFG_DBTABLENAME'] = "Nome tabela";
$content['LN_CFG_NAMEOFTHESOURCE'] = "Nome da origem";
$content['LN_CFG_FIRSTSYSLOGSOURCE'] = "Fonte prim&aacute;ria Syslog";
$content['LN_CFG_DBROWCOUNTING'] = "Habilitar contagem de registro";
$content['LN_CFG_VIEW'] = "Selecione vis&atilde;o";
// Details page
$content['LN_DETAILS_FORSYSLOGMSG'] = "Detalhes para a mensagem com id";
$content['LN_DETAILS_DETAILSFORMSG'] = "Detalhes para a mensagem com id";
$content['LN_DETAIL_BACKTOLIST'] = "Voltar para a lista";
?>

View File

@ -60,14 +60,7 @@ $content['searchstr'] = "";
// --- // ---
//if ( isset($content['myserver']) )
// $content['TITLE'] = "phpLogCon :: Home :: Server '" . $content['myserver']['Name'] . "'"; // Title of the Page
//else
$content['TITLE'] = "phpLogCon :: Search";
// ---
// --- BEGIN Custom Code // --- BEGIN Custom Code
if ( (isset($_POST['search']) || isset($_GET['search'])) ) if ( (isset($_POST['search']) || isset($_GET['search'])) )
{ {
// Copy search over // Copy search over
@ -117,7 +110,7 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) )
} }
} }
if ( isset($_GET['filter_facility']) && count($_GET['filter_facility']) < 18 ) // If we have more than 18 elements, this means all facilities are enabled if ( isset($_GET['filter_facility']) && count($_GET['filter_facility']) < count($content['filter_facility_list']) ) // If we have more elements as in the filter list array, this means all are enabled
{ {
$tmpStr = ""; $tmpStr = "";
foreach ($_GET['filter_facility'] as $tmpfacility) foreach ($_GET['filter_facility'] as $tmpfacility)
@ -129,7 +122,7 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) )
$content['searchstr'] .= "facility:" . $tmpStr . " "; $content['searchstr'] .= "facility:" . $tmpStr . " ";
} }
if ( isset($_GET['filter_severity']) && count($_GET['filter_severity']) < 7 ) // If we have more than 7 elements, this means all facilities are enabled) if ( isset($_GET['filter_severity']) && count($_GET['filter_severity']) < count($content['filter_severity_list']) ) // If we have more elements as in the filter list array, this means all are enabled
{ {
$tmpStr = ""; $tmpStr = "";
foreach ($_GET['filter_severity'] as $tmpfacility) foreach ($_GET['filter_severity'] as $tmpfacility)
@ -141,6 +134,19 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) )
$content['searchstr'] .= "severity:" . $tmpStr . " "; $content['searchstr'] .= "severity:" . $tmpStr . " ";
} }
if ( isset($_GET['filter_messagetype']) && count($_GET['filter_messagetype']) < count($content['filter_messagetype_list']) ) // If we have more elements as in the filter list array, this means all are enabled
{
$tmpStr = "";
foreach ($_GET['filter_messagetype'] as $tmpmsgtype)
{
if ( strlen($tmpStr) > 0 )
$tmpStr .= ",";
$tmpStr .= $tmpmsgtype;
}
$content['searchstr'] .= "messagetype:" . $tmpStr . " ";
}
// Spaces need to be converted! // Spaces need to be converted!
if ( isset($_GET['filter_syslogtag']) && strlen($_GET['filter_syslogtag']) > 0 ) if ( isset($_GET['filter_syslogtag']) && strlen($_GET['filter_syslogtag']) > 0 )
{ {
@ -163,17 +169,29 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) )
if ( isset($_GET['filter_message']) && strlen($_GET['filter_message']) > 0 ) if ( isset($_GET['filter_message']) && strlen($_GET['filter_message']) > 0 )
$content['searchstr'] .= $_GET['filter_message']; $content['searchstr'] .= $_GET['filter_message'];
} }
// Append sourceid if needed
if ( isset($_GET['sourceid']) && isset($content['Sources'][ $_GET['sourceid'] ]) )
$sourceidstr = "&sourceid=" . $_GET['sourceid'];
else
$sourceidstr = "";
// Redirect to the index page now! // Redirect to the index page now!
RedirectPage( "index.php?filter=" . urlencode( trim($content['searchstr']) ) . "&search=Search"); RedirectPage( "index.php?filter=" . urlencode( trim($content['searchstr']) ) . "&search=Search" . $sourceidstr);
} }
// --- // ---
// --- BEGIN CREATE TITLE
$content['TITLE'] = InitPageTitle();
// Append custom title part!
$content['TITLE'] .= " :: Search";
// --- END CREATE TITLE
// --- Parsen and Output // --- Parsen and Output
InitTemplateParser(); InitTemplateParser();
$page -> parser($content, "search.html"); $page -> parser($content, "search.html");
$page -> output(); $page -> output();
// --- // ---
?> ?>

View File

@ -1,103 +1,104 @@
<!-- INCLUDE include_header.html --> <!-- INCLUDE include_header.html -->
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="with_border"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="with_border">
<tr> <tr>
<td colspan="3" class="title" nowrap><B>{LN_DETAILS_FORSYSLOGMSG} '{uid_current}'</B></td> <td colspan="3" class="title" nowrap><B>{LN_DETAILS_FORSYSLOGMSG} '{uid_current}'</B></td>
</tr> </tr>
<table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="with_border"> <table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="with_border">
<tr> <tr>
<td nowrap width="100%"class="line2" align="left"> <td width="100%" class="line2" align="left">
<!-- IF main_currentpagenumber_found="true" --> <a href="index.php?uid={uid_current}{additional_url_sourceonly}" target="_top"><img src="{MENU_HOMEPAGE}" align="middle" width="16" height="16" alt="{LN_DETAIL_BACKTOLIST}" title="{LN_DETAIL_BACKTOLIST}">&nbsp;{LN_DETAIL_BACKTOLIST}</a>
{LN_GEN_PAGE} {main_currentpagenumber} <!-- IF main_currentpagenumber_found="true" -->
<!-- ENDIF main_currentpagenumber_found="true" --> {LN_GEN_PAGE} {main_currentpagenumber}
</td> <!-- ENDIF main_currentpagenumber_found="true" -->
</td>
<!-- IF main_recordcount_found="true" -->
<td nowrap width="125" class="cellmenu2">{LN_GEN_RECORDCOUNT}:</td> <!-- IF main_recordcount_found="true" -->
<td nowrap width="50" class="line2"><B>{main_recordcount}</B></td> <td nowrap width="125" class="cellmenu2">{LN_GEN_RECORDCOUNT}:</td>
<!-- ENDIF main_recordcount_found="true" --> <td nowrap width="50" class="line2"><B>{main_recordcount}</B></td>
<!-- IF main_pagerenabled="true" --> <!-- ENDIF main_recordcount_found="true" -->
<td class="cellmenu2" nowrap><B>Pager: &nbsp; </B></td> <!-- IF main_pagerenabled="true" -->
<td class="line0" width="20" nowrap> <td class="cellmenu2" nowrap><B>Pager: &nbsp; </B></td>
<!-- IF main_pager_first_found="true" --> <td class="line0" width="20" nowrap>
<a href="?{additional_url_sortingonly}&uid={uid_first}" target="_top"><img src="{MENU_PAGER_BEGIN}" width="16" height="16" title="{LN_GEN_FIRSTPAGE}"></a> <!-- IF main_pager_first_found="true" -->
<!-- ENDIF main_pager_first_found="true" --> <a href="?{additional_url_sortingonly}&uid={uid_first}" target="_top"><img src="{MENU_PAGER_BEGIN}" width="16" height="16" alt="{LN_GEN_FIRSTPAGE}" title="{LN_GEN_FIRSTPAGE}"></a>
<!-- IF main_pager_first_found!="true" --> <!-- ENDIF main_pager_first_found="true" -->
<img src="{MENU_PAGER_BEGIN_GREY}" width="16" height="16"> <!-- IF main_pager_first_found!="true" -->
<!-- ENDIF main_pager_first_found!="true" --> <img src="{MENU_PAGER_BEGIN_GREY}" width="16" height="16">
</td> <!-- ENDIF main_pager_first_found!="true" -->
</td>
<td class="line1" width="20" nowrap>
<!-- IF main_pager_previous_found="true" --> <td class="line1" width="20" nowrap>
<a href="?{additional_url_sortingonly}&uid={uid_current}&direction=previous" target="_top"><img src="{MENU_PAGER_PREVIOUS}" width="16" title="{LN_GEN_PREVIOUSPAGE}"></a> <!-- IF main_pager_previous_found="true" -->
<!-- ENDIF main_pager_previous_found="true" --> <a href="?{additional_url_sortingonly}&uid={uid_current}&direction=previous" target="_top"><img src="{MENU_PAGER_PREVIOUS}" width="16" alt="{LN_GEN_PREVIOUSPAGE}" title="{LN_GEN_PREVIOUSPAGE}"></a>
<!-- IF main_pager_previous_found!="true" --> <!-- ENDIF main_pager_previous_found="true" -->
<img src="{MENU_PAGER_PREVIOUS_GREY}" width="16" height="16"> <!-- IF main_pager_previous_found!="true" -->
<!-- ENDIF main_pager_previous_found!="true" --> <img src="{MENU_PAGER_PREVIOUS_GREY}" width="16" height="16">
</td> <!-- ENDIF main_pager_previous_found!="true" -->
</td>
<!-- BEGIN syslogpages -->
<td class="{cssclass}" nowrap><a href="?{additional_url_sortingonly}&uid={mypagebegin}{additional_url}" target="_top">{mypagenumber}</a>&nbsp;</td> <!-- BEGIN syslogpages -->
<!-- END syslogpages --> <td class="{cssclass}" nowrap><a href="?{additional_url_sortingonly}&uid={mypagebegin}{additional_url}" target="_top">{mypagenumber}</a>&nbsp;</td>
<!-- END syslogpages -->
<td class="line0" width="20" nowrap>
<!-- IF main_pager_next_found="true" --> <td class="line0" width="20" nowrap>
<a href="?{additional_url_sortingonly}&uid={uid_current}&direction=next" target="_top"><img src="{MENU_PAGER_NEXT}" width="16" title="{LN_GEN_NEXTPAGE}"></a> <!-- IF main_pager_next_found="true" -->
<!-- ENDIF main_pager_next_found="true" --> <a href="?{additional_url_sortingonly}&uid={uid_current}&direction=next" target="_top"><img src="{MENU_PAGER_NEXT}" width="16" alt="{LN_GEN_NEXTPAGE}" title="{LN_GEN_NEXTPAGE}"></a>
<!-- IF main_pager_next_found!="true" --> <!-- ENDIF main_pager_next_found="true" -->
<img src="{MENU_PAGER_NEXT_GREY}" width="16" height="16"> <!-- IF main_pager_next_found!="true" -->
<!-- ENDIF main_pager_next_found!="true" --> <img src="{MENU_PAGER_NEXT_GREY}" width="16" height="16">
</td> <!-- ENDIF main_pager_next_found!="true" -->
</td>
<td class="line1" width="20" nowrap>
<!-- IF main_pager_last_found="true" --> <td class="line1" width="20" nowrap>
<a href="?{additional_url_sortingonly}&uid={uid_last}" target="_top"><img src="{MENU_PAGER_END}" width="16" title="{LN_GEN_LASTPAGE}"></a> <!-- IF main_pager_last_found="true" -->
<!-- ENDIF main_pager_last_found="true" --> <a href="?{additional_url_sortingonly}&uid={uid_last}" target="_top"><img src="{MENU_PAGER_END}" width="16" alt="{LN_GEN_LASTPAGE}" title="{LN_GEN_LASTPAGE}"></a>
<!-- IF main_pager_last_found!="true" --> <!-- ENDIF main_pager_last_found="true" -->
<img src="{MENU_PAGER_END_GREY}" width="16" height="16"> <!-- IF main_pager_last_found!="true" -->
<!-- ENDIF main_pager_last_found!="true" --> <img src="{MENU_PAGER_END_GREY}" width="16" height="16">
</td> <!-- ENDIF main_pager_last_found!="true" -->
<!-- <td nowrap width="200" class="line2"><I>&nbsp;{LN_GEN_MOREPAGES}</I></td> --> </td>
<!-- ENDIF main_pagerenabled="true" --> <!-- <td nowrap width="200" class="line2"><I>&nbsp;{LN_GEN_MOREPAGES}</I></td> -->
</tr> <!-- ENDIF main_pagerenabled="true" -->
</table> </tr>
</table>
<tr>
<td width="100%" valign="top"> <tr>
<td width="100%" valign="top">
<!-- IF messageenabled="true" -->
<table width="100%" cellpadding="0" cellspacing="1" border="0" align="center" class="with_border_alternate"> <!-- IF messageenabled="true" -->
<!-- BEGIN fields --> <table width="100%" cellpadding="0" cellspacing="1" border="0" align="center" class="with_border_alternate">
<tr> <!-- BEGIN fields -->
<td width="200" class="cellmenu1" align="left" nowrap> <tr>
<B>{FieldCaption}</B> <td width="200" class="cellmenu1" align="left" nowrap>
</td> <B>{FieldCaption}</B>
<td width="100%" align="{FieldAlign}" class="{cssclass}" {fieldbgcolor} valign="top"> </td>
<B> <td width="100%" align="{FieldAlign}" class="{cssclass}" {fieldbgcolor} valign="top">
</B> <B>
{fieldvalue} </B>
</td> {fieldvalue}
</tr> </td>
<!-- END fields --> </tr>
</table> <!-- END fields -->
<!-- ENDIF messageenabled="true" --> </table>
<!-- ENDIF messageenabled="true" -->
<!-- IF messageenabled="false" -->
<center> <!-- IF messageenabled="false" -->
<font color="red"> <center>
<br> <font color="red">
<h3>{LN_ERROR_NORECORDS} (code {error_code} ) - Error Details: </h3> <br>
{detailederror} <h3>{LN_ERROR_NORECORDS} (code {error_code} ) - Error Details: </h3>
<br> {detailederror}
<br> <br>
</font> <br>
</center> </font>
<!-- ENDIF messageenabled="false" --> </center>
<!-- ENDIF messageenabled="false" -->
</td>
</tr> </td>
</table> </tr>
</table>
<!-- INCLUDE include_footer.html -->
<!-- INCLUDE include_footer.html -->

View File

@ -1,36 +1,37 @@
<br><br> <br><br>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="mainfooter"> <table width="100%" border="0" cellspacing="1" cellpadding="0" class="mainfooter">
<tr> <tr>
<td align="center" class="line0">Created 2008 - By <a href="http://www.adiscon.com" target="_blank">Adiscon GmbH</a></td> <td align="center" class="line0">Created 2008 - By <a href="http://www.adiscon.com" target="_blank">Adiscon GmbH</a></td>
<td align="center" class="line1"> <td align="center" class="line1">
&nbsp;<a href="http://www.phplogcon.org" target="_blank">phpLogCon</A> Version {BUILDNUMBER} &nbsp;<a href="http://www.phplogcon.org" target="_blank">phpLogCon</A> Version {BUILDNUMBER}
</td> </td>
<td align="center" class="line0"> <td align="center" class="line0">
&nbsp;<B>Partners:</B> &nbsp;<B>Partners:</B>
</td> </td>
<td align="center" class="line1"> <td align="center" class="line1">
&nbsp;<a href="http://www.rsyslog.com" target="_blank">rsyslog</a> | &nbsp;<a href="http://www.rsyslog.com" target="_blank">rsyslog</a> |
&nbsp;<a href="http://www.winsyslog.com" target="_blank">WinSyslog</a> &nbsp;<a href="http://www.winsyslog.com" target="_blank">WinSyslog</a>
</td> </td>
<!-- IF ShowPageRenderStats="true" --> <!-- IF ShowPageRenderStats="true" -->
<td align="center" class="line2"> <td align="center" class="line2">
Page rendered in <B>{PAGERENDERTIME}</B> seconds Page rendered in <B>{PAGERENDERTIME}</B> seconds
&nbsp;|&nbsp;Total DB Queries <B>{TOTALQUERIES}</B> &nbsp;|&nbsp;DB queries: <B>{TOTALQUERIES}</B>
</td> &nbsp;|&nbsp;GZIP enabled: <B>{GzipCompressionEnmabled}</B>
<!-- ENDIF ShowPageRenderStats="true" --> </td>
</tr> <!-- ENDIF ShowPageRenderStats="true" -->
</table> </tr>
</table>
</td>
</tr> </td>
</table> </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<td colspan="2" background="themes/{user_theme}/images/bg_bottom.gif" height="16"><img src="themes/{user_theme}/images/bg_bottom.gif" height="16"></td> <tr>
</tr> <td colspan="2" background="themes/{user_theme}/images/bg_bottom.gif" height="16"><img src="themes/{user_theme}/images/bg_bottom.gif" height="16"></td>
</table> </tr>
</table>
</body>
</body>
</html> </html>

View File

@ -29,7 +29,7 @@
<td class="cellmenu1" width="150" nowrap><B>&nbsp;{LN_MAIN_SELECTSTYLE}&nbsp;</B></td> <td class="cellmenu1" width="150" nowrap><B>&nbsp;{LN_MAIN_SELECTSTYLE}&nbsp;</B></td>
<td align="right"> <td align="right">
<input type="hidden" name="op" value="changestyle"> <input type="hidden" name="op" value="changestyle">
<select name="stylename" size="1" OnChange="document.styleidform.submit();"> <select name="stylename" size="1" OnChange="document.styleidform.submit();" STYLE="width: 190px">
<!-- BEGIN USERSTYLES --> <!-- BEGIN USERSTYLES -->
<option {is_selected} value="{StyleName}">{StyleName}</option> <option {is_selected} value="{StyleName}">{StyleName}</option>
<!-- END USERSTYLES --> <!-- END USERSTYLES -->
@ -51,7 +51,7 @@
<td class="cellmenu1" width="150" nowrap><B>&nbsp;{LN_GEN_LANGUAGE}&nbsp;</B></td> <td class="cellmenu1" width="150" nowrap><B>&nbsp;{LN_GEN_LANGUAGE}&nbsp;</B></td>
<td align="right"> <td align="right">
<input type="hidden" name="op" value="changelang"> <input type="hidden" name="op" value="changelang">
<select name="langcode" size="1" OnChange="document.langidform.submit();"> <select name="langcode" size="1" OnChange="document.langidform.submit();" STYLE="width: 190px">
<!-- BEGIN USERLANG --> <!-- BEGIN USERLANG -->
<option {is_selected} value="{langcode}">{DisplayName}</option> <option {is_selected} value="{langcode}">{DisplayName}</option>
<!-- END USERLANG --> <!-- END USERLANG -->
@ -71,7 +71,7 @@
<tr> <tr>
<td class="cellmenu1" width="150" nowrap><B>&nbsp;{LN_GEN_SELECTSOURCE}&nbsp;</B></td> <td class="cellmenu1" width="150" nowrap><B>&nbsp;{LN_GEN_SELECTSOURCE}&nbsp;</B></td>
<td align="right"> <td align="right">
<select name="sourceid" size="1" OnChange="document.sourceidform.submit();"> <select name="sourceid" size="1" OnChange="document.sourceidform.submit();" STYLE="width: 190px">
<!-- BEGIN Sources --> <!-- BEGIN Sources -->
<option {selected} value="{ID}">{Name}</option> <option {selected} value="{ID}">{Name}</option>
<!-- END Sources --> <!-- END Sources -->
@ -84,7 +84,25 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="100%" align="center" valign="top" height="100%">&nbsp;</td> <td width="100%" align="center" valign="top" height="100%">
<form action="userchange.php" method="get" name="viewidform">
<table width="350" border="0" cellspacing="0" cellpadding="0" class="with_border" align="right">
<tr>
<td class="cellmenu1" width="150" nowrap><B>&nbsp;{LN_GEN_SELECTVIEW}&nbsp;</B></td>
<td align="right">
<input type="hidden" name="op" value="changeview">
<select name="viewid" size="1" OnChange="document.viewidform.submit();" STYLE="width: 190px">
<!-- BEGIN Views -->
<option {selected} value="{ID}">{DisplayName}</option>
<!-- END Views -->
</select>
</td>
</tr>
</table>
</form>
</td>
</tr> </tr>
</table> </table>
@ -104,3 +122,5 @@
<h3><br><br><font color="red">{LN_ERROR_INSTALLFILEREMINDER}</font></h3> <h3><br><br><font color="red">{LN_ERROR_INSTALLFILEREMINDER}</font></h3>
</center> </center>
<!-- ENDIF error_installfilereminder="true" --> <!-- ENDIF error_installfilereminder="true" -->

View File

@ -2,6 +2,9 @@
<table border="0" cellspacing="0" cellpadding="2" align="center"> <table border="0" cellspacing="0" cellpadding="2" align="center">
<form action="" method="get" id="searchform" name="searchform"> <form action="" method="get" id="searchform" name="searchform">
<!-- BEGIN HIDDENVARS_SOURCE -->
<input type="hidden" name="{varname}" value="{varvalue}">
<!-- END HIDDENVARS_SOURCE -->
<tr> <tr>
<td nowrap align="center" nowrap valign="middle"> <td nowrap align="center" nowrap valign="middle">
<B>&nbsp;{LN_SEARCH_FILTER}</B> <B>&nbsp;{LN_SEARCH_FILTER}</B>
@ -10,11 +13,14 @@
<td nowrap align="left" nowrap valign="top"> <td nowrap align="left" nowrap valign="top">
<div id="menu"> <div id="menu">
<ul> <ul>
<li><img src="{MENU_NAV_CLOSE}" width="16" height="16" title="{LN_GEN_PREDEFINEDSEARCHES}" class="SelectSavedFilter"> <li><img src="{MENU_NAV_CLOSE}" width="16" height="16" title="{LN_GEN_PREDEFINEDSEARCHES}" class="SelectSavedFilter" OnClick="ToggleDisplayTypeById('menu_presearches');">
<ul class="with_border"> <ul class="with_border" id="menu_presearches">
<li><h2 class="cellmenu1">{LN_GEN_PREDEFINEDSEARCHES}</h2> <li class="cellmenu1">
<h2>{LN_GEN_PREDEFINEDSEARCHES}</h2>
<!-- BEGIN Search --> <!-- BEGIN Search -->
<li class="{cssclass}"><a href="?{SearchQuery}" target="_top">{DisplayName}</a></li> <li class="{cssclass}" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_presearches');">
<a href="?{SearchQuery}{additional_url_sourceonly}" target="_top">{DisplayName}</a>
</li>
<!-- END Search --> <!-- END Search -->
</ul> </ul>
</li> </li>
@ -26,7 +32,7 @@
<input maxlength="2048" name="filter" size="80" title="Search" value="{searchstr}" class="SearchFormTextbox"> <input maxlength="2048" name="filter" size="80" title="Search" value="{searchstr}" class="SearchFormTextbox">
<br> <br>
<input name="search" type="submit" value="{LN_SEARCH}" class="SearchFormControl"> <input name="search" type="submit" value="{LN_SEARCH}" class="SearchFormControl">
<a href="?search={LN_SEARCH}&filter={SearchCustomButtonSearch}" target="_top"><input name="lucky" type="button" value="{SearchCustomButtonCaption}" class="SearchFormControl"></a> <a href="?search={LN_SEARCH}&filter={SearchCustomButtonSearch}{additional_url_sourceonly}" target="_top"><input name="lucky" type="button" value="{SearchCustomButtonCaption}" class="SearchFormControl"></a>
<input type="button" value="{LN_SEARCH_RESET}" class="SearchFormControl" OnClick="ResetFormValues('searchform');"> <input type="button" value="{LN_SEARCH_RESET}" class="SearchFormControl" OnClick="ResetFormValues('searchform');">
<input type="button" value="{LN_HIGHLIGHT}" class="SearchFormControl" OnClick="togglevisibility('HightLightArea');"> <input type="button" value="{LN_HIGHLIGHT}" class="SearchFormControl" OnClick="togglevisibility('HightLightArea');">
<br> <br>
@ -81,11 +87,11 @@
</script> </script>
<!-- ENDIF EXPAND_HIGHLIGHT="true" --> <!-- ENDIF EXPAND_HIGHLIGHT="true" -->
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="with_border"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="with_border">
<tr> <tr>
<td colspan="3" class="title" nowrap><B>Recent syslog messages</B></td> <td class="title" nowrap><B>Recent syslog messages</B></td>
</tr> </tr>
</table>
<table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="with_border"> <table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="with_border">
<tr> <tr>
@ -95,18 +101,56 @@
<!-- ENDIF main_currentpagenumber_found="true" --> <!-- ENDIF main_currentpagenumber_found="true" -->
</td> </td>
<!-- IF ViewEnableAutoReloadSeconds_visible="true" -->
<td nowrap width="105" class="cellmenu2">{LN_AUTORELOAD}:</td>
<td nowrap width="50" class="line2">
<form action="userchange.php" method="get" name="autoreload">
<input type="hidden" name="op" value="autoreload">
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td>
<!-- <input type="checkbox" {autoreload_checked} name="autoreload">-->
<select name="autoreloadtime" size="1" OnChange="document.autoreload.submit();">
<!-- BEGIN reloadtimes -->
<option {Selected} value="{ID}">{DisplayName}</option>
<!-- END reloadtimes -->
</select>
</td>
</tr>
</table>
</form>
</td>
<!-- ENDIF ViewEnableAutoReloadSeconds_visible="true" -->
<!-- IF main_recordcount_found="true" --> <!-- IF main_recordcount_found="true" -->
<td nowrap width="125" class="cellmenu2">{LN_GEN_RECORDCOUNT}:</td> <td nowrap width="125" class="cellmenu2">{LN_GEN_RECORDCOUNT}:</td>
<td nowrap width="50" class="line2"><B>{main_recordcount}</B></td> <td nowrap width="50" class="line2"><B>{main_recordcount}</B></td>
<!-- ENDIF main_recordcount_found="true" --> <!-- ENDIF main_recordcount_found="true" -->
<!-- IF main_pagerenabled="true" --> <!-- IF main_pagerenabled="true" -->
<td nowrap width="115" class="cellmenu2">{LN_GEN_PAGERSIZE}:</td> <td nowrap width="115" class="cellmenu2">{LN_GEN_PAGERSIZE}:</td>
<td nowrap width="50" class="line2"><B>{ViewEntriesPerPage}</B></td> <td nowrap width="50" class="line2">
<form action="userchange.php" method="get" name="pageingsize">
<input type="hidden" name="op" value="changepagesize">
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td>
<select name="pagesizeid" size="1" OnChange="document.pageingsize.submit();">
<!-- BEGIN pagesizes -->
<option {Selected} value="{ID}">{DisplayName}</option>
<!-- END pagesizes -->
</select>
</td>
</tr>
</table>
</form>
</td>
<td class="cellmenu2" nowrap><B>Pager: &nbsp; </B></td> <td class="cellmenu2" nowrap><B>Pager: &nbsp; </B></td>
<td class="line0" width="20" nowrap> <td class="line0" width="20" nowrap>
<!-- IF main_pager_first_found="true" --> <!-- IF main_pager_first_found="true" -->
<a href="?{additional_url_sortingonly}&uid={uid_first}{additional_url}" target="_top"><img src="{MENU_PAGER_BEGIN}" width="16" height="16" title="{LN_GEN_FIRSTPAGE}"></a> <a href="?{additional_url_sortingonly}&uid=-1{additional_url}" target="_top"><img src="{MENU_PAGER_BEGIN}" width="16" height="16" title="{LN_GEN_FIRSTPAGE}"></a>
<!-- ENDIF main_pager_first_found="true" --> <!-- ENDIF main_pager_first_found="true" -->
<!-- IF main_pager_first_found!="true" --> <!-- IF main_pager_first_found!="true" -->
<img src="{MENU_PAGER_BEGIN_GREY}" width="16" height="16"> <img src="{MENU_PAGER_BEGIN_GREY}" width="16" height="16">
@ -115,7 +159,7 @@
<td class="line1" width="20" nowrap> <td class="line1" width="20" nowrap>
<!-- IF main_pager_previous_found="true" --> <!-- IF main_pager_previous_found="true" -->
<a href="?{additional_url_sortingonly}&uid={uid_current}&direction=desc{additional_url}" target="_top"><img src="{MENU_PAGER_PREVIOUS}" width="16" title="{LN_GEN_PREVIOUSPAGE}"></a> <a href="?{additional_url_sortingonly}&uid={uid_current}&direction=desc&skipone=true{additional_url}" target="_top"><img src="{MENU_PAGER_PREVIOUS}" width="16" title="{LN_GEN_PREVIOUSPAGE}"></a>
<!-- ENDIF main_pager_previous_found="true" --> <!-- ENDIF main_pager_previous_found="true" -->
<!-- IF main_pager_previous_found!="true" --> <!-- IF main_pager_previous_found!="true" -->
<img src="{MENU_PAGER_PREVIOUS_GREY}" width="16" height="16"> <img src="{MENU_PAGER_PREVIOUS_GREY}" width="16" height="16">
@ -137,7 +181,7 @@
<td class="line1" width="20" nowrap> <td class="line1" width="20" nowrap>
<!-- IF main_pager_last_found="true" --> <!-- IF main_pager_last_found="true" -->
<a href="?{additional_url_sortingonly}&uid={uid_last}{additional_url}" target="_top"><img src="{MENU_PAGER_END}" width="16" title="{LN_GEN_LASTPAGE}"></a> <a href="?{additional_url_sortingonly}&uid={uid_last}&direction=desc{additional_url}" target="_top"><img src="{MENU_PAGER_END}" width="16" title="{LN_GEN_LASTPAGE}"></a>
<!-- ENDIF main_pager_last_found="true" --> <!-- ENDIF main_pager_last_found="true" -->
<!-- IF main_pager_last_found!="true" --> <!-- IF main_pager_last_found!="true" -->
<img src="{MENU_PAGER_END_GREY}" width="16" height="16"> <img src="{MENU_PAGER_END_GREY}" width="16" height="16">
@ -145,90 +189,167 @@
</td> </td>
<!-- <td nowrap width="200" class="line2"><I>&nbsp;{LN_GEN_MOREPAGES}</I></td> --> <!-- <td nowrap width="200" class="line2"><I>&nbsp;{LN_GEN_MOREPAGES}</I></td> -->
<!-- ENDIF main_pagerenabled="true" --> <!-- ENDIF main_pagerenabled="true" -->
</tr> </tr>
</table> </table>
<!-- IF syslogmessagesenabled="true" -->
<table width="100%" cellpadding="0" cellspacing="1" border="0" align="center" class="with_border_alternate">
<tr> <tr>
<td width="100%" valign="top"> <!-- IF MiscShowDebugGridCounter="1" -->
<td class="cellmenu1"><B>Debug</B></td>
<!-- ENDIF MiscShowDebugGridCounter="1" -->
<!-- IF syslogmessagesenabled="true" --> <!-- BEGIN fields -->
<table width="100%" cellpadding="0" cellspacing="1" border="0" align="center" class="with_border_alternate"> <td width="{DefaultWidth}" class="cellmenu1" align="center" nowrap {colspan}>
<tr> <!-- IF FieldSortable="true" -->
<!-- IF MiscShowDebugGridCounter="1" --> <a HREF="?sorting={FieldID}{additional_url_uidonly}{additional_url}" class="cellmenu1_link" >
<td class="cellmenu1"><B>Debug</B></td> <!-- ENDIF FieldSortable="true" -->
<!-- ENDIF MiscShowDebugGridCounter="1" --> <B>{FieldCaption}</B>
<!-- IF FieldSortable="true" -->
</a>
<!-- ENDIF FieldSortable="true" -->
</td>
<!-- END fields -->
</tr>
<!-- BEGIN fields --> <!-- BEGIN syslogmessages -->
<td width="{DefaultWidth}" class="cellmenu1" align="center" nowrap> <tr>
<!-- IF FieldSortable="true" --> <!-- IF MiscShowDebugGridCounter="1" -->
<a HREF="?sorting={FieldID}{additional_url_uidonly}{additional_url}" class="cellmenu1_link" > <td class="{cssclass} gridline">{ZAEHLER}</td>
<!-- ENDIF FieldSortable="true" --> <!-- ENDIF MiscShowDebugGridCounter="1" -->
<B>{FieldCaption}</B>
<!-- IF FieldSortable="true" -->
</a>
<!-- ENDIF FieldSortable="true" -->
</td>
<!-- END fields -->
</tr>
<!-- BEGIN syslogmessages --> <!-- BEGIN values -->
<tr> <td align="{FieldAlign}" class="{fieldcssclass}" {fieldbgcolor} valign="middle" {isnowrap}>
<!-- IF MiscShowDebugGridCounter="1" -->
<td class="{cssclass}" >{ZAEHLER}</td> <!-- IF hasbuttons="true" -->
<!-- ENDIF MiscShowDebugGridCounter="1" --> <div id="menu">
<ul>
<li>
<ul class="with_border" id="menu_{FieldColumn}_{uid}">
<li class="cellmenu1" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_{FieldColumn}_{uid}');">
<h2>{LN_GEN_AVAILABLESEARCHES}</h2>
<!-- BEGIN buttons -->
<li class="{cssclass}" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_{FieldColumn}_{uid}');">
<img align="left" src="{IconSource}" width="16" height="16" vspace="2"><a href="{ButtonUrl}{additional_url_sourceonly}" target="_top">{DisplayName}</a>
</li>
<!-- END buttons -->
</ul>
</li>
</ul>
</div>
<!-- IF hasdropdownbutton="true" -->
<img align="left" vspace="0" hspace="2" src="{MENU_NAV_CLOSE}" width="16" height="16" border="0" title="{LN_GEN_AVAILABLESEARCHES}" OnClick="ToggleDisplayTypeById('menu_{FieldColumn}_{uid}');">
<!-- ENDIF hasdropdownbutton="true" -->
<!-- ENDIF hasbuttons="true" -->
<!-- IF ismessagefield="true" -->
<a href="{detaillink}{additional_url_sourceonly}" class="syslogdetails"><img align="{detailimagealign}" vspace="0" hspace="2" src="{MENU_LINK_VIEW}" width="16" height="16" border="0" title="{LN_GEN_MESSAGEDETAILS}"></a>
<!-- ENDIF ismessagefield="true" -->
<!-- BEGIN values -->
<td align="{FieldAlign}" class="{fieldcssclass}" {fieldbgcolor} valign="top">
<!-- IF hasdetails="false" --> <!-- IF hasdetails="false" -->
<!-- IF haslink="true" --> <!-- IF ismessagefield!="true" -->
<a href="{detaillink}" class="syslogdetails" target="_top"> <!-- IF hasbuttons="true" -->
<!-- ENDIF haslink="true" --> <a href="#search" OnClick="ToggleDisplayTypeById('menu_{FieldColumn}_{uid}');" class="{fieldcssclass}">{fieldvalue}</a>
<!-- IF haslink!="true" --><B><!-- ENDIF haslink!="true" --> <!-- ENDIF hasbuttons="true" -->
{fieldvalue}
<!-- IF haslink!="true" --></B><!-- ENDIF haslink!="true" --> <!-- IF hasbuttons!="true" -->
<!-- IF haslink="true" --> <b>{fieldvalue}</b>
</a> <!-- ENDIF hasbuttons!="true" -->
<!-- ENDIF haslink="true" --> <!-- ENDIF ismessagefield!="true" -->
<!-- IF ismessagefield="true" -->
<a href="{detaillink}{additional_url_sourceonly}" class="syslogdetails" target="_top">{fieldvalue}</a>
<!-- ENDIF ismessagefield="true" -->
<!-- ENDIF hasdetails="false" --> <!-- ENDIF hasdetails="false" -->
<!-- IF hasdetails="true" --> <!-- IF hasdetails="true" -->
<a href="{detaillink}" class="syslogdetails">{fieldvalue} <div OnClick="GoToPopupTarget('{detaillink}{additional_url_sourceonly}',this);" style="cursor:pointer" class="syslogdetails" OnMouseMove="movePopupWindow(event,'details_{FieldColumn}_{uid}',500, this);" OnMouseOver="initPopupWindow(this);" OnMouseOut="FinishPopupWindow(this);">{fieldvalue}<br />
<span> <span id="details_{FieldColumn}_{uid}" OnMouseOver="HoveringPopup(event,this);" OnMouseOut="FinishHoveringPopup(event,this);">
<table cellpadding="0" cellspacing="1" border="0" width="500" align="left" class="with_border_alternate"> <table cellpadding="0" cellspacing="1" border="0" width="500" align="left" class="with_border_alternate" OnMouseMove="disableEventPropagation();">
<tr><td colspan="2" class="cellmenu1" align="center"><B>{popupcaption}</B></td></tr> <tr><td colspan="2" class="cellmenu1" align="center"><B>{popupcaption}</B></td></tr>
<!-- BEGIN messagesdetails --> <!-- BEGIN messagesdetails -->
<tr> <tr>
<td width="150" nowrap class="cellmenu2">{detailfieldtitle}</td> <td width="150" nowrap class="cellmenu2">{detailfieldtitle}</td>
<td width="100%" class="{detailscssclass}" >{detailfieldvalue}</td> <td width="100%" class="{detailscssclass}">{detailfieldvalue}</td>
</tr> </tr>
<!-- END messagesdetails --> <!-- END messagesdetails -->
</table> </table>
</span> </span>
</a> </div>
<!-- ENDIF hasdetails="true" --> <!-- ENDIF hasdetails="true" -->
</td>
<!-- END values -->
</tr>
<!-- END syslogmessages -->
</table> </td>
<!-- ENDIF syslogmessagesenabled="true" --> <!-- END values -->
<!-- IF syslogmessagesenabled="false" --> </tr>
<center> <!-- END syslogmessages -->
<font color="red">
<br>
<h3>{LN_ERROR_NORECORDS} - Error Details: </h3>
{detailederror}
<br>
<br>
</font>
</center>
<!-- ENDIF syslogmessagesenabled="false" -->
</table>
<!-- ENDIF syslogmessagesenabled="true" -->
<!-- IF main_pagerenabled="true" -->
<table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="with_border">
<tr>
<td nowrap width="100%"class="line2" align="left">&nbsp;</td>
<td class="cellmenu2" nowrap><B>Pager: &nbsp; </B></td>
<td class="line0" width="20" nowrap>
<!-- IF main_pager_first_found="true" -->
<a href="?{additional_url_sortingonly}&uid=-1{additional_url}" target="_top"><img src="{MENU_PAGER_BEGIN}" width="16" height="16" title="{LN_GEN_FIRSTPAGE}"></a>
<!-- ENDIF main_pager_first_found="true" -->
<!-- IF main_pager_first_found!="true" -->
<img src="{MENU_PAGER_BEGIN_GREY}" width="16" height="16">
<!-- ENDIF main_pager_first_found!="true" -->
</td>
<td class="line1" width="20" nowrap>
<!-- IF main_pager_previous_found="true" -->
<a href="?{additional_url_sortingonly}&uid={uid_current}&direction=desc&skipone=true{additional_url}" target="_top"><img src="{MENU_PAGER_PREVIOUS}" width="16" title="{LN_GEN_PREVIOUSPAGE}"></a>
<!-- ENDIF main_pager_previous_found="true" -->
<!-- IF main_pager_previous_found!="true" -->
<img src="{MENU_PAGER_PREVIOUS_GREY}" width="16" height="16">
<!-- ENDIF main_pager_previous_found!="true" -->
</td>
<!-- BEGIN syslogpages -->
<td class="{cssclass}" nowrap><a href="?{additional_url_sortingonly}&uid={mypagebegin}{additional_url}" target="_top">{mypagenumber}</a>&nbsp;</td>
<!-- END syslogpages -->
<td class="line0" width="20" nowrap>
<!-- IF main_pager_next_found="true" -->
<a href="?{additional_url_sortingonly}&uid={uid_next}{additional_url}" target="_top"><img src="{MENU_PAGER_NEXT}" width="16" title="{LN_GEN_NEXTPAGE}"></a>
<!-- ENDIF main_pager_next_found="true" -->
<!-- IF main_pager_next_found!="true" -->
<img src="{MENU_PAGER_NEXT_GREY}" width="16" height="16">
<!-- ENDIF main_pager_next_found!="true" -->
</td>
<td class="line1" width="20" nowrap>
<!-- IF main_pager_last_found="true" -->
<a href="?{additional_url_sortingonly}&uid={uid_last}&direction=desc{additional_url}" target="_top"><img src="{MENU_PAGER_END}" width="16" title="{LN_GEN_LASTPAGE}"></a>
<!-- ENDIF main_pager_last_found="true" -->
<!-- IF main_pager_last_found!="true" -->
<img src="{MENU_PAGER_END_GREY}" width="16" height="16">
<!-- ENDIF main_pager_last_found!="true" -->
</td> </td>
</tr> </tr>
</table> </table>
<!-- ENDIF main_pagerenabled="true" -->
<!-- INCLUDE include_footer.html --> <!-- IF syslogmessagesenabled="false" -->
<center>
<font color="red">
<br>
<h3>{LN_ERROR_NORECORDS} - Error Details: </h3>
{detailederror}
<br>
<br>
</font>
</center>
<!-- ENDIF syslogmessagesenabled="false" -->
<!-- INCLUDE include_footer.html -->

View File

@ -8,6 +8,35 @@
</head> </head>
<body TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"> <body TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
<script language="javascript">
/*
* Helper function to show and hide areas of the filterview
*/
function toggleSourceTypeVisibility(FormFieldName)
{
var myfield = document.getElementById(FormFieldName);
if (myfield.value == 1)
{
showvisibility("HiddenDiskTypeOptions");
hidevisibility("HiddenDatabaseTypeOptions");
}
else if (myfield.value == 2)
{
showvisibility("HiddenDatabaseTypeOptions");
hidevisibility("HiddenDiskTypeOptions");
hidevisibility("HiddenDBTYpesOptions");
}
else if (myfield.value == 3)
{
showvisibility("HiddenDatabaseTypeOptions");
hidevisibility("HiddenDiskTypeOptions");
showvisibility("HiddenDBTYpesOptions");
}
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="mainheader"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="mainheader">
<tr> <tr>
<td rowspan="4" width="500" align="left" valign="top"><a href="index.php"><img src="{BASEPATH}images/main/Header-Logo.png" width="500" height="79" name="HeaderLogo"></a></td> <td rowspan="4" width="500" align="left" valign="top"><a href="index.php"><img src="{BASEPATH}images/main/Header-Logo.png" width="500" height="79" name="HeaderLogo"></a></td>
@ -154,6 +183,12 @@
<input type="radio" name="ViewEnableDetailPopups" value="1" {ViewEnableDetailPopups_true}> Yes <input type="radio" name="ViewEnableDetailPopups" value="0" {ViewEnableDetailPopups_false}> No <input type="radio" name="ViewEnableDetailPopups" value="1" {ViewEnableDetailPopups_true}> Yes <input type="radio" name="ViewEnableDetailPopups" value="0" {ViewEnableDetailPopups_false}> No
</td> </td>
</tr> </tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>Automatically resolved IP Addresses (inline)</b></td>
<td align="right" class="line1" width="100%">
<input type="radio" name="EnableIPAddressResolve" value="1" {EnableIPAddressResolve_true}> Yes <input type="radio" name="EnableIPAddressResolve" value="0" {EnableIPAddressResolve_false}> No
</td>
</tr>
</table> </table>
<p>&nbsp;</p> <p>&nbsp;</p>
@ -265,20 +300,30 @@
<tr> <tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_SOURCETYPE}</b></td> <td align="left" class="cellmenu2" nowrap><b>{LN_CFG_SOURCETYPE}</b></td>
<td align="right" class="line1" width="100%"> <td align="right" class="line1" width="100%">
<select id="SourceType" name="SourceType" size="1" OnChange="toggleFormareaVisibility('SourceType', 'HiddenDiskTypeOptions', 'HiddenDatabaseTypeOptions');"> <select id="SourceType" name="SourceType" size="1" OnChange="toggleSourceTypeVisibility('SourceType');">
<!-- BEGIN SOURCETYPES --> <!-- BEGIN SOURCETYPES -->
<option {selected} value="{type}">{DisplayName}</option> <option {selected} value="{type}">{DisplayName}</option>
<!-- END SOURCETYPES --> <!-- END SOURCETYPES -->
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_VIEW}</b></td>
<td align="right" class="line1" width="100%">
<select id="SourceViewID" name="SourceViewID" size="1">
<!-- BEGIN Views -->
<option {selected} value="{ID}">{DisplayName}</option>
<!-- END Views -->
</select>
</td>
</tr>
</table> </table>
<div id="HiddenDiskTypeOptions" class="HiddenContent"> <div id="HiddenDiskTypeOptions" class="HiddenContent">
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" align="center" class="with_border"> <table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" align="center" class="with_border">
<tr><td align="center" class="cellmenu1" colspan="2"><b>{LN_CFG_DISKTYPEOPTIONS}</b></td></tr> <tr><td align="center" class="cellmenu1" colspan="2"><b>{LN_CFG_DISKTYPEOPTIONS}</b></td></tr>
<tr> <tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_LOGLINETYPE}</b></td> <td align="left" class="cellmenu2" width="150" nowrap><b>{LN_CFG_LOGLINETYPE}</b></td>
<td align="right" class="line0" width="100%"> <td align="right" class="line0" width="100%">
<select name="SourceLogLineType" size="1"> <select name="SourceLogLineType" size="1">
<!-- BEGIN LOGLINETYPES --> <!-- BEGIN LOGLINETYPES -->
@ -297,12 +342,12 @@
<div id="HiddenDatabaseTypeOptions" class="HiddenContent"> <div id="HiddenDatabaseTypeOptions" class="HiddenContent">
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border"> <table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
<tr><td align="center" class="cellmenu1" colspan="2"><b>{LN_CFG_DATABASETYPEOPTIONS}</b></td></tr> <tr><td align="center" class="cellmenu1" colspan="2"><b>{LN_CFG_DATABASETYPEOPTIONS}</b></td></tr>
</table>
<div id="HiddenDBTYpesOptions" class="HiddenContent">
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
<tr> <tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBTABLETYPE}</b></td> <td align="left" class="cellmenu2" width="150" nowrap><b>{LN_CFG_DBSTORAGEENGINE}</b></td>
<td align="right" class="line0" width="100%"><input type="text" name="SourceDBTableType" size="40" maxlength="255" value="{SourceDBTableType}"></td>
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBSTORAGEENGINE}</b></td>
<td align="right" class="line1" width="100%"> <td align="right" class="line1" width="100%">
<select name="SourceDBType" size="1"> <select name="SourceDBType" size="1">
<!-- BEGIN DBTYPES --> <!-- BEGIN DBTYPES -->
@ -311,6 +356,14 @@
</select> </select>
</td> </td>
</tr> </tr>
</table>
</div>
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
<tr>
<td align="left" class="cellmenu2" width="150" nowrap><b>{LN_CFG_DBTABLETYPE}</b></td>
<td align="right" class="line0" width="100%"><input type="text" name="SourceDBTableType" size="40" maxlength="255" value="{SourceDBTableType}"></td>
</tr>
<tr> <tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBSERVER}</b></td> <td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBSERVER}</b></td>
<td align="right" class="line0" width="100%"><input type="text" name="SourceDBServer" size="40" maxlength="255" value="{SourceDBServer}"></td> <td align="right" class="line0" width="100%"><input type="text" name="SourceDBServer" size="40" maxlength="255" value="{SourceDBServer}"></td>
@ -331,6 +384,12 @@
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBPASSWORD}</b></td> <td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBPASSWORD}</b></td>
<td align="right" class="line0" width="100%"><input type="password" name="SourceDBPassword" size="40" maxlength="255" value="{SourceDBPassword}"></td> <td align="right" class="line0" width="100%"><input type="password" name="SourceDBPassword" size="40" maxlength="255" value="{SourceDBPassword}"></td>
</tr> </tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBROWCOUNTING}</b></td>
<td align="right" class="line1" width="100%">
<input type="radio" name="SourceDBEnableRowCounting" value="true" {SourceDBEnableRowCounting_true}> Yes <input type="radio" name="SourceDBEnableRowCounting" value="false" {SourceDBEnableRowCounting_false}> No
</td>
</tr>
</table> </table>
</div> </div>
@ -342,7 +401,7 @@
<script language="javascript"> <script language="javascript">
// Manually perform initial Javascript Calls // Manually perform initial Javascript Calls
toggleFormareaVisibility('SourceType', 'HiddenDiskTypeOptions', 'HiddenDatabaseTypeOptions'); toggleSourceTypeVisibility('SourceType');
</script> </script>
<!-- ENDIF INSTALL_STEP="7" --> <!-- ENDIF INSTALL_STEP="7" -->
@ -396,4 +455,4 @@
</td> </td>
</tr> </tr>
</table> </table>
<!-- INCLUDE include_footer.html --> <!-- INCLUDE include_footer.html -->

View File

@ -11,6 +11,9 @@
<br> <br>
<form action="" method="get" id="filterdateform" OnChange="CalculateSearchPreview('filterdateform', 'SearchCode');" onkeyup="CalculateSearchPreview('filterdateform', 'SearchCode');" > <form action="" method="get" id="filterdateform" OnChange="CalculateSearchPreview('filterdateform', 'SearchCode');" onkeyup="CalculateSearchPreview('filterdateform', 'SearchCode');" >
<!-- BEGIN HIDDENVARS_SOURCE -->
<input type="hidden" name="{varname}" value="{varvalue}">
<!-- END HIDDENVARS_SOURCE -->
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr> <tr>
<td width="50%" valign="top" class="table_with_border"> <td width="50%" valign="top" class="table_with_border">
@ -116,7 +119,7 @@
</tr> </tr>
<tr> <tr>
<td align="left" class="cellmenu2" width="50%" nowrap><b>{LN_FILTER_FACILITY}</b></td> <td align="left" class="cellmenu2" width="50%" nowrap><b>{LN_FILTER_FACILITY}</b></td>
<td align="right" class="line1" nowrap> <td align="left" class="line1" nowrap>
<select name="filter_facility[]" size="8" multiple> <select name="filter_facility[]" size="8" multiple>
<!-- BEGIN filter_facility_list --> <!-- BEGIN filter_facility_list -->
<option {selected} value="{ID}">{DisplayName}</option> <option {selected} value="{ID}">{DisplayName}</option>
@ -124,7 +127,7 @@
</select> </select>
</td> </td>
<td align="left" class="cellmenu2" width="50%" nowrap><b>{LN_FILTER_SEVERITY}</b></td> <td align="left" class="cellmenu2" width="50%" nowrap><b>{LN_FILTER_SEVERITY}</b></td>
<td align="right" class="line1" nowrap> <td align="left" class="line1" nowrap>
<select name="filter_severity[]" size="8" multiple> <select name="filter_severity[]" size="8" multiple>
<!-- BEGIN filter_severity_list --> <!-- BEGIN filter_severity_list -->
<option {selected} value="{ID}">{DisplayName}</option> <option {selected} value="{ID}">{DisplayName}</option>
@ -132,6 +135,16 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<td align="left" class="cellmenu2" width="50%" nowrap colspan="2"><b>{LN_FILTER_MESSAGETYPE}</b></td>
<td align="left" class="line0" nowrap colspan="2">
<select name="filter_messagetype[]" size="3" multiple>
<!-- BEGIN filter_messagetype_list -->
<option {selected} value="{ID}">{DisplayName}</option>
<!-- END filter_messagetype_list -->
</select>
</td>
</tr>
</table> </table>
</td> </td>
</tr> </tr>

View File

@ -63,6 +63,24 @@ A.title:hover
TEXT-DECORATION: none; TEXT-DECORATION: none;
} }
/* Context Link Classes */
a.contextlink:link,a.contextlink:active,a.contextlink:visited,a.contextlink
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
background-color: transparent;
color:#FF9900;
text-decoration:underline;
}
a.contextlink:hover
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
color:#FF9900;
text-decoration:none;
}
/*---*/
/* Default Font Classes */ /* Default Font Classes */
font font
{ {
@ -161,12 +179,12 @@ font
background-color: #1D3043; background-color: #1D3043;
} }
.lineColouredWhite .lineColouredWhite, .lineColouredWhite:hover, a.lineColouredWhite
{ {
font-size: 8pt; font-size: 8pt;
color: #FFFFFF; color: #FFFFFF;
} }
.lineColouredBlack .lineColouredBlack, .lineColouredBlack:hover, a.lineColouredBlack
{ {
font-size: 8pt; font-size: 8pt;
color: #000000; color: #000000;
@ -243,12 +261,12 @@ font
/* Cell Columns */ /* Cell Columns */
.cellmenu1 .cellmenu1
{ {
height: 15px; /* height: 15px; */
border:1px solid; border:1px solid;
border-color: #353A3F #050A0F #050A0F #353A3F; border-color: #353A3F #050A0F #050A0F #353A3F;
text-indent:5px; text-indent:5px;
font: 10px Verdana, Arial, Helvetica, sans-serif; font: bold 10px Verdana, Arial, Helvetica, sans-serif;
color: #FFFCE5; color: #FFFCE5;
background-color: #103B65; background-color: #103B65;
} }
@ -389,4 +407,10 @@ select, input, button, textarea
font:10px Verdana,Arial,Helvetica,sans-serif; font:10px Verdana,Arial,Helvetica,sans-serif;
border: 1px solid; border: 1px solid;
border-color: #233B51 #124A7C #124A7C #233B51; border-color: #233B51 #124A7C #124A7C #233B51;
} }
.highlighted
{
font: bold 8pt Arial,Helvetica,sans-serif;
color: #CC6600
}

View File

@ -32,6 +32,25 @@ a:hover
font-weight:bold; font-weight:bold;
color:#FF0000; color:#FF0000;
} }
/*---*/
/* Context Link Classes */
a.contextlink:link,a.contextlink:active,a.contextlink:visited,a.contextlink
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
background-color: transparent;
color:#3814BB;
text-decoration:underline;
}
a.contextlink:hover
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
color:#3844FF;
text-decoration:none;
}
/*---*/
img img
{ {
@ -123,6 +142,7 @@ font
/* Cells for listening */ /* Cells for listening */
.line0 .line0
{ {
/* height: 16px;*/
font-size: 8pt; font-size: 8pt;
color: #000000; color: #000000;
background-color: #DDDDDD; background-color: #DDDDDD;
@ -134,6 +154,7 @@ font
.line1 .line1
{ {
/* height: 16px;*/
font-size: 8pt; font-size: 8pt;
color: #000000; color: #000000;
background-color: #EEEEEE; background-color: #EEEEEE;
@ -145,6 +166,7 @@ font
.line2 .line2
{ {
/* height: 16px;*/
font-size: 8pt; font-size: 8pt;
color: #000000; color: #000000;
background-color: #F5F5F5; background-color: #F5F5F5;
@ -160,40 +182,12 @@ font
background-color: #F5F5F5; background-color: #F5F5F5;
} }
/* .lineColouredWhite, .lineColouredWhite:hover, a.lineColouredWhite
.line_alt0
{
font-size: 8pt;
color: #000000;
background-color: #AAAAAA;
background-image: url("images/dither.png");
}
.line_alt0:hover
{
background-color:#F9F9F9;
background-image: url("images/dither.png");
}
.line_alt1
{
font-size: 8pt;
color: #000000;
background-color: #DDDDDD;
background-image: url("images/dither.png");
}
.line_alt1:hover
{
background-color:#F9F9F9;
background-image: url("images/dither.png");
}
*/
.lineColouredWhite
{ {
font-size: 8pt; font-size: 8pt;
color: #FFFFFF; color: #FFFFFF;
} }
.lineColouredBlack .lineColouredBlack, .lineColouredBlack:hover, a.lineColouredBlack
{ {
font-size: 8pt; font-size: 8pt;
color: #000000; color: #000000;
@ -272,12 +266,12 @@ font
/* Cell Columns */ /* Cell Columns */
.cellmenu1 .cellmenu1
{ {
height: 16px; /* height: 16px; */
border:1px ridge; border:1px ridge;
border-color: #79AABE #09506C #09506C #79AABE; border-color: #79AABE #09506C #09506C #79AABE;
text-indent:5px; text-indent:5px;
font: 10px Verdana, Arial, Helvetica, sans-serif; font: bold 10px Verdana, Arial, Helvetica, sans-serif;
color: #FFFFFF; color: #FFFFFF;
background-color: #6C8E9C; background-color: #6C8E9C;
} }
@ -299,7 +293,7 @@ A.cellmenu1_link:hover
.cellmenu2 .cellmenu2
{ {
height: 15px; /* height: 15px; */
border:1px inset; border:1px inset;
border-color: #79AABE #09506C #09506C #79AABE; border-color: #79AABE #09506C #09506C #79AABE;
@ -418,4 +412,10 @@ select, input, button, textarea
font:10px Verdana,Arial,Helvetica,sans-serif; font:10px Verdana,Arial,Helvetica,sans-serif;
border: 1px solid; border: 1px solid;
border-color: #233B51 #124A7C #124A7C #233B51; border-color: #233B51 #124A7C #124A7C #233B51;
} }
.highlighted
{
font: bold 8pt Arial,Helvetica,sans-serif;
color: #BB0000
}

View File

@ -50,20 +50,53 @@ else
if ( isset($_GET['op']) ) if ( isset($_GET['op']) )
{ {
if ( $_GET['op'] == "changestyle" ) if ( $_GET['op'] == "changestyle" && isset($_GET['stylename']) )
{ {
if ( VerifyTheme($_GET['stylename']) ) if ( VerifyTheme($_GET['stylename']) )
$_SESSION['CUSTOM_THEME'] = $_GET['stylename']; $_SESSION['CUSTOM_THEME'] = $_GET['stylename'];
} }
if ( $_GET['op'] == "changelang" ) if ( $_GET['op'] == "changelang" && isset($_GET['langcode']) )
{ {
if ( VerifyLanguage($_GET['langcode']) ) if ( VerifyLanguage($_GET['langcode']) )
$_SESSION['CUSTOM_LANG'] = $_GET['langcode']; $_SESSION['CUSTOM_LANG'] = $_GET['langcode'];
} }
if ( $_GET['op'] == "changeview" && isset($_GET['viewid']) )
{
// Obtain VIEW ID!
$newViewID = $_GET['viewid'];
if ( isset($content['Views'][$newViewID]) && isset($_SESSION['currentSourceID']))
{
// Save new View into session!
$_SESSION[$_SESSION['currentSourceID'] . "-View"] = $newViewID;
}
else
{
// DEBUG
echo "DEBUG: " . $_SESSION['currentSourceID'] . " - $newViewID";
exit;
}
}
if ( $_GET['op'] == "changepagesize" && isset($_GET['pagesizeid']) )
{
if ( intval($_GET['pagesizeid']) >= 0 && intval($_GET['pagesizeid']) < count($content['pagesizes']) )
$_SESSION['PAGESIZE_ID'] = intval($_GET['pagesizeid']);
}
if ( $_GET['op'] == "autoreload" && isset($_GET['autoreloadtime']) )
{
if ( intval($_GET['autoreloadtime']) >= 0 && intval($_GET['autoreloadtime']) < count($content['reloadtimes']) )
$_SESSION['AUTORELOAD_ID'] = intval($_GET['autoreloadtime']);
}
} }
// Final redirect // Final redirect
RedirectPage( $szRedir ); RedirectPage( $szRedir );
// --- // ---
?> ?>