From d6a6b37cdef8bba8f7a6e951f3d27488816bcaf6 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Wed, 24 Sep 2003 05:23:29 +0000 Subject: [PATCH] use proxy authentication if needed --- phpgwapi/inc/class.network.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.network.inc.php b/phpgwapi/inc/class.network.inc.php index eaaa88c9bd..f0ccdd7676 100644 --- a/phpgwapi/inc/class.network.inc.php +++ b/phpgwapi/inc/class.network.inc.php @@ -200,9 +200,16 @@ if ($GLOBALS['phpgw_info']['server']['httpproxy_server']) { + $proxyAuth = ''; + if(!empty($GLOBALS['phpgw_info']['server']['httpproxy_server_username'])) + { + $proxyUsername = $GLOBALS['phpgw_info']['server']['httpproxy_server_username']; + $proxyPassword = $GLOBALS['phpgw_info']['server']['httpproxy_server_password']; + $proxyAuth = 'Proxy-Authorization: Basic '.base64_encode("$proxyUsername:$proxyPassword")."\n"; + } if ($this->open_port($server,80, 15)) { - if (! $this->write_port('GET http://' . $server . $file . ' HTTP/1.0'."\n".$auth."\r\n\r\n")) + if (! $this->write_port('GET http://' . $server . $file . ' HTTP/1.0'."\n".$proxyAuth.$auth."\r\n\r\n")) { return False; }