Merge branch 'beta' into devel

Conflicts:

	src/include/functions_common.php
This commit is contained in:
Andre Lorbach 2008-10-27 17:23:52 +01:00
commit 110d278aa7
35 changed files with 865 additions and 567 deletions

View File

@ -1,4 +1,33 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Version 2.5.16 (beta), 2008-10-27
- Fixed a problem when adding a mysql logstream source. Due a problem of
how php mysql_connect function handels second conenctions, the Verify
of a newly added logstream source could cause the first database
connection to be overwritten. The following error is, that the wrong
database was used for the UserDB after the new logstream was verified.
- Added a check into the redirect function to STOP redirecting if an
error happens in the UserDB.
- Fixed minor issues handling form input which happened when
magic_quotes_gpc was enabled.
- Fixed a bug in the convert.php script which inserted the wrong
database version number. This caused phpLogCon to force an database
upgrade which is not needed at all.
- Added dummy db update scripts, so the db upgrade script won't fail
in future. This is for the case when the db version is not correctly
or missing in the user database.
- Added support to filter for dynamic fields within the logstream
database sources. This was not possible yet. The filtering also has a
secure end timer, which avoids that the timelimit hits the script.
- Added support to suppress unparseable messages when using msgparsers.
This enhances useability if you have mixed data sources, and want to
filter out unparseable messages.
- Added new setting for MYSQL logstream sources to control the amount
of data per query. This value can be used to tweak the MYSQL
performance. For example when filtering for fields which are generated
by a message parser, highering the value does improve the database
performance. The default value is 100, and should only be changed if
you know what you are doing.
---------------------------------------------------------------------------
Version 2.5.15 (beta), 2008-10-22 Version 2.5.15 (beta), 2008-10-22
- Corrected the check for magic_quotes_gpc which is important when saving - Corrected the check for magic_quotes_gpc which is important when saving
configuration values are saved into the UserDB. This also fixes a configuration values are saved into the UserDB. This also fixes a

View File

@ -280,7 +280,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Do the final redirect // Do the final redirect
RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENADDED'], $content['Name'] ) , "charts.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENADDED'], DB_StripSlahes($content['Name']) ) , "charts.php" );
} }
else if ( $_POST['op'] == "editchart" ) else if ( $_POST['op'] == "editchart" )
{ {
@ -309,7 +309,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Done redirect! // Done redirect!
RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENEDIT'], $content['Name']) , "charts.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENEDIT'], DB_StripSlahes($content['Name']) ) , "charts.php" );
} }
} }
} }

View File

@ -249,7 +249,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Do the final redirect // Do the final redirect
RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENADDED'], $content['FieldCaption'] ) , "fields.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENADDED'], DB_StripSlahes($content['FieldCaption']) ) , "fields.php" );
} }
else else
{ {
@ -267,7 +267,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Done redirect! // Done redirect!
RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENEDIT'], $content['FieldCaption']) , "fields.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENEDIT'], DB_StripSlahes($content['FieldCaption']) ) , "fields.php" );
} }
} }
} }

View File

@ -322,7 +322,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Do the final redirect // Do the final redirect
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], $content['groupname'] ) , "groups.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], DB_StripSlahes($content['groupname']) ) , "groups.php" );
} }
} }
else if ( $_POST['op'] == "editgroup" ) else if ( $_POST['op'] == "editgroup" )
@ -344,7 +344,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Done redirect! // Done redirect!
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], $content['groupname']) , "groups.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], DB_StripSlahes($content['groupname']) ) , "groups.php" );
} }
} }
else if ( $_POST['op'] == "adduser" ) else if ( $_POST['op'] == "adduser" )

View File

@ -71,7 +71,7 @@ else
} }
if ( isset($_GET['msg']) ) if ( isset($_GET['msg']) )
$content['SZMSG'] = urldecode($_GET['msg']); $content['SZMSG'] = DB_StripSlahes($_GET['msg']);
else else
$content['SZMSG'] = $content["LN_ADMIN_UNKNOWNSTATE"]; $content['SZMSG'] = $content["LN_ADMIN_UNKNOWNSTATE"];

View File

@ -235,7 +235,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Do the final redirect // Do the final redirect
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], $content['DisplayName'] ) , "searches.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], DB_StripSlahes($content['DisplayName']) ) , "searches.php" );
} }
else if ( $_POST['op'] == "editsearch" ) else if ( $_POST['op'] == "editsearch" )
{ {
@ -258,7 +258,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Done redirect! // Done redirect!
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENEDIT'], $content['DisplayName']) , "searches.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENEDIT'], DB_StripSlahes($content['DisplayName']) ) , "searches.php" );
} }
} }
} }

View File

