Added support to use a proxy server for internal url queries like the updatecheck

This commit is contained in:
Andre Lorbach 2010-10-22 16:22:30 +02:00
parent da72306458
commit 24de694d47
9 changed files with 30 additions and 4 deletions

View File

@ -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();

View File

@ -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

View File

@ -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 );

View File

@ -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 = "";

View File

@ -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&uuml;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";

View File

@ -108,6 +108,7 @@ $content['LN_GEN_INJECTBODYFOOTER'] = "Inject this html code at the end &lt;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";

View File

@ -108,6 +108,7 @@ $content['LN_GEN_INJECTBODYFOOTER'] = "Inject this html code at the end &lt;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";

View File

@ -108,6 +108,7 @@ $content['LN_GEN_INJECTBODYFOOTER'] = "Inject this html code at the end &lt;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";

View File

@ -274,7 +274,11 @@
</tr>
<tr>
<td align="left" class="cellmenu2_naked"><b>{LN_ADMIN_PHPLOGCON_LOGOURL}</b></td>
<td align="left" class="line1" colspan="2"><input type="text" name="PhplogconLogoUrl" size="85" maxlength="255" value="{PhplogconLogoUrl}" {DISABLE_GLOBALEDIT_FORMCONTROL}></td>
<td align="left" class="line2" colspan="2"><input type="text" name="PhplogconLogoUrl" size="85" maxlength="255" value="{PhplogconLogoUrl}" {DISABLE_GLOBALEDIT_FORMCONTROL}></td>
</tr>
<tr>
<td align="left" class="cellmenu2_naked"><b>{LN_ADMIN_USEPROXYSERVER}</b></td>
<td align="left" class="line1" colspan="2"><input type="text" name="UseProxyServerForRemoteQueries" size="85" maxlength="255" value="{UseProxyServerForRemoteQueries}" {DISABLE_GLOBALEDIT_FORMCONTROL}></td>
</tr>
<tr>
<td align="left" class="cellmenu2"><b>{LN_GEN_DEBUGUSERLOGIN}</b></td>
@ -291,7 +295,7 @@
</tr>
<tr>
<td align="left" class="cellmenu2_naked" valign="_top"><b>{LN_GEN_INJECTBODYHEADER}</b></td>
<td align="left" class="line2" colspan="2"><textarea name="InjectBodyHeader" cols="85" rows="3" {DISABLE_GLOBALEDIT_FORMCONTROL}>{InjectBodyHeader}</textarea></td>
<td align="left" class="line1" colspan="2"><textarea name="InjectBodyHeader" cols="85" rows="3" {DISABLE_GLOBALEDIT_FORMCONTROL}>{InjectBodyHeader}</textarea></td>
</tr>
<tr>
<td align="left" class="cellmenu2_naked" valign="_top"><b>{LN_GEN_INJECTBODYFOOTER}</b></td>