From aa10bc53a580133b708923a3faf461d9ef7b4430 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 23 Sep 2014 13:43:09 +0000 Subject: [PATCH] need to set context even for no proxy, if we need optional authentication --- phpgwapi/inc/class.egw_framework.inc.php | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 6ad516ef55..eee94e49c9 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -986,22 +986,22 @@ abstract class egw_framework */ public static function proxy_context($username=null, $password=null) { - if (empty($GLOBALS['egw_info']['server']['httpproxy_server'])) - { - return null; - } - - $opts = array ( + $opts = array( 'method' => 'GET', - 'proxy' => 'tcp://'.$GLOBALS['egw_info']['server']['httpproxy_server'].':'. - ($GLOBALS['egw_info']['server']['httpproxy_port'] ? $GLOBALS['egw_info']['server']['httpproxy_port'] : 8080), - 'request_fulluri' => true, ); - // proxy authentication - if (!empty($GLOBALS['egw_info']['server']['httpproxy_server_username'])) + if (!empty($GLOBALS['egw_info']['server']['httpproxy_server'])) { - $opts['header'][] = 'Proxy-Authorization: Basic '.base64_encode($GLOBALS['egw_info']['server']['httpproxy_server_username'].':'. - $GLOBALS['egw_info']['server']['httpproxy_server_password']); + $opts += array ( + 'proxy' => 'tcp://'.$GLOBALS['egw_info']['server']['httpproxy_server'].':'. + ($GLOBALS['egw_info']['server']['httpproxy_port'] ? $GLOBALS['egw_info']['server']['httpproxy_port'] : 8080), + 'request_fulluri' => true, + ); + // proxy authentication + if (!empty($GLOBALS['egw_info']['server']['httpproxy_server_username'])) + { + $opts['header'][] = 'Proxy-Authorization: Basic '.base64_encode($GLOBALS['egw_info']['server']['httpproxy_server_username'].':'. + $GLOBALS['egw_info']['server']['httpproxy_server_password']); + } } // optional authentication if (isset($username))