@ -70,7 +70,9 @@ if ( isset($_GET['op']) )
CreateSourceTypesList($content['SourceType']); CreateSourceTypesList($content['SourceType']);
$content['MsgParserList'] = ""; $content['MsgParserList'] = "";
$content['MsgNormalize'] = 0; $content['MsgNormalize'] = 0;
$content['MsgSkipUnparseable'] = 0;
$content['CHECKED_ISNORMALIZEMSG'] = ""; $content['CHECKED_ISNORMALIZEMSG'] = "";
$content['CHECKED_ISSKIPUNPARSEABLE'] = "";
// Init View List! // Init View List!
$content['SourceViewID'] = 'SYSLOG'; $content['SourceViewID'] = 'SYSLOG';
@ -100,6 +102,7 @@ if ( isset($_GET['op']) )
$content['SourceDBEnableRowCounting'] = "false"; $content['SourceDBEnableRowCounting'] = "false";
$content['SourceDBEnableRowCounting_true'] = ""; $content['SourceDBEnableRowCounting_true'] = "";
$content['SourceDBEnableRowCounting_false'] = "checked"; $content['SourceDBEnableRowCounting_false'] = "checked";
$content['SourceDBRecordsPerQuery'] = "100";
// General stuff // General stuff
$content['userid'] = null; $content['userid'] = null;
@ -143,6 +146,13 @@ if ( isset($_GET['op']) )
else else
$content['CHECKED_ISNORMALIZEMSG'] = ""; $content['CHECKED_ISNORMALIZEMSG'] = "";
$content['MsgSkipUnparseable'] = $mysource['MsgSkipUnparseable'];
if ( $mysource['MsgSkipUnparseable'] == 1 )
$content['CHECKED_ISSKIPUNPARSEABLE'] = "checked";
else
$content['CHECKED_ISSKIPUNPARSEABLE'] = "";
// Init View List! // Init View List!
$content['SourceViewID'] = $mysource['ViewID']; $content['SourceViewID'] = $mysource['ViewID'];
$content['VIEWS'] = $content['Views']; $content['VIEWS'] = $content['Views'];
@ -179,6 +189,8 @@ if ( isset($_GET['op']) )
$content['SourceDBEnableRowCounting_true'] = ""; $content['SourceDBEnableRowCounting_true'] = "";
$content['SourceDBEnableRowCounting_false'] = "checked"; $content['SourceDBEnableRowCounting_false'] = "checked";
} }
$content['SourceDBRecordsPerQuery'] = $mysource['DBRecordsPerQuery'];
if ( $mysource['userid'] != null ) if ( $mysource['userid'] != null )
$content['CHECKED_ISUSERONLY'] = "checked"; $content['CHECKED_ISUSERONLY'] = "checked";
@ -273,6 +285,7 @@ if ( isset($_POST['op']) )
if ( isset($_POST['SourceType']) ) { $content['SourceType'] = DB_RemoveBadChars($_POST['SourceType']); } if ( isset($_POST['SourceType']) ) { $content['SourceType'] = DB_RemoveBadChars($_POST['SourceType']); }
if ( isset($_POST['MsgParserList']) ) { $content['MsgParserList'] = DB_RemoveBadChars($_POST['MsgParserList']); } if ( isset($_POST['MsgParserList']) ) { $content['MsgParserList'] = DB_RemoveBadChars($_POST['MsgParserList']); }
if ( isset($_POST['MsgNormalize']) ) { $content['MsgNormalize'] = intval(DB_RemoveBadChars($_POST['MsgNormalize'])); } else {$content['MsgNormalize'] = 0; } if ( isset($_POST['MsgNormalize']) ) { $content['MsgNormalize'] = intval(DB_RemoveBadChars($_POST['MsgNormalize'])); } else {$content['MsgNormalize'] = 0; }
if ( isset($_POST['MsgSkipUnparseable']) ) { $content['MsgSkipUnparseable'] = intval(DB_RemoveBadChars($_POST['MsgSkipUnparseable'])); } else {$content['MsgSkipUnparseable'] = 0; }
if ( isset($_POST['SourceViewID']) ) { $content['SourceViewID'] = DB_RemoveBadChars($_POST['SourceViewID']); } if ( isset($_POST['SourceViewID']) ) { $content['SourceViewID'] = DB_RemoveBadChars($_POST['SourceViewID']); }
if ( isset($content['SourceType']) ) if ( isset($content['SourceType']) )
@ -292,6 +305,7 @@ if ( isset($_POST['op']) )
if ( isset($_POST['SourceDBServer']) ) { $content['SourceDBServer'] = DB_RemoveBadChars($_POST['SourceDBServer']); } if ( isset($_POST['SourceDBServer']) ) { $content['SourceDBServer'] = DB_RemoveBadChars($_POST['SourceDBServer']); }
if ( isset($_POST['SourceDBTableName']) ) { $content['SourceDBTableName'] = DB_RemoveBadChars($_POST['SourceDBTableName']); } if ( isset($_POST['SourceDBTableName']) ) { $content['SourceDBTableName'] = DB_RemoveBadChars($_POST['SourceDBTableName']); }
if ( isset($_POST['SourceDBUser']) ) { $content['SourceDBUser'] = DB_RemoveBadChars($_POST['SourceDBUser']); } if ( isset($_POST['SourceDBUser']) ) { $content['SourceDBUser'] = DB_RemoveBadChars($_POST['SourceDBUser']); }
if ( isset($_POST['SourceDBRecordsPerQuery']) ) { $content['SourceDBRecordsPerQuery'] = DB_RemoveBadChars($_POST['SourceDBRecordsPerQuery']); }
if ( isset($_POST['SourceDBPassword']) ) { $content['SourceDBPassword'] = DB_RemoveBadChars($_POST['SourceDBPassword']); } else {$content['SourceDBPassword'] = ""; } if ( isset($_POST['SourceDBPassword']) ) { $content['SourceDBPassword'] = DB_RemoveBadChars($_POST['SourceDBPassword']); } else {$content['SourceDBPassword'] = ""; }
if ( isset($_POST['SourceDBEnableRowCounting']) ) { $content['SourceDBEnableRowCounting'] = DB_RemoveBadChars($_POST['SourceDBEnableRowCounting']); } if ( isset($_POST['SourceDBEnableRowCounting']) ) { $content['SourceDBEnableRowCounting'] = DB_RemoveBadChars($_POST['SourceDBEnableRowCounting']); }
// Extra Check for this property // Extra Check for this property
@ -407,6 +421,11 @@ if ( isset($_POST['op']) )
$content['ISERROR'] = true; $content['ISERROR'] = true;
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBUSER'] ); $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBUSER'] );
} }
else if ( !is_numeric($content['SourceDBRecordsPerQuery']) )
{
$content['ISERROR'] = true;
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_INVALIDVALUE'], $content['LN_CFG_DBRECORDSPERQUERY'] );
}
} }
else else
{ {
@ -420,13 +439,14 @@ if ( isset($_POST['op']) )
include($gl_root_path . 'classes/logstream.class.php'); include($gl_root_path . 'classes/logstream.class.php');
// First create a tmp source array // First create a tmp source array
$tmpSource['ID'] = $content['SOURCEID']; $tmpSource['ID'] = $content['SOURCEID'];
$tmpSource['Name'] = $content['Name']; $tmpSource['Name'] = $content['Name'];
$tmpSource['Description'] = $content['Description']; $tmpSource['Description'] = $content['Description'];
$tmpSource['SourceType'] = $content['SourceType']; $tmpSource['SourceType'] = $content['SourceType'];
$tmpSource['MsgParserList'] = $content['MsgParserList']; $tmpSource['MsgParserList'] = $content['MsgParserList'];
$tmpSource['MsgNormalize'] = $content['MsgNormalize']; $tmpSource['MsgNormalize'] = $content['MsgNormalize'];
$tmpSource['ViewID'] = $content['SourceViewID']; $tmpSource['MsgSkipUnparseable']= $content['MsgSkipUnparseable'];
$tmpSource['ViewID'] = $content['SourceViewID'];
if ( $tmpSource['SourceType'] == SOURCE_DISK ) if ( $tmpSource['SourceType'] == SOURCE_DISK )
{ {
$tmpSource['LogLineType'] = $content['SourceLogLineType']; $tmpSource['LogLineType'] = $content['SourceLogLineType'];
@ -442,7 +462,8 @@ if ( isset($_POST['op']) )
$tmpSource['DBTableName'] = $content['SourceDBTableName']; $tmpSource['DBTableName'] = $content['SourceDBTableName'];
$tmpSource['DBUser'] = $content['SourceDBUser']; $tmpSource['DBUser'] = $content['SourceDBUser'];
$tmpSource['DBPassword'] = $content['SourceDBPassword']; $tmpSource['DBPassword'] = $content['SourceDBPassword'];
$tmpSource['DBEnableRowCounting'] = $content['SourceDBEnableRowCounting']; $tmpSource['DBEnableRowCounting'] = $content['SourceDBEnableRowCounting'];
$tmpSource['DBRecordsPerQuery'] = $content['SourceDBRecordsPerQuery'];
$tmpSource['userid'] = $content['userid']; $tmpSource['userid'] = $content['userid'];
$tmpSource['groupid'] = $content['groupid']; $tmpSource['groupid'] = $content['groupid'];
} }
@ -473,12 +494,13 @@ if ( isset($_POST['op']) )
// Add custom search now! // Add custom search now!
if ( $content['SourceType'] == SOURCE_DISK ) if ( $content['SourceType'] == SOURCE_DISK )
{ {
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, ViewID, LogLineType, DiskFile, userid, groupid) $sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, MsgSkipUnparseable, ViewID, LogLineType, DiskFile, userid, groupid)
VALUES ('" . $content['Name'] . "', VALUES ('" . $content['Name'] . "',
'" . $content['Description'] . "', '" . $content['Description'] . "',
" . $content['SourceType'] . ", " . $content['SourceType'] . ",
'" . $content['MsgParserList'] . "', '" . $content['MsgParserList'] . "',
" . $content['MsgNormalize'] . ", " . $content['MsgNormalize'] . ",
" . $content['MsgSkipUnparseable'] . ",
'" . $content['SourceViewID'] . "', '" . $content['SourceViewID'] . "',
'" . $content['SourceLogLineType'] . "', '" . $content['SourceLogLineType'] . "',
'" . $content['SourceDiskFile'] . "', '" . $content['SourceDiskFile'] . "',
@ -488,12 +510,13 @@ if ( isset($_POST['op']) )
} }
else if ( $content['SourceType'] == SOURCE_DB || $content['SourceType'] == SOURCE_PDO ) else if ( $content['SourceType'] == SOURCE_DB || $content['SourceType'] == SOURCE_PDO )
{ {
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, ViewID, DBTableType, DBType, DBServer, DBName, DBUser, DBPassword, DBTableName, DBEnableRowCounting, userid, groupid) $sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, MsgSkipUnparseable, ViewID, DBTableType, DBType, DBServer, DBName, DBUser, DBPassword, DBTableName, DBEnableRowCounting, SourceDBRecordsPerQuery, userid, groupid)
VALUES ('" . $content['Name'] . "', VALUES ('" . $content['Name'] . "',
'" . $content['Description'] . "', '" . $content['Description'] . "',
" . $content['SourceType'] . ", " . $content['SourceType'] . ",
'" . $content['MsgParserList'] . "', '" . $content['MsgParserList'] . "',
" . $content['MsgNormalize'] . ", " . $content['MsgNormalize'] . ",
" . $content['MsgSkipUnparseable'] . ",
'" . $content['SourceViewID'] . "', '" . $content['SourceViewID'] . "',
'" . $content['SourceDBTableType'] . "', '" . $content['SourceDBTableType'] . "',
" . $content['SourceDBType'] . ", " . $content['SourceDBType'] . ",
@ -503,6 +526,7 @@ if ( isset($_POST['op']) )
'" . $content['SourceDBPassword'] . "', '" . $content['SourceDBPassword'] . "',
'" . $content['SourceDBTableName'] . "', '" . $content['SourceDBTableName'] . "',
" . $content['SourceDBEnableRowCounting'] . ", " . $content['SourceDBEnableRowCounting'] . ",
" . $content['SourceDBRecordsPerQuery'] . ",
" . $content['userid'] . ", " . $content['userid'] . ",
" . $content['groupid'] . " " . $content['groupid'] . "
)"; )";
@ -512,7 +536,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Do the final redirect // Do the final redirect
RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCE_HASBEENADDED'], $content['Name'] ) , "sources.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCE_HASBEENADDED'], DB_StripSlahes($content['Name']) ) , "sources.php" );
} }
else if ( $_POST['op'] == "editsource" ) else if ( $_POST['op'] == "editsource" )
{ {
@ -534,6 +558,7 @@ if ( isset($_POST['op']) )
SourceType = " . $content['SourceType'] . ", SourceType = " . $content['SourceType'] . ",
MsgParserList = '" . $content['MsgParserList'] . "', MsgParserList = '" . $content['MsgParserList'] . "',
MsgNormalize = " . $content['MsgNormalize'] . ", MsgNormalize = " . $content['MsgNormalize'] . ",
MsgSkipUnparseable = " . $content['MsgSkipUnparseable'] . ",
ViewID = '" . $content['SourceViewID'] . "', ViewID = '" . $content['SourceViewID'] . "',
LogLineType = '" . $content['SourceLogLineType'] . "', LogLineType = '" . $content['SourceLogLineType'] . "',
DiskFile = '" . $content['SourceDiskFile'] . "', DiskFile = '" . $content['SourceDiskFile'] . "',
@ -549,6 +574,7 @@ if ( isset($_POST['op']) )
SourceType = " . $content['SourceType'] . ", SourceType = " . $content['SourceType'] . ",
MsgParserList = '" . $content['MsgParserList'] . "', MsgParserList = '" . $content['MsgParserList'] . "',
MsgNormalize = " . $content['MsgNormalize'] . ", MsgNormalize = " . $content['MsgNormalize'] . ",
MsgSkipUnparseable = " . $content['MsgSkipUnparseable'] . ",
ViewID = '" . $content['SourceViewID'] . "', ViewID = '" . $content['SourceViewID'] . "',
DBTableType = '" . $content['SourceDBTableType'] . "', DBTableType = '" . $content['SourceDBTableType'] . "',
DBType = " . $content['SourceDBType'] . ", DBType = " . $content['SourceDBType'] . ",
@ -558,6 +584,7 @@ if ( isset($_POST['op']) )
DBPassword = '" . $content['SourceDBPassword'] . "', DBPassword = '" . $content['SourceDBPassword'] . "',
DBTableName = '" . $content['SourceDBTableName'] . "', DBTableName = '" . $content['SourceDBTableName'] . "',
DBEnableRowCounting = " . $content['SourceDBEnableRowCounting'] . ", DBEnableRowCounting = " . $content['SourceDBEnableRowCounting'] . ",
DBRecordsPerQuery = " . $content['SourceDBRecordsPerQuery'] . ",
userid = " . $content['userid'] . ", userid = " . $content['userid'] . ",
groupid = " . $content['groupid'] . " groupid = " . $content['groupid'] . "
WHERE ID = " . $content['SOURCEID']; WHERE ID = " . $content['SOURCEID'];
@ -567,7 +594,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Done redirect! // Done redirect!
RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCES_HASBEENEDIT'], $content['Name']) , "sources.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCES_HASBEENEDIT'], DB_StripSlahes($content['Name']) ) , "sources.php" );
} }
} }
} }

View File

@ -272,7 +272,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Do the final redirect // Do the final redirect
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], $content['USERNAME'] ) , "users.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], DB_StripSlahes($content['USERNAME']) ) , "users.php" );
} }
} }
} }
@ -322,7 +322,7 @@ if ( isset($_POST['op']) )
} }
// Done redirect! // Done redirect!
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], $content['USERNAME']) , "users.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], DB_StripSlahes($content['USERNAME']) ) , "users.php" );
} }
} }
} }

View File

