diff --git a/src/admin/index.php b/src/admin/index.php index 258e4e2..3bffae7 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -171,6 +171,7 @@ if ( isset($_POST['op']) ) if ( isset ($_POST['InjectBodyHeader']) ) { $content['InjectBodyHeader'] = $_POST['InjectBodyHeader']; } if ( isset ($_POST['InjectBodyFooter']) ) { $content['InjectBodyFooter'] = $_POST['InjectBodyFooter']; } if ( isset ($_POST['PhplogconLogoUrl']) ) { $content['PhplogconLogoUrl'] = $_POST['PhplogconLogoUrl']; } + if ( isset ($_POST['UseProxyServerForRemoteQueries']) ) { $content['UseProxyServerForRemoteQueries'] = $_POST['UseProxyServerForRemoteQueries']; } // Save configuration variables now SaveGeneralSettingsIntoDB(); diff --git a/src/include/config.sample.php b/src/include/config.sample.php index f325e09..ab3ac12 100644 --- a/src/include/config.sample.php +++ b/src/include/config.sample.php @@ -85,6 +85,7 @@ $CFG['TreatNotFoundFiltersAsTrue'] = 0; // If you filter / search for messages, $CFG['PopupMenuTimeout'] = 3000; // This variable defines the default timeout value for popup menus in milliseconds. (those menus which popup when you click on the value of a field. $CFG['PhplogconLogoUrl'] = ""; // Put an Url to a custom toplogo you want to use. $CFG['InlineOnlineSearchIcons'] = 1; // Show online search icons +$CFG['UseProxyServerForRemoteQueries'] = "";// If empty no proxy server will be used. If set to a proxy server url like 127.0.0.1:8080, LogAnalyzer will use this server for url queries like the updatecheck. // --- // --- Custom HTML Code diff --git a/src/include/functions_common.php b/src/include/functions_common.php index f6edef4..7435924 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -899,6 +899,11 @@ function InitConfigurationValues() $content['PhplogconLogoUrl'] = ""; // Init Option // --- + // --- Set Proxy Option + if ( strlen(GetConfigSetting("UseProxyServerForRemoteQueries", false)) <= 0 ) + $content['UseProxyServerForRemoteQueries'] = ""; // Init Option + // --- + // Init main langauge file now! IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/main.php' ); @@ -1562,6 +1567,7 @@ function SaveGeneralSettingsIntoDB($bForceStripSlahes = false) WriteConfigValue( "DebugUserLogin", true, null, null,$bForceStripSlahes ); WriteConfigValue( "MiscDebugToSyslog", true, null, null,$bForceStripSlahes ); WriteConfigValue( "MiscMaxExecutionTime", true, null, null,$bForceStripSlahes ); + WriteConfigValue( "UseProxyServerForRemoteQueries", true, null, null,$bForceStripSlahes ); // Custom HTML Code WriteConfigValue( "InjectHtmlHeader", true, null, null,$bForceStripSlahes ); diff --git a/src/include/functions_users.php b/src/include/functions_users.php index c47bd17..d69aa68 100644 --- a/src/include/functions_users.php +++ b/src/include/functions_users.php @@ -216,8 +216,18 @@ function CheckUserLogin( $username, $password ) // --- // --- Now we check for an PhpLogCon Update - $myHandle = @fopen($content['UPDATEURL'], "r"); - + if ( strlen(GetConfigSetting("UseProxyServerForRemoteQueries", "") > 0) ) + { + // Proxy Server configured, create a context with proxy option! + $opts = array('http' => array('proxy' => 'tcp://' + GetConfigSetting("UseProxyServerForRemoteQueries", ""), 'request_fulluri' => true)); + $context = stream_context_create($opts); + + // Create handle with my context! + $myHandle = @fopen($content['UPDATEURL'], "r", false, $context); + } + else + $myHandle = @fopen($content['UPDATEURL'], "r"); + if( $myHandle ) { $myBuffer = ""; diff --git a/src/lang/de/admin.php b/src/lang/de/admin.php index 92573b0..73b9589 100644 --- a/src/lang/de/admin.php +++ b/src/lang/de/admin.php @@ -108,6 +108,7 @@ $content['LN_GEN_INJECTBODYFOOTER'] = "Voranstellen von HTML Code Am Ende des &l $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optionale LogAnalyzer-Logo-URL. Bitte für das Standard-Logo leer lassen."; $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $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."; // User Center $content['LN_USER_CENTER'] = "Benutzer Optionen"; diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index 0746d52..2a5807d 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -108,6 +108,7 @@ $content['LN_GEN_INJECTBODYFOOTER'] = "Inject this html code at the end <body $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optional LogAnalyzer Logo URL. Leave empty to use the default one."; $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $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."; // 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 0379014..4d79a72 100644 --- a/src/lang/it_IT/admin.php +++ b/src/lang/it_IT/admin.php @@ -108,6 +108,7 @@ $content['LN_GEN_INJECTBODYFOOTER'] = "Inject this html code at the end <body $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optional LogAnalyzer Logo URL. Leave empty to use the default one."; $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $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."; // 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 06b4fba..07f0ee3 100644 --- a/src/lang/pt_BR/admin.php +++ b/src/lang/pt_BR/admin.php @@ -108,6 +108,7 @@ $content['LN_GEN_INJECTBODYFOOTER'] = "Inject this html code at the end <body $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optional LogAnalyzer Logo URL. Leave empty to use the default one."; $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $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."; // 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 7124c94..d4ee8df 100644 --- a/src/templates/admin/admin_index.html +++ b/src/templates/admin/admin_index.html @@ -274,7 +274,11 @@