From 9d9d1fad8db57a436fd58b6ca2817fb93b90295a Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Tue, 12 Apr 2011 15:38:42 +0200 Subject: [PATCH] Added option to disable context links in LogAnalyzer. --- src/admin/index.php | 4 ++++ src/include/config.sample.php | 1 + src/include/functions_common.php | 10 ++++++++++ src/lang/de/admin.php | 1 + src/lang/en/admin.php | 1 + src/lang/it_IT/admin.php | 1 + src/lang/pt_BR/admin.php | 1 + src/templates/admin/admin_index.html | 8 ++++++++ 8 files changed, 27 insertions(+) diff --git a/src/admin/index.php b/src/admin/index.php index 7035016..1517730 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -142,6 +142,7 @@ if ( isset($_POST['op']) ) // Read checkboxes if ( isset ($_POST['ViewUseTodayYesterday']) ) { $content['ViewUseTodayYesterday'] = 1; } else { $content['ViewUseTodayYesterday'] = 0; } if ( isset ($_POST['ViewEnableDetailPopups']) ) { $content['ViewEnableDetailPopups'] = 1; } else { $content['ViewEnableDetailPopups'] = 0; } + if ( isset ($_POST['EnableContextLinks']) ) { $content['EnableContextLinks'] = 1; } else { $content['EnableContextLinks'] = 0; } if ( isset ($_POST['EnableIPAddressResolve']) ) { $content['EnableIPAddressResolve'] = 1; } else { $content['EnableIPAddressResolve'] = 0; } if ( isset ($_POST['MiscShowDebugMsg']) ) { $content['MiscShowDebugMsg'] = 1; } else { $content['MiscShowDebugMsg'] = 0; } if ( isset ($_POST['MiscShowDebugGridCounter']) ) { $content['MiscShowDebugGridCounter'] = 1; } else { $content['MiscShowDebugGridCounter'] = 0; } @@ -201,6 +202,7 @@ if ( isset($_POST['op']) ) // Read checkboxes 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; } if ( isset ($_POST['User_EnableIPAddressResolve']) ) { $USERCFG['EnableIPAddressResolve'] = 1; } else { $USERCFG['EnableIPAddressResolve'] = 0; } if ( isset ($_POST['User_MiscShowDebugMsg']) ) { $USERCFG['MiscShowDebugMsg'] = 1; } else { $USERCFG['MiscShowDebugMsg'] = 0; } if ( isset ($_POST['User_MiscShowDebugGridCounter']) ) { $USERCFG['MiscShowDebugGridCounter'] = 1; } else { $USERCFG['MiscShowDebugGridCounter'] = 0; } @@ -242,6 +244,7 @@ if ( !isset($content['AdminChangeWaitTime']) ) { $content['AdminChangeWaitTime'] // Set checkbox States 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'] = ""; } if (isset($content['EnableIPAddressResolve']) && $content['EnableIPAddressResolve'] == 1) { $content['EnableIPAddressResolve_checked'] = "checked"; } else { $content['EnableIPAddressResolve_checked'] = ""; } if (isset($content['MiscShowDebugMsg']) && $content['MiscShowDebugMsg'] == 1) { $content['MiscShowDebugMsg_checked'] = "checked"; } else { $content['MiscShowDebugMsg_checked'] = ""; } @@ -332,6 +335,7 @@ if ( $content['ENABLEUSEROPTIONS'] ) // Set checkbox States 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'] = ""; } + if ( GetConfigSetting('EnableContextLinks', $content['EnableContextLinks'], CFGLEVEL_USER) == 1) { $content['User_EnableContextLinks_checked'] = "checked"; } else { $content['User_EnableContextLinks_checked'] = ""; } if ( GetConfigSetting('EnableIPAddressResolve', $content['EnableIPAddressResolve'], CFGLEVEL_USER) == 1) { $content['User_EnableIPAddressResolve_checked'] = "checked"; } else { $content['User_EnableIPAddressResolve_checked'] = ""; } if ( GetConfigSetting('MiscShowDebugMsg', $content['MiscShowDebugMsg'], CFGLEVEL_USER) == 1) { $content['User_MiscShowDebugMsg_checked'] = "checked"; } else { $content['User_MiscShowDebugMsg_checked'] = ""; } diff --git a/src/include/config.sample.php b/src/include/config.sample.php index fb590da..f6cac98 100644 --- a/src/include/config.sample.php +++ b/src/include/config.sample.php @@ -79,6 +79,7 @@ $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['EnableContextLinks'] = 1; // if enabled, context links within the messages will automatically be created and added. Set this to 0 to disable all context links. $CFG['EnableIPAddressResolve'] = 1; // If enabled, IP Addresses inline messages are automatically resolved and the result is added in brackets {} behind the IP Address $CFG['SuppressDuplicatedMessages'] = 0; // If enabled, duplicated messages will be suppressed in the main display. $CFG['TreatNotFoundFiltersAsTrue'] = 0; // If you filter / search for messages, and the fields you are filtering for is not found, the filter result is treaten as TRUE! diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 59e8c65..2e29fd4 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -914,6 +914,10 @@ function InitConfigurationValues() $content['HeaderDefaultEncoding'] = GetConfigSetting("HeaderDefaultEncoding", ENC_ISO_8859_1); // --- + // --- Read ContextLinks Option, and set default! + $content['EnableContextLinks'] = GetConfigSetting("EnableContextLinks", 1); + // --- + // Init main langauge file now! IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/main.php' ); @@ -1341,6 +1345,10 @@ function AddContextLinks(&$sourceTxt) { global $szTLDDomains; + // check if user disabled Context Links. + if ( GetConfigSetting("EnableContextLinks", 1, CFGLEVEL_USER) == 0 ) + return; + // Return if not enabled! if ( GetConfigSetting("EnableIPAddressResolve", 0, CFGLEVEL_USER) == 1 ) { @@ -1566,6 +1574,7 @@ function SaveGeneralSettingsIntoDB($bForceStripSlahes = false) WriteConfigValue( "ViewUseTodayYesterday", true, null, null,$bForceStripSlahes ); WriteConfigValue( "ViewEnableDetailPopups", true, null, null,$bForceStripSlahes ); + WriteConfigValue( "EnableContextLinks", true, null, null,$bForceStripSlahes ); WriteConfigValue( "EnableIPAddressResolve", true, null, null,$bForceStripSlahes ); WriteConfigValue( "MiscShowDebugMsg", true, null, null,$bForceStripSlahes ); WriteConfigValue( "MiscShowDebugGridCounter", true, null, null,$bForceStripSlahes ); @@ -1613,6 +1622,7 @@ function SaveUserGeneralSettingsIntoDB() WriteConfigValue( "ViewUseTodayYesterday", false, $content['SESSION_USERID'] ); WriteConfigValue( "ViewEnableDetailPopups", false, $content['SESSION_USERID'] ); + WriteConfigValue( "EnableContextLinks", false, $content['SESSION_USERID'] ); WriteConfigValue( "EnableIPAddressResolve", false, $content['SESSION_USERID'] ); WriteConfigValue( "MiscShowDebugMsg", false, $content['SESSION_USERID'] ); WriteConfigValue( "MiscShowDebugGridCounter", false, $content['SESSION_USERID'] ); diff --git a/src/lang/de/admin.php b/src/lang/de/admin.php index c03528b..a95b4b7 100644 --- a/src/lang/de/admin.php +++ b/src/lang/de/admin.php @@ -110,6 +110,7 @@ $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allo $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; $content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; +$content['LN_GEN_CONTEXTLINKS'] = "Enable Contextlinks (Question marks)"; // User Center $content['LN_USER_CENTER'] = "Benutzer Optionen"; diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index 15f744d..363b921 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -110,6 +110,7 @@ $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allo $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; $content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; +$content['LN_GEN_CONTEXTLINKS'] = "Enable Contextlinks (Question marks)"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/lang/it_IT/admin.php b/src/lang/it_IT/admin.php index b67d452..af01d99 100644 --- a/src/lang/it_IT/admin.php +++ b/src/lang/it_IT/admin.php @@ -110,6 +110,7 @@ $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allo $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; $content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; +$content['LN_GEN_CONTEXTLINKS'] = "Enable Contextlinks (Question marks)"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/lang/pt_BR/admin.php b/src/lang/pt_BR/admin.php index 541d6bc..a03766a 100644 --- a/src/lang/pt_BR/admin.php +++ b/src/lang/pt_BR/admin.php @@ -110,6 +110,7 @@ $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allo $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; $content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; +$content['LN_GEN_CONTEXTLINKS'] = "Enable Contextlinks (Question marks)"; // 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 b312640..dc8f565 100644 --- a/src/templates/admin/admin_index.html +++ b/src/templates/admin/admin_index.html @@ -204,6 +204,14 @@ + + + {LN_GEN_CONTEXTLINKS} + + + + + {LN_GEN_IPADRRESOLVE}