@ -275,7 +275,7 @@ if ( isset($content['ISEDITORNEWVIEW']) && $content['ISEDITORNEWVIEW'] )
if ( isset($_POST['op']) ) if ( isset($_POST['op']) )
{ {
if ( isset ($_POST['id']) ) { $content['VIEWID'] = DB_RemoveBadChars($_POST['id']); } else {$content['VIEWID'] = ""; } if ( isset ($_POST['id']) ) { $content['VIEWID'] = DB_RemoveBadChars($_POST['id']); } else {$content['VIEWID'] = ""; }
if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']); } else {$content['DisplayName'] = ""; } if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_StripSlahes($_POST['DisplayName']); } else {$content['DisplayName'] = ""; }
// User & Group handeled specially // User & Group handeled specially
if ( isset ($_POST['isuseronly']) ) if ( isset ($_POST['isuseronly']) )
@ -316,6 +316,9 @@ if ( isset($_POST['op']) )
// Add New entry into columnlist // Add New entry into columnlist
$content['SUBCOLUMNS'][$szColId]['ColFieldID'] = $szColId; $content['SUBCOLUMNS'][$szColId]['ColFieldID'] = $szColId;
// Set Internal FieldID
$content['SUBCOLUMNS'][$szColId]['ColInternalID'] = $fields[$szColId]['FieldDefine'];
// Set Fieldcaption // Set Fieldcaption
if ( isset($fields[$szColId]['FieldCaption']) ) if ( isset($fields[$szColId]['FieldCaption']) )
$content['SUBCOLUMNS'][$szColId]['ColCaption'] = $fields[$szColId]['FieldCaption']; $content['SUBCOLUMNS'][$szColId]['ColCaption'] = $fields[$szColId]['FieldCaption'];
@ -411,6 +414,9 @@ if ( isset($_POST['op']) )
} }
else // Now SUBOP means normal processing! else // Now SUBOP means normal processing!
{ {
// Now we convert fr DB insert!
$content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']);
// Everything was alright, so we go to the next step! // Everything was alright, so we go to the next step!
if ( $_POST['op'] == "addnewview" ) if ( $_POST['op'] == "addnewview" )
{ {
@ -437,7 +443,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Do the final redirect // Do the final redirect
RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENADDED'], $content['DisplayName'] ) , "views.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENADDED'], DB_StripSlahes($content['DisplayName']) ) , "views.php" );
} }
else else
{ {
@ -447,6 +453,9 @@ if ( isset($_POST['op']) )
} }
else if ( $_POST['op'] == "editview" ) else if ( $_POST['op'] == "editview" )
{ {
// Now we convert fr DB insert!
$content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']);
$result = DB_Query("SELECT ID FROM " . DB_VIEWS . " WHERE ID = " . $content['VIEWID']); $result = DB_Query("SELECT ID FROM " . DB_VIEWS . " WHERE ID = " . $content['VIEWID']);
$myrow = DB_GetSingleRow($result, true); $myrow = DB_GetSingleRow($result, true);
if ( !isset($myrow['ID']) ) if ( !isset($myrow['ID']) )
@ -480,7 +489,7 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result); DB_FreeQuery($result);
// Done redirect! // Done redirect!
RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENEDIT'], $content['DisplayName']) , "views.php" ); RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENEDIT'], DB_StripSlahes($content['DisplayName']) ) , "views.php" );
} }
else else
{ {

View File

@ -258,6 +258,219 @@ abstract class LogStream {
$this->_sortOrder = $newSortOrder; $this->_sortOrder = $newSortOrder;
return SUCCESS; return SUCCESS;
} }
/**
* Implementation of ApplyFilters which can be used by all LogStream Classes!
* This function performs a check on the filters and actually triggers the
* syslog parsers as well.
*/
public function ApplyFilters($myResults, &$arrProperitesOut)
{
// IF result was unsuccessfull, return success - nothing we can do here.
if ( $myResults >= ERROR )
return SUCCESS;
// Process all filters
if ( $this->_filters != null )
{
// Evaluation default for now is true
$bEval = true;
// Loop through set properties
foreach( $arrProperitesOut as $propertyname => $propertyvalue )
{
// TODO: NOT SURE IF THIS WILL WORK ON NUMBERS AND OTHER TYPES RIGHT NOW
if (
array_key_exists($propertyname, $this->_filters) &&
isset($propertyvalue) /* &&
!(is_string($propertyvalue) && strlen($propertyvalue) <= 0) /* Negative because it only matters if the propvalure is a string*/
)
{
// Extra var needed for number checks!
$bIsOrFilter = false; // If enabled we need to check for numbereval later
$bOrFilter = false;
// Found something to filter, so do it!
foreach( $this->_filters[$propertyname] as $myfilter )
{
switch( $myfilter[FILTER_TYPE] )
{
case FILTER_TYPE_STRING:
// Only filter if value is non zero
if ( strlen($propertyvalue) > 0 && strlen($myfilter[FILTER_VALUE]) > 0 )
{
// If Syslog message, we have AND handling!
if ( $propertyname == SYSLOG_MESSAGE )
{
// Include Filter
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
{
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
$bEval = false;
}
// Exclude Filter
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
{
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
$bEval = false;
}
}
// Otherwise we use OR Handling!
else
{
// Include Filter
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
{
// Set isOrFilter to true in this case
$bIsOrFilter = true;
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
{
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
$bOrFilter = true;
}
else
{
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
$bOrFilter = true;
}
}
// Exclude Filter - handeled with AND filtering!
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
{
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
{
// if ( strtolower($propertyvalue) != strtolower($myfilter[FILTER_VALUE]) )
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
$bEval = false;
}
else
{
// if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
$bEval = false;
}
}
break;
}
}
else
{
// Either filter value or property value was empty!
// This means we have no match
$bEval = false;
}
break;
case FILTER_TYPE_NUMBER:
$bIsOrFilter = true; // Default is set to TRUE
if ( is_numeric($arrProperitesOut[$propertyname]) )
{
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
{
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
$bOrFilter = true;
else
$bOrFilter = false;
}
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
{
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
$bOrFilter = false;
else
$bOrFilter = true;
}
}
else
{
// If wanted, we treat this filter as a success!
if ( GetConfigSetting("TreatNotFoundFiltersAsTrue", 0, CFGLEVEL_USER) == 1 )
$bOrFilter = true;
else
$bOrFilter = false;
}
break;
case FILTER_TYPE_DATE:
// Get Log TimeStamp
$nLogTimeStamp = $arrProperitesOut[$propertyname][EVTIME_TIMESTAMP];
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
{
// Get current timestamp
$nNowTimeStamp = time();
if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
$nLastXTime = 60 * 60; // One Hour!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_12HOURS )
$nLastXTime = 60 * 60 * 12; // 12 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_24HOURS )
$nLastXTime = 60 * 60 * 24; // 24 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_7DAYS )
$nLastXTime = 60 * 60 * 24 * 7; // 7 days
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_31DAYS )
$nLastXTime = 60 * 60 * 24 * 31; // 31 days
else
// WTF default?
$nLastXTime = 86400;
// If Nowtime + LastX is higher then the log timestamp, the this logline is to old for us.
if ( ($nNowTimeStamp - $nLastXTime) > $nLogTimeStamp )
$bEval = false;
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_FROM )
{
// Get filter timestamp!
$nFromTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
// If logtime is smaller then FromTime, then the Event is outside of our scope!
if ( $nLogTimeStamp < $nFromTimeStamp )
$bEval = false;
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_TO )
{
// Get filter timestamp!
// echo $myfilter[FILTER_VALUE];
$nToTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
// If logtime is smaller then FromTime, then the Event is outside of our scope!
if ( $nLogTimeStamp > $nToTimeStamp )
$bEval = false;
}
break;
default:
// TODO!
break;
}
}
// If was number filter, we apply it the evaluation.
if ( $bIsOrFilter )
$bEval &= $bOrFilter;
if ( !$bEval )
{
// unmatching filter, reset property array
foreach ( $this->_arrProperties as $property )
$arrProperitesOut[$property] = '';
// return error!
return ERROR_FILTER_NOT_MATCH;
}
}
}
// Reached this point means filters did match!
return SUCCESS;
}
else // No filters at all means success!
return SUCCESS;
}
/*
* --- PIRVATE HELPERS!
*/
/** /**
* Helper function to parse filters into a useful filter array we can work with. * Helper function to parse filters into a useful filter array we can work with.
@ -815,7 +1028,8 @@ abstract class LogStream {
// reached here means we failed to convert the facility! // reached here means we failed to convert the facility!
return -1; return -1;
} }
} }
?> ?>

View File

@ -53,7 +53,8 @@ abstract class LogStreamConfig {
protected $_msgParserList = null; // Contains a string list of configure msg parsers protected $_msgParserList = null; // Contains a string list of configure msg parsers
protected $_msgParserObjList = null; // Contains an object reference list to the msg parsers protected $_msgParserObjList = null; // Contains an object reference list to the msg parsers
protected $_MsgNormalize = 0; // If set to one, the msg will be reconstructed if successfully parsed before protected $_MsgNormalize = 0; // If set to one, the msg will be reconstructed if successfully parsed before
public $_SkipUnparseable = 0; // If set to one, all unparseable message will be ignored! This of course only applies if a msg parser is used
// Constructor prototype // Constructor prototype
public abstract function LogStreamFactory($o); public abstract function LogStreamFactory($o);
@ -79,6 +80,17 @@ abstract class LogStreamConfig {
} }
} }
/*
* Helper function to init Parserlist
*/
public function SetSkipUnparseable( $nNewVal )
{
if ( $nNewVal == 0 )
$this->_SkipUnparseable = 0;
else
$this->_SkipUnparseable = 1;
}
/* /*
* Helper function to init Parserlist * Helper function to init Parserlist
*/ */
@ -147,6 +159,10 @@ abstract class LogStreamConfig {
$ret = $myMsgParser->ParseMsg($szMsg, $arrArguments); $ret = $myMsgParser->ParseMsg($szMsg, $arrArguments);
if ( $ret == SUCCESS || $ret == ERROR_MSG_SKIPMESSAGE ) if ( $ret == SUCCESS || $ret == ERROR_MSG_SKIPMESSAGE )
return $ret; return $ret;
// Extra check, if user wants to, we SKIP the message!
if ( $this->_SkipUnparseable == 1 && $ret == ERROR_MSG_NOMATCH )
return ERROR_MSG_SKIPMESSAGE;
} }
} }

View File

