Merge pull request #888 from owncloud/add_curl_proxy
add curl proxy support.
This commit is contained in:
commit
96100fb447
|
@ -42,6 +42,12 @@ $CONFIG = array(
|
|||
/* Time in seconds how long an user is authenticated without entering his password again before performing sensitive actions like creating or deleting users etc...*/
|
||||
"enhancedauthtime" => 15 * 60,
|
||||
|
||||
/* A proxy to use to connect to the internet. For example "myproxy.org:88" */
|
||||
"proxy" => "",
|
||||
|
||||
/* The optional authentication for the proxy to use to connect to the internet. The format is: [username]:[password] */
|
||||
"proxyuserpwd" => "",
|
||||
|
||||
/* Theme to use for ownCloud */
|
||||
"theme" => "",
|
||||
|
||||
|
|
|
@ -678,6 +678,12 @@ class OC_Util {
|
|||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler");
|
||||
if(OC_Config::getValue('proxy','')<>'') {
|
||||
curl_setopt($curl, CURLOPT_PROXY, OC_Config::getValue('proxy'));
|
||||
}
|
||||
if(OC_Config::getValue('proxyuserpwd','')<>'') {
|
||||
curl_setopt($curl, CURLOPT_PROXYUSERPWD, OC_Config::getValue('proxyuserpwd'));
|
||||
}
|
||||
$data = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
|
@ -693,7 +699,6 @@ class OC_Util {
|
|||
$data=@file_get_contents($url, 0, $ctx);
|
||||
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue