From fe37de2640dda79704f34b68aeebb308bcfe9ea2 Mon Sep 17 00:00:00 2001 From: Mohamed Ashraf Date: Sat, 29 Jun 2013 14:49:02 +0200 Subject: [PATCH] Removed 'VersionCheck' profix from proxy variables --- doc/config.rst | 13 +++++++------ error_report.php | 16 ++++++++-------- libraries/config.default.php | 17 +++++++++-------- libraries/config/messages.inc.php | 12 ++++++------ libraries/config/setup.forms.php | 6 +++--- version_check.php | 16 ++++++++-------- 6 files changed, 41 insertions(+), 39 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index ab507a40a8..33e13eec95 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1037,17 +1037,18 @@ Generic settings This setting can be adjusted by your vendor. -.. config:option:: $cfg['VersionCheckProxyUrl'] +.. config:option:: $cfg['ProxyUrl'] :type: string :default: "" - The url of the proxy to be used when retrieving the information about - the latest version of phpMyAdmin. You need this if the server where - phpMyAdmin is installed does not have direct access to the internet. + The url of the proxy to be used when phpmyadmin needs to access the outside + intenet such as when retrieving the latest version info or submitting error + reports. You need this if the server where phpMyAdmin is installed does not + have direct access to the internet. The format is: "hostname:portnumber" -.. config:option:: $cfg['VersionCheckProxyUser'] +.. config:option:: $cfg['ProxyUser'] :type: string :default: "" @@ -1057,7 +1058,7 @@ Generic settings Authentication will be performed. No other types of authentication are currently supported. -.. config:option:: $cfg['VersionCheckProxyPass'] +.. config:option:: $cfg['ProxyPass'] :type: string :default: "" diff --git a/error_report.php b/error_report.php index c6e45cc864..3fc4981337 100644 --- a/error_report.php +++ b/error_report.php @@ -133,14 +133,14 @@ function send_error_report($report) { 'header' => 'Content-type: application/json', 'content' => $data_string ); - if (strlen($cfg['VersionCheckProxyUrl'])) { + if (strlen($cfg['ProxyUrl'])) { $context['http'] = array( - 'proxy' => $cfg['VersionCheckProxyUrl'], + 'proxy' => $cfg['ProxyUrl'], 'request_fulluri' => true ); - if (strlen($cfg['VersionCheckProxyUser'])) { + if (strlen($cfg['ProxyUser'])) { $auth = base64_encode( - $cfg['VersionCheckProxyUser'] . ':' . $cfg['VersionCheckProxyPass'] + $cfg['ProxyUser'] . ':' . $cfg['ProxyPass'] ); $context['http']['header'] = 'Proxy-Authorization: Basic ' . $auth; } @@ -152,13 +152,13 @@ function send_error_report($report) { ); } else if (function_exists('curl_init')) { $curl_handle = curl_init($submission_url); - if (strlen($cfg['VersionCheckProxyUrl'])) { - curl_setopt($curl_handle, CURLOPT_PROXY, $cfg['VersionCheckProxyUrl']); - if (strlen($cfg['VersionCheckProxyUser'])) { + if (strlen($cfg['ProxyUrl'])) { + curl_setopt($curl_handle, CURLOPT_PROXY, $cfg['ProxyUrl']); + if (strlen($cfg['ProxyUser'])) { curl_setopt( $curl_handle, CURLOPT_PROXYUSERPWD, - $cfg['VersionCheckProxyUser'] . ':' . $cfg['VersionCheckProxyPass'] + $cfg['ProxyUser'] . ':' . $cfg['ProxyPass'] ); } } diff --git a/libraries/config.default.php b/libraries/config.default.php index fc1f265839..66fe210b10 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -570,13 +570,14 @@ $cfg['VersionCheck'] = VERSION_CHECK_DEFAULT; /** * The url of the proxy to be used when retrieving the information about - * the latest version of phpMyAdmin. You need this if the server where - * phpMyAdmin is installed does not have direct access to the internet. + * the latest version of phpMyAdmin or error reporting. You need this if + * the server where phpMyAdmin is installed does not have direct access to + * the internet. * The format is: "hostname:portnumber" * - * @global string $cfg['VersionCheckProxyUrl'] + * @global string $cfg['ProxyUrl'] */ -$cfg['VersionCheckProxyUrl'] = ""; +$cfg['ProxyUrl'] = ""; /** * The username for authenticating with the proxy. By default, no @@ -584,16 +585,16 @@ $cfg['VersionCheckProxyUrl'] = ""; * Authentication will be performed. No other types of authentication * are currently supported. * - * @global string $cfg['VersionCheckProxyUser'] + * @global string $cfg['ProxyUser'] */ -$cfg['VersionCheckProxyUser'] = ""; +$cfg['ProxyUser'] = ""; /** * The password for authenticating with the proxy. * - * @global string $cfg['VersionCheckProxyPass'] + * @global string $cfg['ProxyPass'] */ -$cfg['VersionCheckProxyPass'] = ""; +$cfg['ProxyPass'] = ""; /** * maximum number of db's displayed in database list diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index 57331ffb97..e2cde7797e 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -521,12 +521,12 @@ $strConfigUserprefsDeveloperTab_name = __('Enable the Developer tab in settings' $strConfigVersionCheckLink = __('Check for latest version'); $strConfigVersionCheck_desc = __('Enables check for latest version on main phpMyAdmin page'); $strConfigVersionCheck_name = __('Version check'); -$strConfigVersionCheckProxyUrl_desc = __('The url of the proxy to be used when retrieving the information about the latest version of phpMyAdmin. You need this if the server where phpMyAdmin is installed does not have direct access to the internet. The format is: "hostname:portnumber"'); -$strConfigVersionCheckProxyUrl_name = __('Version check proxy url'); -$strConfigVersionCheckProxyUser_desc = __('The username for authenticating with the proxy. By default, no authentication is performed. If a username is supplied, Basic Authentication will be performed. No other types of authentication are currently supported.'); -$strConfigVersionCheckProxyUser_name = __('Version check proxy username'); -$strConfigVersionCheckProxyPass_desc = __('The password for authenticating with the proxy'); -$strConfigVersionCheckProxyPass_name = __('Version check proxy password'); +$strConfigProxyUrl_desc = __('The url of the proxy to be used when retrieving the information about the latest version of phpMyAdmin or when submitting error reports. You need this if the server where phpMyAdmin is installed does not have direct access to the internet. The format is: "hostname:portnumber"'); +$strConfigProxyUrl_name = __('Proxy url'); +$strConfigProxyUser_desc = __('The username for authenticating with the proxy. By default, no authentication is performed. If a username is supplied, Basic Authentication will be performed. No other types of authentication are currently supported.'); +$strConfigProxyUser_name = __('Proxy username'); +$strConfigProxyPass_desc = __('The password for authenticating with the proxy'); +$strConfigProxyPass_name = __('Proxy password'); $strConfigZipDump_desc = __('Enable [a@http://en.wikipedia.org/wiki/ZIP_(file_format)]ZIP[/a] compression for import and export operations'); $strConfigZipDump_name = __('ZIP'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index 1bfb0fae6a..339d340b24 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -140,10 +140,10 @@ $forms['Features']['Other_core_settings'] = array( 'DisableMultiTableMaintenance', 'UseDbSearch', 'VersionCheck', - 'VersionCheckProxyUrl', - 'VersionCheckProxyUser', - 'VersionCheckProxyPass', 'ErrorReporting' + 'ProxyUrl', + 'ProxyUser', + 'ProxyPass', ); $forms['Sql_queries']['Sql_queries'] = array( 'ShowSQL', diff --git a/version_check.php b/version_check.php index eac1fd2c44..ebbd4d42b1 100644 --- a/version_check.php +++ b/version_check.php @@ -21,16 +21,16 @@ if (isset($_SESSION['cache']['version_check']) $save = true; $file = 'http://www.phpmyadmin.net/home_page/version.json'; if (ini_get('allow_url_fopen')) { - if (strlen($cfg['VersionCheckProxyUrl'])) { + if (strlen($cfg['ProxyUrl'])) { $context = array( 'http' => array( - 'proxy' => $cfg['VersionCheckProxyUrl'], + 'proxy' => $cfg['ProxyUrl'], 'request_fulluri' => true ) ); - if (strlen($cfg['VersionCheckProxyUser'])) { + if (strlen($cfg['ProxyUser'])) { $auth = base64_encode( - $cfg['VersionCheckProxyUser'] . ':' . $cfg['VersionCheckProxyPass'] + $cfg['ProxyUser'] . ':' . $cfg['ProxyPass'] ); $context['http']['header'] = 'Proxy-Authorization: Basic ' . $auth; } @@ -44,13 +44,13 @@ if (isset($_SESSION['cache']['version_check']) } } else if (function_exists('curl_init')) { $curl_handle = curl_init($file); - if (strlen($cfg['VersionCheckProxyUrl'])) { - curl_setopt($curl_handle, CURLOPT_PROXY, $cfg['VersionCheckProxyUrl']); - if (strlen($cfg['VersionCheckProxyUser'])) { + if (strlen($cfg['ProxyUrl'])) { + curl_setopt($curl_handle, CURLOPT_PROXY, $cfg['ProxyUrl']); + if (strlen($cfg['ProxyUser'])) { curl_setopt( $curl_handle, CURLOPT_PROXYUSERPWD, - $cfg['VersionCheckProxyUser'] . ':' . $cfg['VersionCheckProxyPass'] + $cfg['ProxyUser'] . ':' . $cfg['ProxyPass'] ); } }