@ -118,7 +118,8 @@ class LogStreamDB extends LogStream {
*/ */
public function Close() public function Close()
{ {
mysql_close($this->_dbhandle); if ($this->_dbhandle)
mysql_close($this->_dbhandle);
return SUCCESS; return SUCCESS;
} }
@ -131,7 +132,8 @@ class LogStreamDB extends LogStream {
// Try to connect to the database // Try to connect to the database
if ( $this->_dbhandle == null ) if ( $this->_dbhandle == null )
{ {
$this->_dbhandle = @mysql_connect($this->_logStreamConfigObj->DBServer,$this->_logStreamConfigObj->DBUser,$this->_logStreamConfigObj->DBPassword); // Forces to open a new link in all cases!
$this->_dbhandle = @mysql_connect($this->_logStreamConfigObj->DBServer,$this->_logStreamConfigObj->DBUser,$this->_logStreamConfigObj->DBPassword, true);
if (!$this->_dbhandle) if (!$this->_dbhandle)
{ {
if ( isset($php_errormsg) ) if ( isset($php_errormsg) )
@ -208,67 +210,93 @@ class LogStreamDB extends LogStream {
public function ReadNext(&$uID, &$arrProperitesOut, $bParseMessage = true) public function ReadNext(&$uID, &$arrProperitesOut, $bParseMessage = true)
{ {
// Helpers needed for DB Mapping // Helpers needed for DB Mapping
global $content, $gl_starttime;
global $dbmapping, $fields; global $dbmapping, $fields;
$szTableType = $this->_logStreamConfigObj->DBTableType; $szTableType = $this->_logStreamConfigObj->DBTableType;
// define $ret // define $ret
$ret = SUCCESS; $ret = SUCCESS;
// No buffer? then read from DB! do
if ( $this->bufferedRecords == null )
$ret = $this->ReadNextRecordsFromDB($uID);
else
{ {
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) ) // No buffer? then read from DB!
{ if ( $this->bufferedRecords == null )
// 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); $ret = $this->ReadNextRecordsFromDB($uID);
else
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($this->bufferedRecords[$this->_currentRecordNum] ) )
if ( isset($dbmapping[$szTableType][$property]) )
{ {
// Copy property if available! // We need to load new records, so clear the old ones first!
$dbfieldname = $dbmapping[$szTableType][$property]; $this->ResetBufferedRecords();
if ( isset($this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]) )
// Set new Record start, will be used in the SQL Statement!
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
// Now read new ones
$ret = $this->ReadNextRecordsFromDB($uID);
// Check if we found more records
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]) )
{ {
if ( isset($fields[$property]['FieldType']) && $fields[$property]['FieldType'] == FILTER_TYPE_DATE ) // Handle as date! // Copy property if available!
$arrProperitesOut[$property] = GetEventTime( $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname] ); $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 else
$arrProperitesOut[$property] = $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]; $arrProperitesOut[$property] = '';
} }
else else
$arrProperitesOut[$property] = ''; $arrProperitesOut[$property] = '';
} }
else
$arrProperitesOut[$property] = ''; // Run optional Message Parsers now
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) )
{
$retParser = $this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut);
// Check if we have to skip the message!
if ( $retParser == ERROR_MSG_SKIPMESSAGE )
$ret = $retParser;
}
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum;
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]];
// Increment $_currentRecordNum
$this->_currentRecordNum++;
} }
// Run optional Message Parsers now // Check how long we are running. If only two seconds of execution time are left, we abort further reading!
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) ) $scriptruntime = intval(microtime_float() - $gl_starttime);
$this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut); if ( $scriptruntime > ($content['MaxExecutionTime']-2) )
{
// This may display a warning message, so the user knows we stopped reading records because of the script timeout.
$content['logstream_warning'] = "false";
$content['logstream_warning_details'] = $content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'];
$content['logstream_warning_code'] = ERROR_FILE_NOMORETIME;
// Return error code
return ERROR_FILE_NOMORETIME;
}
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum; // This additional filter check will take care on dynamic fields from the message parser!
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]]; } while ( $this->ApplyFilters($ret, $arrProperitesOut) != SUCCESS && $ret == SUCCESS );
// Increment $_currentRecordNum
$this->_currentRecordNum++;
}
// reached here means return result! // reached here means return result!
return $ret; return $ret;
@ -320,24 +348,33 @@ class LogStreamDB extends LogStream {
while( $bFound == false && $this->ReadNextIDsFromDB() == SUCCESS ) while( $bFound == false && $this->ReadNextIDsFromDB() == SUCCESS )
{ {
foreach ( $this->bufferedRecords as $myRecord ) if ( isset($this->bufferedRecords) )
{ {
if ( $myRecord[$uidfieldname] == $uID ) foreach ( $this->bufferedRecords as $myRecord )
{ {
$bFound = true; if ( $myRecord[$uidfieldname] == $uID )
$ret = SUCCESS; {
break; // Break foreach loop! $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++;
} }
else }
{ else
$tmpuID = $myRecord[$uidfieldname]; {
// Only Increment $_currentRecordNum // Return error code in this case!
$this->_currentRecordNum++; $this->ResetBufferedRecords();
} $ret = ERROR_NOMORERECORDS;
// Increment our Pagenumber if needed!
if ( $this->_currentRecordNum % $this->_logStreamConfigObj->_pageCount == 0 )
$this->_currentPageNumber++;
} }
if ( $this->_currentPageNumber > 1 && $this->_readDirection == EnumReadDirection::Forward) if ( $this->_currentPageNumber > 1 && $this->_readDirection == EnumReadDirection::Forward)
@ -841,7 +878,7 @@ class LogStreamDB extends LogStream {
// Get SQL Statement // Get SQL Statement
$szSql = $this->CreateSQLStatement($uID); $szSql = $this->CreateSQLStatement($uID);
// Append LIMIT clause // Append LIMIT clause
$szSql .= " LIMIT " . $this->_currentRecordStart . ", " . $this->_logStreamConfigObj->RecordsPerQuery; $szSql .= " LIMIT " . $this->_currentRecordStart . ", " . $this->_logStreamConfigObj->RecordsPerQuery;
//echo $szSql . "<br>"; //echo $szSql . "<br>";

View File

@ -247,7 +247,7 @@ class LogStreamDisk extends LogStream {
// Check if we have to skip the message! // Check if we have to skip the message!
if ( $retParser == ERROR_MSG_SKIPMESSAGE ) if ( $retParser == ERROR_MSG_SKIPMESSAGE )
$ret = $retParser; $ret = $retParser;
// Set uID to the PropertiesOut! // Set uID to the PropertiesOut!
$arrProperitesOut[SYSLOG_UID] = $uID; $arrProperitesOut[SYSLOG_UID] = $uID;
} }
@ -699,215 +699,5 @@ class LogStreamDisk extends LogStream {
$this->_p_buffer = -1; $this->_p_buffer = -1;
} }
/**
* Implementation of ApplyFilters in the LogSTreamDisk Class.
* This function performs a check on the filters and actually triggers the
* syslog parsers as well.
*/
protected function ApplyFilters($myResults, &$arrProperitesOut)
{
// IF result was unsuccessfull, return success - nothing we can do here.
if ( $myResults >= ERROR )
return SUCCESS;
// Process all filters
if ( $this->_filters != null )
{
// Evaluation default for now is true
$bEval = true;
// Loop through set properties
foreach( $arrProperitesOut as $propertyname => $propertyvalue )
{
// TODO: NOT SURE IF THIS WILL WORK ON NUMBERS AND OTHER TYPES RIGHT NOW
if (
array_key_exists($propertyname, $this->_filters) &&
isset($propertyvalue) /* &&
!(is_string($propertyvalue) && strlen($propertyvalue) <= 0) /* Negative because it only matters if the propvalure is a string*/
)
{
// Extra var needed for number checks!
$bIsOrFilter = false; // If enabled we need to check for numbereval later
$bOrFilter = false;
// Found something to filter, so do it!
foreach( $this->_filters[$propertyname] as $myfilter )
{
switch( $myfilter[FILTER_TYPE] )
{
case FILTER_TYPE_STRING:
// Only filter if value is non zero
if ( strlen($propertyvalue) > 0 && strlen($myfilter[FILTER_VALUE]) > 0 )
{
// If Syslog message, we have AND handling!
if ( $propertyname == SYSLOG_MESSAGE )
{
// Include Filter
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
{
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
$bEval = false;
}
// Exclude Filter
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
{
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
$bEval = false;
}
}
// Otherwise we use OR Handling!
else
{
// Include Filter
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
{
// Set isOrFilter to true in this case
$bIsOrFilter = true;
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
{
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
$bOrFilter = true;
}
else
{
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
$bOrFilter = true;
}
}
// Exclude Filter - handeled with AND filtering!
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
{
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
{
// if ( strtolower($propertyvalue) != strtolower($myfilter[FILTER_VALUE]) )
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
$bEval = false;
}
else
{
// if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
$bEval = false;
}
}
break;
}
}
else
{
// Either filter value or property value was empty!
// This means we have no match
$bEval = false;
}
break;
case FILTER_TYPE_NUMBER:
$bIsOrFilter = true; // Default is set to TRUE
if ( is_numeric($arrProperitesOut[$propertyname]) )
{
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
{
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
$bOrFilter = true;
else
$bOrFilter = false;
}
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
{
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
$bOrFilter = false;
else
$bOrFilter = true;
}
}
else
{
// If wanted, we treat this filter as a success!
if ( GetConfigSetting("TreatNotFoundFiltersAsTrue", 0, CFGLEVEL_USER) == 1 )
$bOrFilter = true;
else
$bOrFilter = false;
}
break;
case FILTER_TYPE_DATE:
// Get Log TimeStamp
$nLogTimeStamp = $arrProperitesOut[$propertyname][EVTIME_TIMESTAMP];
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
{
// Get current timestamp
$nNowTimeStamp = time();
if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
$nLastXTime = 60 * 60; // One Hour!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_12HOURS )
$nLastXTime = 60 * 60 * 12; // 12 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_24HOURS )
$nLastXTime = 60 * 60 * 24; // 24 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_7DAYS )
$nLastXTime = 60 * 60 * 24 * 7; // 7 days
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_31DAYS )
$nLastXTime = 60 * 60 * 24 * 31; // 31 days
else
// WTF default?
$nLastXTime = 86400;
// If Nowtime + LastX is higher then the log timestamp, the this logline is to old for us.
if ( ($nNowTimeStamp - $nLastXTime) > $nLogTimeStamp )
$bEval = false;
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_FROM )
{
// Get filter timestamp!
$nFromTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
// If logtime is smaller then FromTime, then the Event is outside of our scope!
if ( $nLogTimeStamp < $nFromTimeStamp )
$bEval = false;
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_TO )
{
// Get filter timestamp!
// echo $myfilter[FILTER_VALUE];
$nToTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
// If logtime is smaller then FromTime, then the Event is outside of our scope!
if ( $nLogTimeStamp > $nToTimeStamp )
$bEval = false;
}
break;
default:
// TODO!
break;
}
}
// If was number filter, we apply it the evaluation.
if ( $bIsOrFilter )
$bEval &= $bOrFilter;
if ( !$bEval )
{
// unmatching filter, reset property array
foreach ( $this->_arrProperties as $property )
$arrProperitesOut[$property] = '';
// return error!
return ERROR_FILTER_NOT_MATCH;
}
}
}
// Reached this point means filters did match!
return SUCCESS;
}
else // No filters at all means success!
return SUCCESS;
}
} }
?>
?>

View File

@ -240,69 +240,93 @@ class LogStreamPDO extends LogStream {
public function ReadNext(&$uID, &$arrProperitesOut, $bParseMessage = true) public function ReadNext(&$uID, &$arrProperitesOut, $bParseMessage = true)
{ {
// Helpers needed for DB Mapping // Helpers needed for DB Mapping
global $content, $gl_starttime;
global $dbmapping, $fields; global $dbmapping, $fields;
$szTableType = $this->_logStreamConfigObj->DBTableType; $szTableType = $this->_logStreamConfigObj->DBTableType;
// define $ret // define $ret
$ret = SUCCESS; $ret = SUCCESS;
// No buffer? then read from DB! do
if ( $this->bufferedRecords == null )
$ret = $this->ReadNextRecordsFromDB($uID);
else
{ {
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) ) // No buffer? then read from DB!
{ if ( $this->bufferedRecords == null )
// 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); $ret = $this->ReadNextRecordsFromDB($uID);
//echo "!" . $ret . " " . $this->_currentRecordStart . "=" . $this->_currentRecordNum; else
// Check if we found more records
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($this->bufferedRecords[$this->_currentRecordNum] ) )
if ( isset($dbmapping[$szTableType][$property]) )
{ {
// Copy property if available! // We need to load new records, so clear the old ones first!
$dbfieldname = $dbmapping[$szTableType][$property]; $this->ResetBufferedRecords();
if ( isset($this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]) )
// Set new Record start, will be used in the SQL Statement!
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
// Now read new ones
$ret = $this->ReadNextRecordsFromDB($uID);
// Check if we found more records
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]) )
{ {
if ( isset($fields[$property]['FieldType']) && $fields[$property]['FieldType'] == FILTER_TYPE_DATE ) // Handle as date! // Copy property if available!
$arrProperitesOut[$property] = GetEventTime( $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname] ); $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 else
$arrProperitesOut[$property] = $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]; $arrProperitesOut[$property] = '';
} }
else else
$arrProperitesOut[$property] = ''; $arrProperitesOut[$property] = '';
} }
else
$arrProperitesOut[$property] = ''; // Run optional Message Parsers now
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) )
{
$retParser = $this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut);
// Check if we have to skip the message!
if ( $retParser == ERROR_MSG_SKIPMESSAGE )
$ret = $retParser;
}
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum;
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]];
// Increment $_currentRecordNum
$this->_currentRecordNum++;
} }
// Run optional Message Parsers now // Check how long we are running. If only two seconds of execution time are left, we abort further reading!
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) ) $scriptruntime = intval(microtime_float() - $gl_starttime);
$this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut); if ( $scriptruntime > ($content['MaxExecutionTime']-2) )
{
// This may display a warning message, so the user knows we stopped reading records because of the script timeout.
$content['logstream_warning'] = "false";
$content['logstream_warning_details'] = $content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'];
$content['logstream_warning_code'] = ERROR_FILE_NOMORETIME;
// Return error code
return ERROR_FILE_NOMORETIME;
}
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum; // This additional filter check will take care on dynamic fields from the message parser!
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]]; } while ( $this->ApplyFilters($ret, $arrProperitesOut) != SUCCESS && $ret == SUCCESS );
// Increment $_currentRecordNum
$this->_currentRecordNum++;
}
// reached here means return result! // reached here means return result!
return $ret; return $ret;

View File

