diff --git a/src/admin/index.php b/src/admin/index.php index 8f39e15..5271ba6 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -183,6 +183,7 @@ if ( isset($_POST['op']) ) if ( isset ($_POST['DebugUserLogin']) ) { $content['DebugUserLogin'] = 1; } else { $content['DebugUserLogin'] = 0; } if ( isset ($_POST['MiscDebugToSyslog']) ) { $content['MiscDebugToSyslog'] = 1; } else { $content['MiscDebugToSyslog'] = 0; } if ( isset ($_POST['DisableAdminUsers']) ) { $content['DisableAdminUsers'] = 1; } else { $content['DisableAdminUsers'] = 0; } + if ( isset ($_POST['ViewColoredCells']) ) { $content['ViewColoredCells'] = 1; } else { $content['ViewColoredCells'] = 0; } // Read Text number fields if ( isset ($_POST['ViewMessageCharacterLimit']) && is_numeric($_POST['ViewMessageCharacterLimit']) ) { $content['ViewMessageCharacterLimit'] = $_POST['ViewMessageCharacterLimit']; } @@ -235,6 +236,7 @@ if ( isset($_POST['op']) ) if ( isset ($_POST['User_DefaultFontSize']) ) { $USERCFG['DefaultFontSize'] = $_POST['User_DefaultFontSize']; } // Read checkboxes + if ( isset( $_POST['User_ViewColoredCells']) ) { $USERCFG['ViewColoredCells'] = 1; } else { $USERCFG['ViewColoredCells'] = 0; } if ( isset ($_POST['User_ViewUseTodayYesterday']) ) { $USERCFG['ViewUseTodayYesterday'] = 1; } else { $USERCFG['ViewUseTodayYesterday'] = 0; } if ( isset ($_POST['User_ViewEnableDetailPopups']) ) { $USERCFG['ViewEnableDetailPopups'] = 1; } else { $USERCFG['ViewEnableDetailPopups'] = 0; } if ( isset ($_POST['User_EnableContextLinks']) ) { $USERCFG['EnableContextLinks'] = 1; } else { $USERCFG['EnableContextLinks'] = 0; } @@ -280,7 +282,7 @@ if ( !isset($content['AdminChangeWaitTime']) ) { $content['AdminChangeWaitTime'] // Set checkbox States if (isset($content['ExportUseTodayYesterday']) && $content['ExportUseTodayYesterday'] == 1) { $content['ExportUseTodayYesterday_checked'] = "checked"; } else { $content['ExportUseTodayYesterday_checked'] = ""; } if (isset($content['SESSION_MAXIMIZED']) && $content['SESSION_MAXIMIZED'] == 1) { $content['SESSION_MAXIMIZED_checked'] = "checked"; } else { $content['SESSION_MAXIMIZED_checked'] = ""; } - +if (isset($content['ViewColoredCells']) && $content['ViewColoredCells'] == 1) { $content['ViewColoredCells_checked'] = "checked"; } else { $content['ViewColoredCells_checked'] = ""; } if (isset($content['ViewUseTodayYesterday']) && $content['ViewUseTodayYesterday'] == 1) { $content['ViewUseTodayYesterday_checked'] = "checked"; } else { $content['ViewUseTodayYesterday_checked'] = ""; } if (isset($content['ViewEnableDetailPopups']) && $content['ViewEnableDetailPopups'] == 1) { $content['ViewEnableDetailPopups_checked'] = "checked"; } else { $content['ViewEnableDetailPopups_checked'] = ""; } if (isset($content['EnableContextLinks']) && $content['EnableContextLinks'] == 1) { $content['EnableContextLinks_checked'] = "checked"; } else { $content['EnableContextLinks_checked'] = ""; } @@ -398,6 +400,7 @@ if ( $content['ENABLEUSEROPTIONS'] ) // Set checkbox States if ( GetConfigSetting('ExportUseTodayYesterday', $content['ExportUseTodayYesterday'], CFGLEVEL_USER) == 1) { $content['User_ExportUseTodayYesterday_checked'] = "checked"; } else { $content['User_ExportUseTodayYesterday_checked'] = ""; } if ( GetConfigSetting('SESSION_MAXIMIZED', $content['SESSION_MAXIMIZED'], CFGLEVEL_USER) == 1) { $content['User_SESSION_MAXIMIZED_checked'] = "checked"; } else { $content['User_SESSION_MAXIMIZED_checked'] = ""; } + if ( GetConfigSetting('ViewColoredCells', $content['ViewColoredCells'], CFGLEVEL_USER) == 1) { $content['User_ViewColoredCells_checked'] = "checked"; } else { $content['User_ViewColoredCells_checked'] = ""; } if ( GetConfigSetting('ViewUseTodayYesterday', $content['ViewUseTodayYesterday'], CFGLEVEL_USER) == 1) { $content['User_ViewUseTodayYesterday_checked'] = "checked"; } else { $content['User_ViewUseTodayYesterday_checked'] = ""; } if ( GetConfigSetting('ViewEnableDetailPopups', $content['ViewEnableDetailPopups'], CFGLEVEL_USER) == 1) { $content['User_ViewEnableDetailPopups_checked'] = "checked"; } else { $content['User_ViewEnableDetailPopups_checked'] = ""; } diff --git a/src/css/defaults.css b/src/css/defaults.css index 7c891e6..9a52857 100644 --- a/src/css/defaults.css +++ b/src/css/defaults.css @@ -1,144 +1,275 @@ -/* Generic Style definitions */ -.ExpansionPlus -{ - background-image: url("../images/icons/navigate_plus.png"); - background-repeat: no-repeat; - background-position: left center; - padding-left: 20px; -} - -.ExpansionMinus -{ - background-image: url("../images/icons/navigate_minus.png"); - background-repeat: no-repeat; - background-position: left center; - padding-left: 20px; -} - -.HiddenContent -{ - visibility: hidden; -/* position: relative; */ - display: none; -} - -.ShownContent -{ - visibility: visible; - display: inline; -} - -.borderless -{ - border:0px solid; - background-color: transparent; -} - -.borderlessbuttons -{ - border:0px solid; - background-color: transparent; - width:20px; - padding: 0px; -} - -.inlinebutton -{ - float:left; - position: relative; - - border:0px solid; - background-color: transparent; - padding: 0px; - margin: 0px; -} - -.SelectSavedFilter -{ - margin-top: 2px; - border: 1px solid; - border-color: #233B51 #124A7C #124A7C #233B51; -} - -.syslogdetails, a.syslogdetails, a.syslogdetails:link, a.syslogdetails:active, a.syslogdetails:visited -{ - font-weight:normal; - text-decoration:none; - position:relative; - overflow:visible; -} -.syslogdetails -{ - position:relative; - overflow:visible; - z-index:4; -} - -.syslogdetails:hover -{ - position:relative; /*this is the key*/ - font-weight:normal; - z-index:5; -} -.syslogdetails span -{ - position:relative; - overflow:visible; - display: none; - z-index:-1; - -} -/*the span will display just on :hover state*/ -.syslogdetails_popup span -{ - display:block; - position:absolute; - overflow:auto; - z-index:5; - -/* top:15px; */ -/* left:15px; */ -} - -.gridline -{ - vertical-align: middle; - height: 16px; -} - -/* -* POPUP Helper Styles -*/ -.popupdetails -{ - position: absolute; - visibility: hidden; - z-index:1 -} -.popupdetails:hover -{ - position: absolute; - visibility: hidden; - z-index: 2; -} - -.popupdetails_popup -{ - position: absolute; - visibility: visible; - z-index: 2; -} - -.maxwidth { - width: 100%; -} - -.ui-dialog .ui-dialog-content.ui-dialog-spinner{ - background: url("../images/ajax-loader.gif") no-repeat scroll 30px 30px transparent; - padding: 50px 0 0px 110px; - border: 0px solid #999999; - font-weight: bold; - line-height: 1em; - font-size: 1.3em; - color: #737373; -} +/* Generic Style definitions */ +.ExpansionPlus +{ + background-image: url("../images/icons/navigate_plus.png"); + background-repeat: no-repeat; + background-position: left center; + padding-left: 20px; +} + +.ExpansionMinus +{ + background-image: url("../images/icons/navigate_minus.png"); + background-repeat: no-repeat; + background-position: left center; + padding-left: 20px; +} + +.HiddenContent +{ + visibility: hidden; +/* position: relative; */ + display: none; +} + +.ShownContent +{ + visibility: visible; + display: inline; +} + +.borderless +{ + border:0px solid; + background-color: transparent; +} + +.borderlessbuttons +{ + border:0px solid; + background-color: transparent; + width:20px; + padding: 0px; +} + +.inlinebutton +{ + float:left; + position: relative; + + border:0px solid; + background-color: transparent; + padding: 0px; + margin: 0px; +} + +.SelectSavedFilter +{ + margin-top: 2px; + border: 1px solid; + border-color: #233B51 #124A7C #124A7C #233B51; +} + +.syslogdetails, a.syslogdetails, a.syslogdetails:link, a.syslogdetails:active, a.syslogdetails:visited +{ + font-weight:normal; + text-decoration:none; + position:relative; + overflow:visible; +} +.syslogdetails +{ + position:relative; + overflow:visible; + z-index:4; +} + +.syslogdetails:hover +{ + position:relative; /*this is the key*/ + font-weight:normal; + z-index:5; +} +.syslogdetails span +{ + position:relative; + overflow:visible; + display: none; + z-index:-1; + +} +/*the span will display just on :hover state*/ +.syslogdetails_popup span +{ + display:block; + position:absolute; + overflow:auto; + z-index:5; + +/* top:15px; */ +/* left:15px; */ +} + +.gridline +{ + vertical-align: middle; + height: 16px; +} + +/* +* POPUP Helper Styles +*/ +.popupdetails +{ + position: absolute; + visibility: hidden; + z-index:1 +} +.popupdetails:hover +{ + position: absolute; + visibility: hidden; + z-index: 2; +} + +.popupdetails_popup +{ + position: absolute; + visibility: visible; + z-index: 2; +} + +.maxwidth { + width: 100%; +} + +.ui-dialog .ui-dialog-content.ui-dialog-spinner{ + background: url("../images/ajax-loader.gif") no-repeat scroll 30px 30px transparent; + padding: 50px 0 0px 110px; + border: 0px solid #999999; + font-weight: bold; + line-height: 1em; + font-size: 1.3em; + color: #737373; +} + +/* Cells for listening */ +/*emergency*/ +.line1_0{ + color: #000000; background-color: #840A15; +} +.line2_0{ + color: #000000; background-color: #be0e1d; +} +.line1_0:hover, .line2_0:hover { + background-color:#CD636E; +} +td .line1_0 a, td .line1_0 a:link, td .line1_0 a:active, td .line1_0 a:visited, +td .line2_0 a, td .line2_0 a:link, td .line2_0 a:active, td .line2_0 a:visited { + color: #ffffff; +} +/*alert*/ +.line1_1{ + color: #000000; background-color: #BA0716; +} +.line2_1{ + color: #000000; background-color: #dd081a; +} +.line1_1:hover, .line2_1:hover { + background-color:#CD636E; +} +td .line1_1 a, td .line1_1 a:link, td .line1_1 a:active, td .line1_1 a:visited, +td .line2_1 a, td .line2_1 a:link, td .line2_1 a:active, td .line2_1 a:visited { + color: #ffffff; +} +/*critical*/ +.line1_2{ + color: #000000; background-color: #CE0819; +} +.line2_2{ + color: #000000; background-color: #f83a4a; +} +.line1_2:hover, .line2_2:hover { + color: #ffff55; + background-color:#CD636E; +} +td .line1_2 a, td .line1_2 a:link, td .line1_2 a:active, td .line1_2 a:visited, +td .line2_2 a, td .line2_2 a:link, td .line2_2 a:active, td .line2_2 a:visited { + color: #ffffff; +} +/*error*/ +.line1_3{ + color: #ffff99; background-color: #BB0A1F; +} +.line2_3{ + color: #ffff99; background-color: #f20d28; +} +.line1_3:hover, .line2_3:hover { + color: #ffff55; + background-color:#CD636E; +} +td .line1_3 a, td .line1_3 a:link, td .line1_3 a:active, td .line1_3 a:visited, +td .line2_3 a, td .line2_3 a:link, td .line2_3 a:active, td .line2_3 a:visited { + color: #ffffff; +} +/*warning*/ +.line1_4{ + color: #000000; background-color: #EF8200; +} +.line2_4{ + color: #000000; background-color: #ff8c00; +} +.line1_4:hover, .line2_4:hover { + background-color:#ffc680; +} +td .line1_4 a, td .line1_4 a:link, td .line1_4 a:active, td .line1_4 a:visited, +td .line2_4 a, td .line2_4 a:link, td .line2_4 a:active, td .line2_4 a:visited { + color: #000000; +} +/*notice*/ +.line1_5{ + color: #000000; background-color: #14AD42; +} +.line2_5{ + color: #000000; background-color: #18cd4e; +} +.line1_5:hover, .line2_5:hover { + background-color:#76ef9a; +} +td .line1_5 a, td .line1_5 a:link, td .line1_5 a:active, td .line1_5 a:visited, +td .line2_5 a, td .line2_5 a:link, td .line2_5 a:active, td .line2_5 a:visited { + color: #000000; +} +/*info*/ +.line1_6{ + color: #000000; background-color: #0C9C91; +} +.line2_6{ + color: #000000; background-color: #0ebeaf; +} +.line1_6:hover, .line2_6:hover { + background-color:#2aefde; +} +td .line1_6 a, td .line1_6 a:link, td .line1_6 a:active, td .line1_6 a:visited, +td .line2_6 a, td .line2_6 a:link, td .line2_6 a:active, td .line2_6 a:visited { + color: #000000; +} +/*debug*/ +.line1_7{ + color: #000000; background-color: #666699; +} +.line2_7{ + color: #000000; background-color: #8585ad; +} +.line1_7:hover, .line2_7:hover { + background-color:#a3a3c2; +} +td .line1_7 a, td .line1_7 a:link, td .line1_7 a:active, td .line1_7 a:visited, +td .line2_7 a, td .line2_7 a:link, td .line2_7 a:active, td .line2_7 a:visited { + color: #000000; +} +/*trace*/ +.line1_8{ + color: #000000; background-color: #c2c2c0; +} +.line2_8{ + color: #000000; background-color: #cdcdcb; +} +.line1_8:hover, .line2_8:hover { + background-color:#f3f3f2; + background-color:#dadad8; +} +td .line1_8 a, td .line1_8 a:link, td .line1_8 a:active, td .line1_8 a:visited, +td .line2_8 a, td .line2_8 a:link, td .line2_8 a:active, td .line2_8 a:visited { + color: #000000; +} diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 1252d1b..24cac43 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -58,7 +58,10 @@ $DEBUGMODE = DEBUG_INFO; // Enable error tracking @ini_set( "track_errors", "On" ); -// --- + +// Try to enable a little more memory in case we do some more filtering +@ini_set('memory_limit', '512M'); +// --- // Default language $LANG_EN = "en"; // Used for fallback @@ -627,20 +630,11 @@ function CheckAndSetRunMode() */ function RemoveMagicQuotes() { - if(function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) { - $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); - while (list($key, $val) = each($process)) { - foreach ($val as $k => $v) { - unset($process[$key][$k]); - if (is_array($v)) { - $process[$key][stripslashes($k)] = $v; - $process[] = &$process[$key][stripslashes($k)]; - } else { - $process[$key][stripslashes($k)] = stripslashes($v); - } - } - } - unset($process); + if(function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) { + RemoveMagicQuotes_deep($_GET); + RemoveMagicQuotes_deep($_POST); + RemoveMagicQuotes_deep($_COOKIE); + RemoveMagicQuotes_deep($_REQUEST); } } @@ -1801,6 +1795,7 @@ function SaveGeneralSettingsIntoDB($bForceStripSlahes = false) WriteConfigValue( "ExportUseTodayYesterday", true, null, null,$bForceStripSlahes ); WriteConfigValue( "SESSION_MAXIMIZED", true, null, null,$bForceStripSlahes ); + WriteConfigValue( "ViewColoredCells", true, null, null,$bForceStripSlahes ); WriteConfigValue( "ViewUseTodayYesterday", true, null, null,$bForceStripSlahes ); WriteConfigValue( "ViewEnableDetailPopups", true, null, null,$bForceStripSlahes ); @@ -1856,6 +1851,7 @@ function SaveUserGeneralSettingsIntoDB() WriteConfigValue( "ExportUseTodayYesterday", false, $content['SESSION_USERID']); WriteConfigValue( "SESSION_MAXIMIZED", false, $content['SESSION_USERID']); + WriteConfigValue( "ViewColoredCells", false, $content['SESSION_USERID']); WriteConfigValue( "ViewUseTodayYesterday", false, $content['SESSION_USERID'] ); WriteConfigValue( "ViewEnableDetailPopups", false, $content['SESSION_USERID'] ); diff --git a/src/index.php b/src/index.php index e623a5b..d182491 100644 --- a/src/index.php +++ b/src/index.php @@ -332,6 +332,7 @@ if ( isset($content['Sources'][$currentSourceID]) ) // --- Obtain characters limits first! $myMsgCharLimit = GetConfigSetting("ViewMessageCharacterLimit", 80, CFGLEVEL_USER); $myStrCharLimit = GetConfigSetting("ViewStringCharacterLimit", 30, CFGLEVEL_USER); + $ViewColoredCells = GetConfigSetting("ViewColoredCells", 0, CFGLEVEL_USER); // --- //Loop through the messages! @@ -370,10 +371,11 @@ if ( isset($content['Sources'][$currentSourceID]) ) // --- // --- Set CSS Class + $szCssAppend = ($ViewColoredCells == 1 ? ((isset($logArray[SYSLOG_SEVERITY]) && strlen($logArray[SYSLOG_SEVERITY]) > 0 ? "_" . $logArray[SYSLOG_SEVERITY] : "")) : ""); if ( $counter % 2 == 0 ) - $content['syslogmessages'][$counter]['cssclass'] = "line1" . (isset($logArray[SYSLOG_SEVERITY]) && strlen($logArray[SYSLOG_SEVERITY]) > 0 ? "_" . $logArray[SYSLOG_SEVERITY] : ""); + $content['syslogmessages'][$counter]['cssclass'] = "line1" . $szCssAppend; else - $content['syslogmessages'][$counter]['cssclass'] = "line2" . (isset($logArray[SYSLOG_SEVERITY]) && strlen($logArray[SYSLOG_SEVERITY]) > 0 ? "_" . $logArray[SYSLOG_SEVERITY] : ""); + $content['syslogmessages'][$counter]['cssclass'] = "line2" . $szCssAppend; // --- // --- Copy other needed properties diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index a1cc4df..c241f47 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -121,6 +121,7 @@ $content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; $content['LN_GEN_CONTEXTLINKS'] = "Enable Contextlinks (Question marks)"; $content['LN_GEN_DISABLEADMINUSERS'] = "Disable Adminpanel for normal users"; $content['LN_GEN_SESSION_MAX'] = "Load page in maximized mode"; +$content['LN_GEN_VIEWCOLOREDCELLS'] = "Colored Syslog messages based on Syslog Severity (Priority)"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/templates/admin/admin_index.html b/src/templates/admin/admin_index.html index e70e226..557b8df 100644 --- a/src/templates/admin/admin_index.html +++ b/src/templates/admin/admin_index.html @@ -236,6 +236,15 @@ + +