mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
need to set context even for no proxy, if we need optional authentication
This commit is contained in:
parent
0b61fd4184
commit
aa10bc53a5
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user