@ -1,160 +1,221 @@
<?php <?php
/* /*
********************************************************************* *********************************************************************
* -> www.phplogcon.org <- * * -> www.phplogcon.org <- *
* ----------------------------------------------------------------- * * ----------------------------------------------------------------- *
* Apache Logfile Parser used to split WebLog fields if * Apache Logfile Parser used to split WebLog fields if
* found in the msg. * found in the msg.
* *
* This Parser is for custom wireless access point logformat * This Parser is for custom wireless access point logformat
* * * *
* All directives are explained within this file * * All directives are explained within this file *
* *
* Copyright (C) 2008 Adiscon GmbH * Copyright (C) 2008 Adiscon GmbH
********************************************************************* *********************************************************************
*/ */
// --- Avoid directly accessing this file! // --- Avoid directly accessing this file!
if ( !defined('IN_PHPLOGCON') ) if ( !defined('IN_PHPLOGCON') )
{ {
die('Hacking attempt'); die('Hacking attempt');
exit; exit;
} }
// --- // ---
// --- Basic Includes // --- Basic Includes
require_once($gl_root_path . 'classes/enums.class.php'); require_once($gl_root_path . 'classes/enums.class.php');
require_once($gl_root_path . 'classes/msgparser.class.php'); require_once($gl_root_path . 'classes/msgparser.class.php');
require_once($gl_root_path . 'include/constants_errors.php'); require_once($gl_root_path . 'include/constants_errors.php');
require_once($gl_root_path . 'include/constants_logstream.php'); require_once($gl_root_path . 'include/constants_logstream.php');
// --- // ---
class MsgParser_wireless extends MsgParser { class MsgParser_wireless extends MsgParser {
// Public Information properties // Public Information properties
public $_ClassName = 'Custom Wireless Logfiles'; public $_ClassName = 'Custom Wireless Logfiles';
public $_ClassDescription = 'Custom logfile parser for wireless access points.'; public $_ClassDescription = 'Custom logfile parser for wireless access points.';
public $_ClassHelpArticle = ""; public $_ClassHelpArticle = "";
public $_ClassRequiredFields = array ( public $_ClassRequiredFields = array (
"net_bytesrecieved" => array ( "FieldID" => "net_bytesrecieved", "FieldDefine" => "SYSLOG_NET_BYTESRECIEVED", "FieldCaption" => "Bytes recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytesrecieved", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_host" => array (", ", "FieldID" => "net_host", "FieldDefine" => "SYSLOG_NET_HOST", "FieldCaption" => "Hostname", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_host", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_bytessend" => array (", ", "FieldID" => "net_bytessend", "FieldDefine" => "SYSLOG_NET_BYTESSEND", "FieldCaption" => "Bytes send", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytessend", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0 ), "net_bytesrecieved" => array ( "FieldID" => "net_bytesrecieved", "FieldDefine" => "SYSLOG_NET_BYTESRECIEVED", "FieldCaption" => "Bytes recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytesrecieved", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_interface" => array (", ", "FieldID" => "net_interface", "FieldDefine" => "SYSLOG_NET_INTERFACE", "FieldCaption" => "Interface", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_interface", "DefaultWidth" => 75, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_bytessend" => array (", ", "FieldID" => "net_bytessend", "FieldDefine" => "SYSLOG_NET_BYTESSEND", "FieldCaption" => "Bytes send", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytessend", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0 ),
"net_lastactivity" => array (", ", "FieldID" => "net_lastactivity", "FieldDefine" => "SYSLOG_NET_LASTACTIVITY", "FieldCaption" => "Last Activity", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_lastactivity", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_interface" => array (", ", "FieldID" => "net_interface", "FieldDefine" => "SYSLOG_NET_INTERFACE", "FieldCaption" => "Interface", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_interface", "DefaultWidth" => 75, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_lastip" => array (", ", "FieldID" => "net_lastip", "FieldDefine" => "SYSLOG_NET_LASTIP", "FieldCaption" => "Last IP Address", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_lastip", "DefaultWidth" => 100, "SearchOnline" => 1, "Trunscate" => 0, "Sortable" => 0), "net_lastactivity" => array (", ", "FieldID" => "net_lastactivity", "FieldDefine" => "SYSLOG_NET_LASTACTIVITY", "FieldCaption" => "Last Activity", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_lastactivity", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_mac_address" => array (", ", "FieldID" => "net_mac_address", "FieldDefine" => "SYSLOG_NET_MAC_ADDRESS", "FieldCaption" => "Mac Address", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_mac_address", "DefaultWidth" => 120, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_lastip" => array (", ", "FieldID" => "net_lastip", "FieldDefine" => "SYSLOG_NET_LASTIP", "FieldCaption" => "Last IP Address", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_lastip", "DefaultWidth" => 100, "SearchOnline" => 1, "Trunscate" => 0, "Sortable" => 0),
"net_packetsrecieved" => array (", ", "FieldID" => "net_packetsrecieved", "FieldDefine" => "SYSLOG_NET_PACKETSRECIEVED", "FieldCaption" => "Packets recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_packetsrecieved", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_mac_address" => array (", ", "FieldID" => "net_mac_address", "FieldDefine" => "SYSLOG_NET_MAC_ADDRESS", "FieldCaption" => "Mac Address", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_mac_address", "DefaultWidth" => 120, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_packetssend" => array (", ", "FieldID" => "net_packetssend", "FieldDefine" => "SYSLOG_NET_PACKETSSEND", "FieldCaption" => "Packets send", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_packetssend", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_packetsrecieved" => array (", ", "FieldID" => "net_packetsrecieved", "FieldDefine" => "SYSLOG_NET_PACKETSRECIEVED", "FieldCaption" => "Packets recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_packetsrecieved", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_rxrate" => array (", ", "FieldID" => "net_rxrate", "FieldDefine" => "SYSLOG_NET_RXRATE", "FieldCaption" => "RX Rate", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_rxrate", "DefaultWidth" => 65, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_packetssend" => array (", ", "FieldID" => "net_packetssend", "FieldDefine" => "SYSLOG_NET_PACKETSSEND", "FieldCaption" => "Packets send", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_packetssend", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_signalstrength" => array (", ", "FieldID" => "net_signalstrength", "FieldDefine" => "SYSLOG_NET_SIGNALSTRENGTH", "FieldCaption" => "Signal strength", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_signalstrength", "DefaultWidth" => 110, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_rxrate" => array (", ", "FieldID" => "net_rxrate", "FieldDefine" => "SYSLOG_NET_RXRATE", "FieldCaption" => "RX Rate", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_rxrate", "DefaultWidth" => 65, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_signaltonoise" => array (", ", "FieldID" => "net_signaltonoise", "FieldDefine" => "SYSLOG_NET_SIGNALTONOISE", "FieldCaption" => "Signal to noise", "FieldType" => 1, "FieldAlign" => "center", "SearchField" => "net_signaltonoise", "DefaultWidth" => 85, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_signalstrength" => array (", ", "FieldID" => "net_signalstrength", "FieldDefine" => "SYSLOG_NET_SIGNALSTRENGTH", "FieldCaption" => "Signal strength", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_signalstrength", "DefaultWidth" => 110, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_uptime" => array (", ", "FieldID" => "net_uptime", "FieldDefine" => "SYSLOG_NET_UPTIME", "FieldCaption" => "System Uptime", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_uptime", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_signaltonoise" => array (", ", "FieldID" => "net_signaltonoise", "FieldDefine" => "SYSLOG_NET_SIGNALTONOISE", "FieldCaption" => "Signal to noise", "FieldType" => 1, "FieldAlign" => "center", "SearchField" => "net_signaltonoise", "DefaultWidth" => 85, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_txccq" => array (", ", "FieldID" => "net_txccq", "FieldDefine" => "SYSLOG_NET_TXCCQ", "FieldCaption" => "TX CCQ", "FieldType" => 1, "FieldAlign" => "center", "SearchField" => "net_txccq", "DefaultWidth" => 50, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), "net_uptime" => array (", ", "FieldID" => "net_uptime", "FieldDefine" => "SYSLOG_NET_UPTIME", "FieldCaption" => "System Uptime", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_uptime", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
"net_txrate" => array (", ", "FieldID" => "net_txrate", "FieldDefine" => "SYSLOG_NET_TXRATE", "FieldCaption" => "TX Rate", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_txrate", "DefaultWidth" => 75, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0) "net_txccq" => array (", ", "FieldID" => "net_txccq", "FieldDefine" => "SYSLOG_NET_TXCCQ", "FieldCaption" => "TX CCQ", "FieldType" => 1, "FieldAlign" => "center", "SearchField" => "net_txccq", "DefaultWidth" => 50, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
); "net_txrate" => array (", ", "FieldID" => "net_txrate", "FieldDefine" => "SYSLOG_NET_TXRATE", "FieldCaption" => "TX Rate", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_txrate", "DefaultWidth" => 75, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0)
);
// Constructor
public function MsgParser_wireless() { // Constructor
public function MsgParser_wireless() {
// TODO AUTOMATICALLY PERFORM FIELD INSERTS!
// TODO AUTOMATICALLY PERFORM FIELD INSERTS!
return; // Nothing
} return; // Nothing
}
/**
* ParseLine /**
* * ParseLine
* @param arrArguments array in&out: properties of interest. There can be no guarantee the logstream can actually deliver them. *
* @return integer Error stat * @param arrArguments array in&out: properties of interest. There can be no guarantee the logstream can actually deliver them.
*/ * @return integer Error stat
public function ParseMsg($szMsg, &$arrArguments) */
{ public function ParseMsg($szMsg, &$arrArguments)
global $content, $fields; {
global $content, $fields;
//trim the msg first to remove spaces from begin and end
$szMsg = trim($szMsg); //trim the msg first to remove spaces from begin and end
//return ERROR_MSG_NOMATCH; $szMsg = trim($szMsg);
// Sample: Oct 14 21:05:52 script,info INICIO; Madrid-arturosoria ;wlan1 ;00:1F:3A:66:70:09 ;192.168.10.117 ;24Mbps ;36Mbps ;15:50:56 ;00:00:00.080 ;-80dBm@1Mbps ;21 ;78 ;43351,126437 ;2959,377 // Sample: Oct 14 21:05:52 script,info INICIO; Madrid-arturosoria ;wlan1 ;00:1F:3A:66:70:09 ;192.168.10.117 ;24Mbps ;36Mbps ;15:50:56 ;00:00:00.080 ;-80dBm@1Mbps ;21 ;78 ;43351,126437 ;2959,377
if ( preg_match('/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?),(.*?) (.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?)$/', $szMsg, $out) ) if ( preg_match('/(.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?)$/', $szMsg, $out) )
{ {
$arrArguments[SYSLOG_NET_HOST] = trim($out[1]);
//print_r ( $out );
//exit; // Set wlan log specific properties!
$arrArguments[SYSLOG_NET_INTERFACE] = trim($out[2]);
// Set generic properties $arrArguments[SYSLOG_NET_MAC_ADDRESS] = trim($out[3]);
$arrArguments[SYSLOG_DATE] = GetEventTime($out[1] . " " . $out[2]); $arrArguments[SYSLOG_NET_LASTIP] = trim($out[4]);
$arrArguments[SYSLOG_HOST] = $out[6]; $arrArguments[SYSLOG_NET_RXRATE] = trim($out[5]);
// $arrArguments[SYSLOG_DATE] = GetEventTime($out[4]); $arrArguments[SYSLOG_NET_TXRATE] = trim($out[6]);
$arrArguments[SYSLOG_NET_UPTIME] = trim($out[7]);
// Set wlan log specific properties! $arrArguments[SYSLOG_NET_LASTACTIVITY] = trim($out[8]);
$arrArguments[SYSLOG_NET_INTERFACE] = trim($out[7]); $arrArguments[SYSLOG_NET_SIGNALSTRENGTH]= trim($out[9]);
$arrArguments[SYSLOG_NET_MAC_ADDRESS] = trim($out[8]);
$arrArguments[SYSLOG_NET_LASTIP] = trim($out[9]); // Number based fields
$arrArguments[SYSLOG_NET_RXRATE] = trim($out[10]); $arrArguments[SYSLOG_NET_SIGNALTONOISE] = trim($out[10]);
$arrArguments[SYSLOG_NET_TXRATE] = trim($out[11]); $arrArguments[SYSLOG_NET_TXCCQ] = trim($out[11]);
$arrArguments[SYSLOG_NET_UPTIME] = trim($out[12]);
$arrArguments[SYSLOG_NET_LASTACTIVITY] = trim($out[13]); // Set msg to whole logline
$arrArguments[SYSLOG_NET_SIGNALSTRENGTH] = trim($out[14]); $arrArguments[SYSLOG_MESSAGE] = trim($out[0]);
// Number based fields // Get additional parameters!
$arrArguments[SYSLOG_NET_SIGNALTONOISE] = $out[15]; if ( preg_match('/(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?);(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?)$/', $out[12], $out2) )
$arrArguments[SYSLOG_NET_TXCCQ] = $out[16]; {
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = trim($out2[1]);
// Set msg to whole logline $arrArguments[SYSLOG_NET_BYTESSEND] = trim($out2[2]);
$arrArguments[SYSLOG_MESSAGE] = $out[0]; $arrArguments[SYSLOG_NET_PACKETSRECIEVED] = trim($out2[3]);
$arrArguments[SYSLOG_NET_PACKETSSEND] = trim($out2[4]);
// Get additional parameters! }
if ( preg_match('/(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?);(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?)$/', $out[17], $out2) ) else
{ {
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = $out2[1]; $arrArguments[SYSLOG_NET_BYTESRECIEVED] = "";
$arrArguments[SYSLOG_NET_BYTESSEND] = $out2[2]; $arrArguments[SYSLOG_NET_BYTESSEND] = "";
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = $out2[3]; $arrArguments[SYSLOG_NET_PACKETSRECIEVED] = "";
$arrArguments[SYSLOG_NET_PACKETSSEND] = $out2[4]; $arrArguments[SYSLOG_NET_PACKETSSEND] = "";
} }
else
{ if ( $this->_MsgNormalize == 1 )
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = ""; {
$arrArguments[SYSLOG_NET_BYTESSEND] = ""; //Init tmp msg
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = ""; $szTmpMsg = "";
$arrArguments[SYSLOG_NET_PACKETSSEND] = "";
} // Create Field Array to prepend into msg! Reverse Order here
$myFields = array( SYSLOG_NET_PACKETSSEND, SYSLOG_NET_PACKETSRECIEVED, SYSLOG_NET_BYTESSEND, SYSLOG_NET_BYTESRECIEVED, SYSLOG_NET_TXCCQ, SYSLOG_NET_SIGNALTONOISE, SYSLOG_NET_UPTIME, SYSLOG_NET_SIGNALSTRENGTH, SYSLOG_NET_LASTACTIVITY, SYSLOG_NET_TXRATE, SYSLOG_NET_RXRATE, SYSLOG_NET_LASTIP, SYSLOG_NET_MAC_ADDRESS, SYSLOG_NET_INTERFACE, SYSLOG_HOST );
if ( $this->_MsgNormalize == 1 )
{ foreach ( $myFields as $myField )
//Init tmp msg {
$szTmpMsg = ""; // Set Field Caption
if ( isset($fields[$myField]['FieldCaption']) )
// Create Field Array to prepend into msg! Reverse Order here $szFieldName = $fields[$myField]['FieldCaption'];
$myFields = array( SYSLOG_NET_PACKETSSEND, SYSLOG_NET_PACKETSRECIEVED, SYSLOG_NET_BYTESSEND, SYSLOG_NET_BYTESRECIEVED, SYSLOG_NET_TXCCQ, SYSLOG_NET_SIGNALTONOISE, SYSLOG_NET_UPTIME, SYSLOG_NET_SIGNALSTRENGTH, SYSLOG_NET_LASTACTIVITY, SYSLOG_NET_TXRATE, SYSLOG_NET_RXRATE, SYSLOG_NET_LASTIP, SYSLOG_NET_MAC_ADDRESS, SYSLOG_NET_INTERFACE, SYSLOG_HOST ); else
$szFieldName = $myField;
foreach ( $myFields as $myField )
{ // Append Field into msg
// Set Field Caption $szTmpMsg = $szFieldName . ": '" . $arrArguments[$myField] . "'\n" . $szTmpMsg;
if ( isset($fields[$myField]['FieldCaption']) ) }
$szFieldName = $fields[$myField]['FieldCaption'];
else // copy finished MSG back!
$szFieldName = $myField; $arrArguments[SYSLOG_MESSAGE] = $szTmpMsg;
}
// Append Field into msg }
$szTmpMsg = $szFieldName . ": '" . $arrArguments[$myField] . "'\n" . $szTmpMsg; // Sample: Madrid-arturosoria ;wlan1 ;00:1F:3A:66:70:09 ;192.168.10.117 ;24Mbps ;36Mbps ;15:50:56 ;00:00:00.080 ;-80dBm@1Mbps ;21 ;78 ;43351,126437 ;2959,377
} else if ( preg_match('/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?),(.*?) (.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?)$/', $szMsg, $out) )
{
// copy finished MSG back!
$arrArguments[SYSLOG_MESSAGE] = $szTmpMsg; //print_r ( $out );
} //exit;
}
else // Set generic properties
{ $arrArguments[SYSLOG_DATE] = GetEventTime($out[1] . " " . $out[2]);
// return no match in this case! $arrArguments[SYSLOG_NET_HOST] = trim($out[6]);
return ERROR_MSG_NOMATCH;
} // Set wlan log specific properties!
$arrArguments[SYSLOG_NET_INTERFACE] = trim($out[7]);
// Set IUT Property if success! $arrArguments[SYSLOG_NET_MAC_ADDRESS] = trim($out[8]);
$arrArguments[SYSLOG_MESSAGETYPE] = IUT_Syslog; $arrArguments[SYSLOG_NET_LASTIP] = trim($out[9]);
$arrArguments[SYSLOG_NET_RXRATE] = trim($out[10]);
// If we reached this position, return success! $arrArguments[SYSLOG_NET_TXRATE] = trim($out[11]);
return SUCCESS; $arrArguments[SYSLOG_NET_UPTIME] = trim($out[12]);
} $arrArguments[SYSLOG_NET_LASTACTIVITY] = trim($out[13]);
} $arrArguments[SYSLOG_NET_SIGNALSTRENGTH]= trim($out[14]);
// Number based fields
$arrArguments[SYSLOG_NET_SIGNALTONOISE] = trim($out[15]);
$arrArguments[SYSLOG_NET_TXCCQ] = trim($out[16]);
// Set msg to whole logline
$arrArguments[SYSLOG_MESSAGE] = trim($out[0]);
// Get additional parameters!
if ( preg_match('/(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?);(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?)$/', $out[17], $out2) )
{
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = trim($out2[1]);
$arrArguments[SYSLOG_NET_BYTESSEND] = trim($out2[2]);
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = trim($out2[3]);
$arrArguments[SYSLOG_NET_PACKETSSEND] = trim($out2[4]);
}
else
{
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = "";
$arrArguments[SYSLOG_NET_BYTESSEND] = "";
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = "";
$arrArguments[SYSLOG_NET_PACKETSSEND] = "";
}
if ( $this->_MsgNormalize == 1 )
{
//Init tmp msg
$szTmpMsg = "";
// Create Field Array to prepend into msg! Reverse Order here
$myFields = array( SYSLOG_NET_PACKETSSEND, SYSLOG_NET_PACKETSRECIEVED, SYSLOG_NET_BYTESSEND, SYSLOG_NET_BYTESRECIEVED, SYSLOG_NET_TXCCQ, SYSLOG_NET_SIGNALTONOISE, SYSLOG_NET_UPTIME, SYSLOG_NET_SIGNALSTRENGTH, SYSLOG_NET_LASTACTIVITY, SYSLOG_NET_TXRATE, SYSLOG_NET_RXRATE, SYSLOG_NET_LASTIP, SYSLOG_NET_MAC_ADDRESS, SYSLOG_NET_INTERFACE, SYSLOG_HOST );
foreach ( $myFields as $myField )
{
// Set Field Caption
if ( isset($fields[$myField]['FieldCaption']) )
$szFieldName = $fields[$myField]['FieldCaption'];
else
$szFieldName = $myField;
// Append Field into msg
$szTmpMsg = $szFieldName . ": '" . $arrArguments[$myField] . "'\n" . $szTmpMsg;
}
// copy finished MSG back!
$arrArguments[SYSLOG_MESSAGE] = $szTmpMsg;
}
}
else
{
// return no match in this case!
return ERROR_MSG_NOMATCH;
}
// Set IUT Property if success!
$arrArguments[SYSLOG_MESSAGETYPE] = IUT_Syslog;
// If we reached this position, return success!
return SUCCESS;
}
}
?> ?>

View File

@ -162,7 +162,7 @@ else if ( $content['CONVERT_STEP'] == 3 )
} }
// Append INSERT Statement for Config Table to set the Database Version ^^! // Append INSERT Statement for Config Table to set the Database Version ^^!
$mycommands[count($mycommands)] = "INSERT INTO `" . GetConfigSetting("UserDBPref") . "config` (`propname`, `propvalue`, `is_global`) VALUES ('database_installedversion', '" . $content['database_internalversion'] . "', " . $content['database_internalversion'] . ")"; $mycommands[count($mycommands)] = "INSERT INTO `" . GetConfigSetting("UserDBPref") . "config` (`propname`, `propvalue`, `is_global`) VALUES ('database_installedversion', '" . $content['database_internalversion'] . "', 1)";
// --- Now execute all commands // --- Now execute all commands
ini_set('error_reporting', E_WARNING); // Enable Warnings! ini_set('error_reporting', E_WARNING); // Enable Warnings!
@ -211,7 +211,7 @@ else if ( $content['CONVERT_STEP'] == 4 )
if ( isset($_GET['errormsg']) ) if ( isset($_GET['errormsg']) )
{ {
$content['iserror'] = "true"; $content['iserror'] = "true";
$content['errormsg'] = DB_RemoveBadChars( urldecode($_GET['errormsg']) ); $content['errormsg'] = DB_StripSlahes( urldecode($_GET['errormsg']) );
} }
} }
else if ( $content['CONVERT_STEP'] == 5 ) else if ( $content['CONVERT_STEP'] == 5 )

View File

@ -0,0 +1,5 @@
-- New Database Structure Updates
-- Insert data
-- Updated Data

View File

@ -0,0 +1,5 @@
-- New Database Structure Updates
-- Insert data
-- Updated Data

View File

@ -0,0 +1,7 @@
-- New Database Structure Updates
ALTER TABLE `logcon_sources` ADD `MsgSkipUnparseable` BOOL NOT NULL DEFAULT '0' AFTER `MsgNormalize` ;
ALTER TABLE `logcon_sources` ADD `DBRecordsPerQuery` INT NOT NULL DEFAULT '100' AFTER `DBEnableRowCounting` ;
-- Insert data
-- Updated Data

View File

@ -892,14 +892,14 @@ function DieWithErrorMsg( $szerrmsg )
echo echo
"<html><title>phpLogCon :: Critical Error occured</title><head>" . "<html><title>phpLogCon :: Critical Error occured</title><head>" .
"<link rel=\"stylesheet\" href=\"" . $gl_root_path . "themes/default/main.css\" type=\"text/css\"></head><body><br><br>" . "<link rel=\"stylesheet\" href=\"" . $gl_root_path . "themes/default/main.css\" type=\"text/css\"></head><body><br><br>" .
"<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\"><tr>". "<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\" cellpadding=\"2\"><tr>".
"<td class=\"PriorityError\" align=\"center\" colspan=\"2\">" . "<td class=\"PriorityError\" align=\"center\" colspan=\"2\">" .
"<H3>Critical Error occured</H3>" . "<H3>Critical Error occured</H3>" .
"</td></tr>" . "</td></tr>" .
"<tr><td class=\"cellmenu1\" align=\"left\">Errordetails:</td>" . "<tr><td class=\"cellmenu1_naked\" align=\"left\">Errordetails:</td>" .
"<td class=\"tableBackground\" align=\"left\">" . "<td class=\"tableBackground\" align=\"left\"><br>" .
$szerrmsg . $szerrmsg .
"</td></tr></table>" . "<br><br></td></tr></table>" .
"</body></html>"; "</body></html>";
exit; exit;
} }
@ -910,14 +910,14 @@ function DieWithFriendlyErrorMsg( $szerrmsg )
echo echo
"<html><title>phpLogCon :: Error occured</title><head>" . "<html><title>phpLogCon :: Error occured</title><head>" .
"<link rel=\"stylesheet\" href=\"" . $gl_root_path . "themes/default/main.css\" type=\"text/css\"></head><body><br><br>" . "<link rel=\"stylesheet\" href=\"" . $gl_root_path . "themes/default/main.css\" type=\"text/css\"></head><body><br><br>" .
"<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\"><tr>". "<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\" cellpadding=\"2\"><tr>".
"<td class=\"PriorityWarning\" align=\"center\" colspan=\"2\">" . "<td class=\"PriorityWarning\" align=\"center\" colspan=\"2\">" .
"<H3>Error occured</H3>" . "<H3>Error occured</H3>" .
"</td></tr>" . "</td></tr>" .
"<tr><td class=\"cellmenu1\" align=\"left\">Errordetails:</td>" . "<tr><td class=\"cellmenu1_naked\" align=\"left\">Errordetails:</td>" .
"<td class=\"tableBackground\" align=\"left\">" . "<td class=\"tableBackground\" align=\"left\"><br>" .
$szerrmsg . $szerrmsg .
"</td></tr></table>" . "<br><br></td></tr></table>" .
"</body></html>"; "</body></html>";
exit; exit;
} }
@ -1005,6 +1005,12 @@ function RedirectPage( $newpage )
function RedirectResult( $szMsg, $newpage ) function RedirectResult( $szMsg, $newpage )
{ {
global $content;
if ( defined('PHPLOGCON_INERROR') )
DieWithErrorMsg( GetAndReplaceLangStr($content["LN_ERROR_REDIRECTABORTED"], $newpage) );
// Perform redirect!
header("Location: result.php?msg=" . urlencode($szMsg) . "&redir=" . urlencode($newpage)); header("Location: result.php?msg=" . urlencode($szMsg) . "&redir=" . urlencode($newpage));
exit; exit;
} }
@ -1341,44 +1347,44 @@ function PrintSecureUserCheck( $warningtext, $yesmsg, $nomsg )
exit; exit;
} }
function SaveGeneralSettingsIntoDB() function SaveGeneralSettingsIntoDB($bForceStripSlahes = false)
{ {
WriteConfigValue( "ViewDefaultLanguage", true ); WriteConfigValue( "ViewDefaultLanguage", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewDefaultTheme", true ); WriteConfigValue( "ViewDefaultTheme", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewUseTodayYesterday", true ); WriteConfigValue( "ViewUseTodayYesterday", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewEnableDetailPopups", true ); WriteConfigValue( "ViewEnableDetailPopups", true, null, null,$bForceStripSlahes );
WriteConfigValue( "EnableIPAddressResolve", true ); WriteConfigValue( "EnableIPAddressResolve", true, null, null,$bForceStripSlahes );
WriteConfigValue( "MiscShowDebugMsg", true ); WriteConfigValue( "MiscShowDebugMsg", true, null, null,$bForceStripSlahes );
WriteConfigValue( "MiscShowDebugGridCounter", true ); WriteConfigValue( "MiscShowDebugGridCounter", true, null, null,$bForceStripSlahes );
WriteConfigValue( "MiscShowPageRenderStats", true ); WriteConfigValue( "MiscShowPageRenderStats", true, null, null,$bForceStripSlahes );
WriteConfigValue( "MiscEnableGzipCompression", true ); WriteConfigValue( "MiscEnableGzipCompression", true, null, null,$bForceStripSlahes );
WriteConfigValue( "SuppressDuplicatedMessages", true ); WriteConfigValue( "SuppressDuplicatedMessages", true, null, null,$bForceStripSlahes );
WriteConfigValue( "TreatNotFoundFiltersAsTrue", true ); WriteConfigValue( "TreatNotFoundFiltersAsTrue", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewMessageCharacterLimit", true ); WriteConfigValue( "ViewMessageCharacterLimit", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewStringCharacterLimit", true ); WriteConfigValue( "ViewStringCharacterLimit", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewEntriesPerPage", true ); WriteConfigValue( "ViewEntriesPerPage", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewEnableAutoReloadSeconds", true ); WriteConfigValue( "ViewEnableAutoReloadSeconds", true, null, null,$bForceStripSlahes );
WriteConfigValue( "PopupMenuTimeout", true ); WriteConfigValue( "PopupMenuTimeout", true, null, null,$bForceStripSlahes );
WriteConfigValue( "PrependTitle", true ); WriteConfigValue( "PrependTitle", true, null, null,$bForceStripSlahes );
WriteConfigValue( "SearchCustomButtonCaption", true ); WriteConfigValue( "SearchCustomButtonCaption", true, null, null,$bForceStripSlahes );
WriteConfigValue( "SearchCustomButtonSearch", true ); WriteConfigValue( "SearchCustomButtonSearch", true, null, null,$bForceStripSlahes );
// Extra Fields // Extra Fields
WriteConfigValue( "DefaultViewsID", true ); WriteConfigValue( "DefaultViewsID", true, null, null,$bForceStripSlahes );
WriteConfigValue( "DefaultSourceID", true ); WriteConfigValue( "DefaultSourceID", true, null, null,$bForceStripSlahes );
// GLOBAL ONLY // GLOBAL ONLY
WriteConfigValue( "DebugUserLogin", true ); WriteConfigValue( "DebugUserLogin", true, null, null,$bForceStripSlahes );
WriteConfigValue( "MiscDebugToSyslog", true ); WriteConfigValue( "MiscDebugToSyslog", true, null, null,$bForceStripSlahes );
WriteConfigValue( "MiscMaxExecutionTime", true ); WriteConfigValue( "MiscMaxExecutionTime", true, null, null,$bForceStripSlahes );
// Custom HTML Code // Custom HTML Code
WriteConfigValue( "InjectHtmlHeader", true ); WriteConfigValue( "InjectHtmlHeader", true, null, null,$bForceStripSlahes );
WriteConfigValue( "InjectBodyHeader", true ); WriteConfigValue( "InjectBodyHeader", true, null, null,$bForceStripSlahes );
WriteConfigValue( "InjectBodyFooter", true ); WriteConfigValue( "InjectBodyFooter", true, null, null ,$bForceStripSlahes );
} }
function SaveUserGeneralSettingsIntoDB() function SaveUserGeneralSettingsIntoDB()
@ -1507,6 +1513,22 @@ function list_files($directory, $failOnError = true)
} }
} }
/*
* Helper function to flush html output to avoid redirects if errors happen!
*/
function FlushHtmlOutput()
{
global $RUNMODE;
// not needed in console mode
if ( $RUNMODE == RUNMODE_COMMANDLINE )
return;
//Flush php output
@flush();
@ob_flush();
}
/* /*
* Helper function to get the errorCode * Helper function to get the errorCode
*/ */

