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

@@ -32,8 +32,36 @@ class dashletRssReader implements DashletInterface {
}
public function render ($width = 300) {
$self->url = $this->urlFrom;
$self->rss = @simplexml_load_file($self->url);
$pCurl = curl_init();
curl_setopt($pCurl, CURLOPT_URL, $this->urlFrom);
curl_setopt($pCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($pCurl, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($pCurl, CURLOPT_AUTOREFERER, true);
//To avoid SSL error
curl_setopt($pCurl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($pCurl, CURLOPT_SSL_VERIFYPEER, 0);
//To avoid timeouts
curl_setopt($pCurl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($pCurl, CURLOPT_TIMEOUT, 20);
curl_setopt($pCurl, CURLOPT_NOPROGRESS, false);
curl_setopt($pCurl, CURLOPT_VERBOSE, true);
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($pCurl, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($pCurl, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($pCurl, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($pCurl, CURLOPT_HTTPHEADER, array('Expect:'));
}
$self->rss = @simplexml_load_string(curl_exec($pCurl));
if($self->rss)
{
$index= 0;