diff --git a/src/css/menu.css b/src/css/menu.css index 277a3ad..4066524 100644 --- a/src/css/menu.css +++ b/src/css/menu.css @@ -4,6 +4,7 @@ } #menu ul { /* remove bullets and list indents */ + position: absolute; list-style: none; margin: 0; padding: 0; diff --git a/src/include/config.sample.php b/src/include/config.sample.php index 34483d6..56ac775 100644 --- a/src/include/config.sample.php +++ b/src/include/config.sample.php @@ -68,6 +68,8 @@ $CFG['ViewEnableAutoReloadSeconds'] = 0; // If "ViewEnableAutoReloadSeconds" is $CFG['SearchCustomButtonCaption'] = "I'd like to feel sad"; // Default caption for the custom fast search button $CFG['SearchCustomButtonSearch'] = "error"; // Default search string for the custom search button + +$CFG['EnableIPAddressResolve'] = 1; // If enabled, IP Addresses inline messages are automatically resolved and the result is added in brackets {} behind the IP Address // --- // --- Define which fields you want to see diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 4d0ff0c..3c7554f 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -397,10 +397,13 @@ function InitPhpDebugMode() function CheckAndSetRunMode() { - global $RUNMODE; + global $RUNMODE, $MaxExecutionTime; // Set to command line mode if argv is set! if ( !isset($_SERVER["GATEWAY_INTERFACE"]) ) $RUNMODE = RUNMODE_COMMANDLINE; + + // Obtain max_execution_time + $MaxExecutionTime = ini_get("max_execution_time"); } function InitRuntimeInformations() @@ -854,8 +857,15 @@ function GetMonthFromString($szMonth) */ function AddContextLinks(&$sourceTxt) { - global $szTLDDomains; + global $szTLDDomains, $CFG; + // Return if not enabled! + if ( !isset($CFG['EnableIPAddressResolve']) || $CFG['EnableIPAddressResolve'] == 1 ) + { + // Search for IP's and Add Reverse Lookup first! + $sourceTxt = preg_replace( '/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/e', "'\\1.\\2.\\3.\\4' . ReverseResolveIP('\\1.\\2.\\3.\\4', ' {', '} ')", $sourceTxt ); + } + // Create if not set! if ( !isset($szTLDDomains) ) CreateTopLevelDomainSearch(); @@ -864,14 +874,15 @@ function AddContextLinks(&$sourceTxt) $search = array ( '/\.([\w\d\_]+)\.(' . $szTLDDomains . ')([^a-zA-Z0-9])/x', - '|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|', +// '|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|', + '/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/x', ); // Create Replace Array $replace = array ( '.$1.$2$3', - '$1', + '$1.$2.$3.$4', ); // Replace and return! @@ -881,6 +892,44 @@ function AddContextLinks(&$sourceTxt) //return $outTxt; } +/* +* Reserve Resolve IP Address! +*/ +function ReverseResolveIP( $szIP, $prepend, $append ) +{ + global $gl_starttime, $MaxExecutionTime; + + // Substract 5 savety seconds! + $scriptruntime = intval(microtime_float() - $gl_starttime); + if ( $scriptruntime > ($MaxExecutionTime-5) ) + { +echo "WTF $scriptruntime - $MaxExecutionTime"; + return ""; + } + + // Abort if these IP's are postet + if ( strpos("0.0.0.0", $szIP) !== false | strpos("127.", $szIP) !== false | strpos("255.255.255.255", $szIP) !== false ) + return ""; + else + { + // Resolve name if needed + if ( !isset($_SESSION['dns_cache'][$szIP]) ) + $_SESSION['dns_cache'][$szIP] = gethostbyaddr($szIP); + + // Abort if IP and RESOLVED name are the same ^^! + if ( $_SESSION['dns_cache'][$szIP] == $szIP ) + return; + + // Create string + $szReturn = $prepend; + $szReturn .= $_SESSION['dns_cache'][$szIP]; + $szReturn .= $append; + + // return result + return $szReturn; + } +} + /* * Helper function to create a top level domain search string ONCE per process! */ diff --git a/src/lang/de/main.php b/src/lang/de/main.php index d169e0c..067abdd 100644 --- a/src/lang/de/main.php +++ b/src/lang/de/main.php @@ -73,6 +73,7 @@ $content['LN_SEARCH_PERFORMADVANCED'] = "Erweiterte Suche starten"; $content['LN_VIEW_FILTERFOR'] = "Filter message for "; $content['LN_VIEW_SEARCHFOR'] = "Search online for "; $content['LN_VIEW_SEARCHFORGOOGLE'] = "Search Google for "; + $content['LN_GEN_MESSAGEDETAILS'] = "Message Details"; $content['LN_HIGHLIGHT'] = "Hightlight >>"; $content['LN_HIGHLIGHT_OFF'] = "Hightlight <<"; diff --git a/src/lang/en/main.php b/src/lang/en/main.php index b84919d..9f61ae1 100644 --- a/src/lang/en/main.php +++ b/src/lang/en/main.php @@ -74,6 +74,7 @@ $content['LN_VIEW_RELATEDMSG'] = "View related syslog messages"; $content['LN_VIEW_FILTERFOR'] = "Filter message for "; $content['LN_VIEW_SEARCHFOR'] = "Search online for "; $content['LN_VIEW_SEARCHFORGOOGLE'] = "Search Google for "; + $content['LN_GEN_MESSAGEDETAILS'] = "Message Details"; $content['LN_HIGHLIGHT'] = "Hightlight >>"; $content['LN_HIGHLIGHT_OFF'] = "Hightlight <<"; diff --git a/src/templates/index.html b/src/templates/index.html index a52643f..35c75cd 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -221,52 +221,49 @@ - - - - + + + + + + - + - - - {fieldvalue} - + {fieldvalue} - - {fieldvalue} - - + + {fieldvalue} + - - {fieldvalue} - + {fieldvalue} +
{fieldvalue}
@@ -282,6 +279,7 @@
+ diff --git a/src/themes/dark/main.css b/src/themes/dark/main.css index 0df4626..2e39f63 100644 --- a/src/themes/dark/main.css +++ b/src/themes/dark/main.css @@ -408,3 +408,9 @@ select, input, button, textarea border: 1px solid; border-color: #233B51 #124A7C #124A7C #233B51; } + +.highlighted +{ + font: bold 8pt Arial,Helvetica,sans-serif; + color: #CC6600 +} diff --git a/src/themes/default/main.css b/src/themes/default/main.css index 8614e4a..d7bbf4b 100644 --- a/src/themes/default/main.css +++ b/src/themes/default/main.css @@ -413,3 +413,9 @@ select, input, button, textarea border: 1px solid; border-color: #233B51 #124A7C #124A7C #233B51; } + +.highlighted +{ + font: bold 8pt Arial,Helvetica,sans-serif; + color: #BB0000 +}