View File

@ -80,6 +80,12 @@ function InitSource(&$mysource)
$content['Sources'][$iSourceID]['MsgNormalize'] = 0; $content['Sources'][$iSourceID]['MsgNormalize'] = 0;
} }
if ( !isset($mysource['MsgSkipUnparseable']) )
{
$CFG['Sources'][$iSourceID]['MsgSkipUnparseable'] = 0;
$content['Sources'][$iSourceID]['MsgSkipUnparseable'] = 0;
}
if ( !isset($mysource['Description']) ) if ( !isset($mysource['Description']) )
{ {
$CFG['Sources'][$iSourceID]['Description'] = ""; $CFG['Sources'][$iSourceID]['Description'] = "";
@ -153,6 +159,7 @@ function InitSource(&$mysource)
if ( isset($mysource['DBUser']) ) { $mysource['ObjRef']->DBUser = $mysource['DBUser']; } if ( isset($mysource['DBUser']) ) { $mysource['ObjRef']->DBUser = $mysource['DBUser']; }
if ( isset($mysource['DBPassword']) ) { $mysource['ObjRef']->DBPassword = $mysource['DBPassword']; } if ( isset($mysource['DBPassword']) ) { $mysource['ObjRef']->DBPassword = $mysource['DBPassword']; }
if ( isset($mysource['DBEnableRowCounting']) ) { $mysource['ObjRef']->DBEnableRowCounting = $mysource['DBEnableRowCounting']; } if ( isset($mysource['DBEnableRowCounting']) ) { $mysource['ObjRef']->DBEnableRowCounting = $mysource['DBEnableRowCounting']; }
if ( isset($mysource['DBRecordsPerQuery']) ) { $mysource['ObjRef']->RecordsPerQuery = $mysource['DBRecordsPerQuery']; }
} }
else if ( $mysource['SourceType'] == SOURCE_PDO ) else if ( $mysource['SourceType'] == SOURCE_PDO )
{ {
@ -185,6 +192,7 @@ function InitSource(&$mysource)
$mysource['ObjRef']->_pageCount = GetConfigSetting("ViewEntriesPerPage", 50); $mysource['ObjRef']->_pageCount = GetConfigSetting("ViewEntriesPerPage", 50);
$mysource['ObjRef']->SetMsgParserList( $mysource['MsgParserList'] ); $mysource['ObjRef']->SetMsgParserList( $mysource['MsgParserList'] );
$mysource['ObjRef']->SetMsgNormalize( $mysource['MsgNormalize'] ); $mysource['ObjRef']->SetMsgNormalize( $mysource['MsgNormalize'] );
$mysource['ObjRef']->SetSkipUnparseable( $mysource['MsgSkipUnparseable'] );
// Set default SourceID here! // Set default SourceID here!
if ( isset($content['Sources'][$iSourceID]) && !isset($currentSourceID) ) if ( isset($content['Sources'][$iSourceID]) && !isset($currentSourceID) )

View File

@ -45,7 +45,7 @@ $errdesc = "";
$errno = 0; $errno = 0;
// --- Current Database Version, this is important for automated database Updates! // --- Current Database Version, this is important for automated database Updates!
$content['database_internalversion'] = "6"; // Whenever incremented, a database upgrade is needed $content['database_internalversion'] = "7"; // Whenever incremented, a database upgrade is needed
$content['database_installedversion'] = "0"; // 0 is default which means Prior Versioning Database $content['database_installedversion'] = "0"; // 0 is default which means Prior Versioning Database
// --- // ---
@ -216,6 +216,9 @@ function DB_PrintError($MyErrorMsg, $DieOrNot)
$errdesc = mysql_error(); $errdesc = mysql_error();
$errno = mysql_errno(); $errno = mysql_errno();
// Define global variable so we know an error has occured!
define('PHPLOGCON_INERROR', true);
$errormsg="Database error: $MyErrorMsg $linesep"; $errormsg="Database error: $MyErrorMsg $linesep";
$errormsg.="mysql error: $errdesc $linesep"; $errormsg.="mysql error: $errdesc $linesep";
$errormsg.="mysql error number: $errno $linesep"; $errormsg.="mysql error number: $errno $linesep";
@ -236,17 +239,18 @@ function DB_RemoveParserSpecialBadChars($myString)
return $returnstr; return $returnstr;
} }
function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL) function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL, $bForceStripSlahes = false)
{ {
if ( $dbEngine == DB_MSSQL ) if ( $dbEngine == DB_MSSQL )
{ {
//TODO STRIP SLASHES ?!
// MSSQL needs special treatment -.- // MSSQL needs special treatment -.-
return str_replace("'","''",$myString); return str_replace("'","''",$myString);
} }
else else
{ {
// Replace with internal PHP Functions! // Replace with internal PHP Functions!
if ( !get_magic_quotes_gpc() ) if ( !get_magic_quotes_gpc() || $bForceStripSlahes )
return addslashes($myString); return addslashes($myString);
// return addcslashes($myString, "'"); // return addcslashes($myString, "'");
else else
@ -263,7 +267,7 @@ function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL)
function DB_StripSlahes($myString) function DB_StripSlahes($myString)
{ {
// Replace with internal PHP Functions! // Replace with internal PHP Functions!
if ( !get_magic_quotes_gpc() ) if ( get_magic_quotes_gpc() )
return stripslashes($myString); return stripslashes($myString);
else else
return $myString; return $myString;
@ -319,17 +323,13 @@ function DB_Exec($query)
return false; return false;
} }
function PrepareValueForDB($szValue) function PrepareValueForDB($szValue, $bForceStripSlahes = false)
{ {
//echo "<br>" . $szValue . "<br>!" . preg_match("/[^\\\\]['\\\\][^'\\\\]/e", $szValue, $matches) . "<br>"; // Wrapper for this function
// Copy value for DB and check for BadDB Chars! return DB_RemoveBadChars($szValue, null, $bForceStripSlahes);
// if ( preg_match("/(?<!\\\\)\'|\\\\\\\\/x", $szValue) ) /* OLD /(?<!\\\\)\'|(?<!\\\\)\\\\/e */
return DB_RemoveBadChars($szValue);
// else
// return $szValue;
} }
function WriteConfigValue($szPropName, $is_global = true, $userid = false, $groupid = false) function WriteConfigValue($szPropName, $is_global = true, $userid = false, $groupid = false, $bForceStripSlahes = false)
{ {
global $content; global $content;
@ -343,7 +343,7 @@ function WriteConfigValue($szPropName, $is_global = true, $userid = false, $grou
if ( isset($content[$szPropName]) ) if ( isset($content[$szPropName]) )
{ {
// Copy value for DB and check for BadDB Chars! // Copy value for DB and check for BadDB Chars!
$szDbValue = PrepareValueForDB( $content[$szPropName] ); $szDbValue = PrepareValueForDB( $content[$szPropName], $bForceStripSlahes );
} }
else else
{ {
@ -384,7 +384,7 @@ function WriteConfigValue($szPropName, $is_global = true, $userid = false, $grou
if ( isset($USERCFG[$szPropName]) ) if ( isset($USERCFG[$szPropName]) )
{ {
// Copy value for DB and check for BadDB Chars! // Copy value for DB and check for BadDB Chars!
$szDbValue = PrepareValueForDB( $USERCFG[$szPropName] ); $szDbValue = PrepareValueForDB( $USERCFG[$szPropName], $bForceStripSlahes );
} }
else else
{ {

View File

@ -84,7 +84,7 @@ function ConvertGeneralSettings()
global $content; global $content;
// Only call the same function as in admin index! // Only call the same function as in admin index!
SaveGeneralSettingsIntoDB(); SaveGeneralSettingsIntoDB(true);
} }
/* /*

View File

@ -267,7 +267,17 @@ if ( isset($content['Sources'][$currentSourceID]) )
} }
} }
} }
else else if ( $ret == ERROR_MSG_SKIPMESSAGE )
{
do
{
// Skip until we find a suitable entry
$ret = $stream->ReadNext($uID, $logArray);
} while ($ret == ERROR_MSG_SKIPMESSAGE);
}
// check for error return state!
if ( $ret != SUCCESS )
{ {
// This will disable to Main SyslogView and show an error message // This will disable to Main SyslogView and show an error message
$content['syslogmessagesenabled'] = "false"; $content['syslogmessagesenabled'] = "false";
@ -625,7 +635,14 @@ if ( isset($content['Sources'][$currentSourceID]) )
// Increment Counter // Increment Counter
$counter++; $counter++;
} while ($counter < $content['CurrentViewEntriesPerPage'] && ($ret = $stream->ReadNext($uID, $logArray)) == SUCCESS);
// --- Extra Loop to get the next entry!
do
{
$ret = $stream->ReadNext($uID, $logArray);
} while ( $ret == ERROR_MSG_SKIPMESSAGE );
// ---
} while ( $counter < $content['CurrentViewEntriesPerPage'] && ($ret == SUCCESS) );
//print_r ( $content['syslogmessages'] ); //print_r ( $content['syslogmessages'] );
// Move below processing - Read First and LAST UID's before start reading the stream! // Move below processing - Read First and LAST UID's before start reading the stream!

View File

@ -260,7 +260,7 @@ else if ( $content['INSTALL_STEP'] == 3 )
if ( isset($_GET['errormsg']) ) if ( isset($_GET['errormsg']) )
{ {
$content['iserror'] = "true"; $content['iserror'] = "true";
$content['errormsg'] = urldecode($_GET['errormsg']); $content['errormsg'] = urldecode( DB_StripSlahes($_GET['errormsg']) );
} }
} }
else if ( $content['INSTALL_STEP'] == 4 ) else if ( $content['INSTALL_STEP'] == 4 )
@ -461,7 +461,7 @@ else if ( $content['INSTALL_STEP'] == 6 )
if ( isset($_GET['errormsg']) ) if ( isset($_GET['errormsg']) )
{ {
$content['iserror'] = "true"; $content['iserror'] = "true";
$content['errormsg'] = urldecode($_GET['errormsg']); $content['errormsg'] = urldecode( DB_StripSlahes($_GET['errormsg']) );
} }
} }
else // NO Database means NO user management, so next step! else // NO Database means NO user management, so next step!
@ -553,7 +553,7 @@ else if ( $content['INSTALL_STEP'] == 7 )
if ( isset($_GET['errormsg']) ) if ( isset($_GET['errormsg']) )
{ {
$content['iserror'] = "true"; $content['iserror'] = "true";
$content['errormsg'] = urldecode($_GET['errormsg']); $content['errormsg'] = urldecode( DB_StripSlahes($_GET['errormsg']) );
} }
} }
else if ( $content['INSTALL_STEP'] == 8 ) else if ( $content['INSTALL_STEP'] == 8 )

View File

@ -223,6 +223,7 @@ $content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!"; $content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!"; $content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
$content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)"; $content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)";
$content['LN_SOURCES_ERROR_INVALIDVALUE'] = "Invalid value for the paramater '%1'.";
// Database Upgrade // Database Upgrade
$content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update"; $content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update";

View File

@ -97,6 +97,7 @@ $content['LN_ERROR_NORECORDS'] = "Es wurden keine syslog-Eintr&auml;ge gefunden.
$content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'] = "While reading the logstream, the php script timeout forced me to abort at this point.<br><br> If you want to avoid this, please increase the phpLogCon script timeout in your config.php. If the user system is installed, you can do that in Admin center."; $content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'] = "While reading the logstream, the php script timeout forced me to abort at this point.<br><br> If you want to avoid this, please increase the phpLogCon script timeout in your config.php. If the user system is installed, you can do that in Admin center.";
$content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required"; $content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required";
$content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available."; $content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available.";
$content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the <a href="%1">page</a> was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.';
// Topmenu Entries // Topmenu Entries
$content['LN_MENU_SEARCH'] = "Suchen"; $content['LN_MENU_SEARCH'] = "Suchen";
@ -191,6 +192,8 @@ $content['LN_CFG_FIRSTSYSLOGSOURCE'] = "Erste Syslog Quelle";
$content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in"; $content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in";
$content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)"; $content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)";
$content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers"; $content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers";
$content['LN_CFG_SKIPUNPARSEABLE'] = "Skip unparseable messages (Only works if msgparsers are configured!)";
$content['LN_CFG_DBRECORDSPERQUERY'] = "Recordcount for database queries";
// 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";

View File

@ -227,6 +227,7 @@ $content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!"; $content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!"; $content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
$content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)"; $content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)";
$content['LN_SOURCES_ERROR_INVALIDVALUE'] = "Invalid value for the paramater '%1'.";
// Database Upgrade // Database Upgrade
$content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update"; $content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update";

View File

@ -99,6 +99,7 @@ $content['LN_ERROR_DB_DBFIELDNOTFOUND'] = "Database Field mapping for at least o
$content['LN_ERROR_FILE_NOMORETIME'] = "No more time for processing left"; $content['LN_ERROR_FILE_NOMORETIME'] = "No more time for processing left";
$content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required"; $content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required";
$content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available."; $content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available.";
$content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the <a href="%1">page</a> was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.';
// Topmenu Entries // Topmenu Entries
$content['LN_MENU_SEARCH'] = "Search"; $content['LN_MENU_SEARCH'] = "Search";
@ -193,6 +194,8 @@ $content['LN_CFG_VIEW'] = "Select View";
$content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in"; $content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in";
$content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)"; $content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)";
$content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers"; $content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers";
$content['LN_CFG_SKIPUNPARSEABLE'] = "Skip unparseable messages (Only works if msgparsers are configured!)";
$content['LN_CFG_DBRECORDSPERQUERY'] = "Recordcount for database queries";
// 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";

View File

@ -223,6 +223,7 @@ $content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!"; $content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!"; $content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
$content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)"; $content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)";
$content['LN_SOURCES_ERROR_INVALIDVALUE'] = "Invalid value for the paramater '%1'.";
// Database Upgrade // Database Upgrade
$content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update"; $content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update";

View File

@ -101,6 +101,7 @@ $content['LN_ERROR_NORECORDS'] = "Sem mensagens encontradas.";
$content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'] = "While reading the logstream, the php script timeout forced me to abort at this point.<br><br> If you want to avoid this, please increase the phpLogCon script timeout in your config.php. If the user system is installed, you can do that in Admin center."; $content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'] = "While reading the logstream, the php script timeout forced me to abort at this point.<br><br> If you want to avoid this, please increase the phpLogCon script timeout in your config.php. If the user system is installed, you can do that in Admin center.";
$content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required"; $content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required";
$content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available."; $content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available.";
$content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the <a href="%1">page</a> was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.';
// Topmenu Entries // Topmenu Entries
$content['LN_MENU_SEARCH'] = "Search"; $content['LN_MENU_SEARCH'] = "Search";
@ -195,6 +196,8 @@ $content['LN_CFG_VIEW'] = "Selecione vis&atilde;o";
$content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in"; $content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in";
$content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)"; $content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)";
$content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers"; $content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers";
$content['LN_CFG_SKIPUNPARSEABLE'] = "Skip unparseable messages (Only works if msgparsers are configured!)";
$content['LN_CFG_DBRECORDSPERQUERY'] = "Recordcount for database queries";
// Details page // Details page
$content['LN_DETAILS_FORSYSLOGMSG'] = "Detalhes para a mensagem com id"; $content['LN_DETAILS_FORSYSLOGMSG'] = "Detalhes para a mensagem com id";

View File

@ -73,7 +73,7 @@
<td align="right" class="line1" width="350"><input type="text" name="DisplayName" size="55" maxlength="255" value="{DisplayName}"></td> <td align="right" class="line1" width="350"><input type="text" name="DisplayName" size="55" maxlength="255" value="{DisplayName}"></td>
</tr> </tr>
<tr> <tr>
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td> <td align="left" class="cellmenu2"><b>{LN_SEARCH_QUERY}</b></td>
<td align="right" class="line2"><input type="text" name="SearchQuery" size="55" maxlength="1024" value="{SearchQuery}"></td> <td align="right" class="line2"><input type="text" name="SearchQuery" size="55" maxlength="1024" value="{SearchQuery}"></td>
</tr> </tr>
<tr> <tr>

View File

@ -17,14 +17,16 @@
showvisibility("HiddenDatabaseTypeOptions"); showvisibility("HiddenDatabaseTypeOptions");
hidevisibility("HiddenDiskTypeOptions"); hidevisibility("HiddenDiskTypeOptions");
hidevisibility("HiddenDBTypesOptions"); showvisibility("HiddenMYSQLSourceOptions");
hidevisibility("HiddenPDOSourceOptions");
} }
else if (myfield.value == 3) else if (myfield.value == 3)
{ {
showvisibility("HiddenDatabaseTypeOptions"); showvisibility("HiddenDatabaseTypeOptions");
hidevisibility("HiddenDiskTypeOptions"); hidevisibility("HiddenDiskTypeOptions");
showvisibility("HiddenDBTypesOptions"); showvisibility("HiddenPDOSourceOptions");
hidevisibility("HiddenMYSQLSourceOptions");
} }
} }
</script> </script>
@ -135,6 +137,10 @@
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_NORMALIZEMSG}</b></td> <td align="left" class="cellmenu2" nowrap><b>{LN_CFG_NORMALIZEMSG}</b></td>
<td align="right" class="line1"><input type="checkbox" name="MsgNormalize" value="1" {CHECKED_ISNORMALIZEMSG}></td> <td align="right" class="line1"><input type="checkbox" name="MsgNormalize" value="1" {CHECKED_ISNORMALIZEMSG}></td>
</tr> </tr>
<tr>
<td align="left" class="cellmenu2_naked"><b>{LN_CFG_SKIPUNPARSEABLE}</b></td>
<td align="right" class="line1"><input type="checkbox" name="MsgSkipUnparseable" value="1" {CHECKED_ISSKIPUNPARSEABLE}></td>
</tr>
<tr> <tr>
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td> <td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td>
@ -180,7 +186,7 @@
<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> </table>
<div id="HiddenDBTypesOptions" class="ShownContent"> <div id="HiddenPDOSourceOptions" class="ShownContent">
<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> <tr>
<td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_DBSTORAGEENGINE}</b></td> <td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_DBSTORAGEENGINE}</b></td>
@ -229,6 +235,15 @@
</table> </table>
</div> </div>
<div id="HiddenMYSQLSourceOptions" class="ShownContent">
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
<tr>
<td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_DBRECORDSPERQUERY}</b></td>
<td align="right" class="line1" width="350"><input type="text" name="SourceDBRecordsPerQuery" size="40" maxlength="255" value="{SourceDBRecordsPerQuery}"></td>
</tr>
</table>
</div>
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate"> <table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
<tr> <tr>
<td align="center" colspan="2"> <td align="center" colspan="2">

View File

@ -27,7 +27,7 @@
<table width="100%" cellpadding="2" cellspacing="1" border="0" align="center" class="with_border_alternate"> <table width="100%" cellpadding="2" cellspacing="1" border="0" align="center" class="with_border_alternate">
<tr> <tr>
<td class="title"> <td class="title">
<h1 align="center">{LN_CONVERT_TITLETOP}</h1> <h3 align="center">{LN_CONVERT_TITLETOP}</h3>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -56,7 +56,7 @@
<table width="100%" cellpadding="2" cellspacing="1" border="0" align="center" class="with_border_alternate"> <table width="100%" cellpadding="2" cellspacing="1" border="0" align="center" class="with_border_alternate">
<tr> <tr>
<td class="title"> <td class="title">
<h1 align="center">{INSTALL_TITLETOP}</h1> <h3 align="center">{INSTALL_TITLETOP}</h3>
</td> </td>
</tr> </tr>
</table> </table>