BUG 9688 Plugin Updates dont work when proxy is required SOLVED

- There are not way to set the proxy to use
- Added settings for the proxy in ProcessMaker
This commit is contained in:
Julio Cesar Laura
2012-09-19 14:48:38 -04:00
parent 7675e3ef82
commit c312bc95e5
14 changed files with 691 additions and 249 deletions

View File

@@ -383,25 +383,39 @@ function uploadZimbraFile($ServerUrl, $username, $preAuthKey, $folderName, $file
curl_setopt ($ch, CURLOPT_NOPROGRESS, false);
curl_setopt ($ch, CURLOPT_VERBOSE, true);
curl_setopt ($ch, CURLOPT_HTTPHEADER,$header_array);
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($ch, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($ch, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
}
if( ! $response = curl_exec($ch))
{
return "Upload error. Connection Error";
}
//G::pr($response);
$header_size = curl_getinfo($ch,CURLINFO_HEADER_SIZE);
$result['header'] = substr($response, 0, $header_size);
$result['body'] = substr( $response, $header_size );
$result['http_code'] = curl_getinfo($ch,CURLINFO_HTTP_CODE);
$result['last_url'] = curl_getinfo($ch,CURLINFO_EFFECTIVE_URL);
$aString = array();
$aExplode = explode(",", $result['body']);
$uploadID = substr($aExplode[2], 1, -2);
curl_close($ch);
// gettin FOlder ID
$FolderResult = $oZimbraObj->getFolder($folderName);