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:
@@ -197,6 +197,22 @@ class soapNtlm {
|
||||
curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
|
||||
//curl_setopt($this->ch, CURLOPT_USERPWD, $this->options['auth']); // Hugo's code
|
||||
curl_setopt($this->ch, CURLOPT_USERPWD, $this->getuser().':'.$this->getpassword());// Ankit's code
|
||||
|
||||
//Apply proxy settings
|
||||
if (class_exists('System')) {
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($this->ch, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($this->ch, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
}
|
||||
|
||||
echo $this->buffer = curl_exec($this->ch);
|
||||
|
||||
//echo "[NTLMStream::createBuffer] buffer size : " . strlen($this->buffer) . "bytes<br>";
|
||||
@@ -229,6 +245,22 @@ class NTLMSoapClient extends SoapClient {
|
||||
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
|
||||
//curl_setopt($ch, CURLOPT_USERPWD, $this->options['auth']); //Hugo's Code
|
||||
curl_setopt($ch, CURLOPT_USERPWD, $this->user.':'.$this->password); //Ankit's Code
|
||||
|
||||
//Apply proxy settings
|
||||
if (class_exists('System')) {
|
||||
$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:'));
|
||||
}
|
||||
}
|
||||
|
||||
$response = curl_exec($ch);
|
||||
|
||||
return $response;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -3334,7 +3334,21 @@ class Processes {
|
||||
global $client;
|
||||
$endpoint = PML_WSDL_URL;
|
||||
$sessionId = '';
|
||||
$client = new SoapClient( $endpoint );
|
||||
$proxy = array();
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
$proxy['proxy_host'] = $sysConf['proxy_host'];
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
$proxy['proxy_port'] = $sysConf['proxy_port'];
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
$proxy['proxy_login'] = $sysConf['proxy_user'];
|
||||
}
|
||||
if ($sysConf['proxy_pass'] != '') {
|
||||
$proxy['proxy_password'] = $sysConf['proxy_pass'];
|
||||
}
|
||||
}
|
||||
$client = new SoapClient($endpoint, $proxy);
|
||||
|
||||
$params = array('userid'=>$user, 'password'=>$pass );
|
||||
$result = $client->__SoapCall('login', array($params));
|
||||
@@ -3360,7 +3374,21 @@ class Processes {
|
||||
$sessionId = '';
|
||||
ini_set("soap.wsdl_cache_enabled", "0"); // enabling WSDL cache
|
||||
try {
|
||||
$client = @new SoapClient( $endpoint );
|
||||
$proxy = array();
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
$proxy['proxy_host'] = $sysConf['proxy_host'];
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
$proxy['proxy_port'] = $sysConf['proxy_port'];
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
$proxy['proxy_login'] = $sysConf['proxy_user'];
|
||||
}
|
||||
if ($sysConf['proxy_pass'] != '') {
|
||||
$proxy['proxy_password'] = $sysConf['proxy_pass'];
|
||||
}
|
||||
}
|
||||
$client = @new SoapClient($endpoint, $proxy);
|
||||
} catch (Exception $e) {
|
||||
throw ( new Exception ( $e->message ) );
|
||||
}
|
||||
@@ -3378,7 +3406,21 @@ class Processes {
|
||||
global $client;
|
||||
|
||||
$endpoint = PML_WSDL_URL;
|
||||
$client = new SoapClient( $endpoint );
|
||||
$proxy = array();
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
$proxy['proxy_host'] = $sysConf['proxy_host'];
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
$proxy['proxy_port'] = $sysConf['proxy_port'];
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
$proxy['proxy_login'] = $sysConf['proxy_user'];
|
||||
}
|
||||
if ($sysConf['proxy_pass'] != '') {
|
||||
$proxy['proxy_password'] = $sysConf['proxy_pass'];
|
||||
}
|
||||
}
|
||||
$client = new SoapClient($endpoint, $proxy);
|
||||
|
||||
$sessionId = '';
|
||||
$params = array('sessionId'=>$sessionId );
|
||||
@@ -3433,7 +3475,21 @@ class Processes {
|
||||
global $client;
|
||||
|
||||
$endpoint = PML_WSDL_URL;
|
||||
$client = new SoapClient( $endpoint );
|
||||
$proxy = array();
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
$proxy['proxy_host'] = $sysConf['proxy_host'];
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
$proxy['proxy_port'] = $sysConf['proxy_port'];
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
$proxy['proxy_login'] = $sysConf['proxy_user'];
|
||||
}
|
||||
if ($sysConf['proxy_pass'] != '') {
|
||||
$proxy['proxy_password'] = $sysConf['proxy_pass'];
|
||||
}
|
||||
}
|
||||
$client = new SoapClient($endpoint, $proxy);
|
||||
|
||||
$sessionId = '';
|
||||
$params = array('sessionId'=>$sessionId , 'processId'=> $proId);
|
||||
|
||||
@@ -50,7 +50,7 @@ class serverConf {
|
||||
private $pmVersion;
|
||||
private $pmProduct = 'PMCE';
|
||||
private $nextBeatDate;
|
||||
var $logins;
|
||||
public $logins;
|
||||
private $lanDirection;
|
||||
private $lanLanguage;
|
||||
public $workspaces = array();
|
||||
|
||||
@@ -81,6 +81,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
|
||||
$handlerTotal = curl_init ($solrIntruct);
|
||||
curl_setopt ($handlerTotal, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handlerTotal, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handlerTotal, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handlerTotal, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handlerTotal, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$responseTotal = curl_exec ($handlerTotal);
|
||||
curl_close ($handlerTotal);
|
||||
|
||||
@@ -150,6 +164,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
// search the cases in base to datatable parameters
|
||||
$handler = curl_init ($solrIntruct);
|
||||
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
curl_close ($handler);
|
||||
|
||||
@@ -187,6 +215,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
)); // -H
|
||||
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
|
||||
curl_setopt ($handler, CURLOPT_POSTFIELDS, $solrUpdateDocument->document); // data
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
curl_close ($handler);
|
||||
|
||||
@@ -221,6 +263,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
)); // -H
|
||||
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
|
||||
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<commit/>"); // data
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
curl_close ($handler);
|
||||
|
||||
@@ -256,6 +312,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
)); // -H
|
||||
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
|
||||
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<rollback/>"); // data
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
curl_close ($handler);
|
||||
|
||||
@@ -291,6 +361,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
)); // -H
|
||||
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
|
||||
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<optimize/>"); // data
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
curl_close ($handler);
|
||||
|
||||
@@ -321,6 +405,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
|
||||
$handler = curl_init ($solrIntruct);
|
||||
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
curl_close ($handler);
|
||||
// decode
|
||||
@@ -358,6 +456,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
)); // -H
|
||||
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
|
||||
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<delete><query>*:*</query></delete>"); // data
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
|
||||
curl_close ($handler);
|
||||
@@ -395,6 +507,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
)); // -H
|
||||
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
|
||||
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<delete><query>" . $idQuery . "</query></delete>"); // data
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
|
||||
curl_close ($handler);
|
||||
@@ -466,6 +592,20 @@ class BpmnEngine_SearchIndexAccess_Solr
|
||||
// search the cases in base to datatable parameters
|
||||
$handler = curl_init ($solrIntruct);
|
||||
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ($handler);
|
||||
curl_close ($handler);
|
||||
|
||||
|
||||
@@ -1010,6 +1010,7 @@ class System {
|
||||
|
||||
if ($_SESSION['PROCESSMAKER_ENV_HASH'] === $hash) {
|
||||
$_SESSION['PROCESSMAKER_ENV']['from_cache'] = 1;
|
||||
$_SESSION['PROCESSMAKER_ENV_HASH']['proxy_pass'] = G::decrypt($_SESSION['PROCESSMAKER_ENV_HASH']['proxy_pass'], 'proxy_pass');
|
||||
return $_SESSION['PROCESSMAKER_ENV'];
|
||||
}
|
||||
}
|
||||
@@ -1026,7 +1027,11 @@ class System {
|
||||
'memcached' => 0,
|
||||
'memcached_server' => '',
|
||||
'default_skin' => 'classic',
|
||||
'default_lang' => 'en'
|
||||
'default_lang' => 'en',
|
||||
'proxy_host' => '',
|
||||
'proxy_port' => '',
|
||||
'proxy_user' => '',
|
||||
'proxy_pass' => ''
|
||||
);
|
||||
|
||||
// read the global env.ini configuration file
|
||||
@@ -1042,6 +1047,10 @@ class System {
|
||||
// validation debug config, only binary value is valid; debug = 1, to enable
|
||||
$config['debug'] = $config['debug'] == 1 ? 1 : 0;
|
||||
|
||||
if ($config['proxy_pass'] != '') {
|
||||
$config['proxy_pass'] = G::decrypt($config['proxy_pass'], 'proxy_pass');
|
||||
}
|
||||
|
||||
$md5 = array();
|
||||
if ($readGlobalIniFile)
|
||||
$md5[] = md5_file($globalIniFile);
|
||||
|
||||
@@ -191,6 +191,19 @@ class Zimbra {
|
||||
curl_setopt($this->_curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($this->_curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($this->_curl, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($this->_curl, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($this->_curl, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($this->_curl, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$preauth = $this->getPreAuth($this->_username);
|
||||
$header = '<context xmlns="urn:zimbraAccount' . (($this->_admin) ? 'Admin' : '') . '"><session/></context>';
|
||||
|
||||
|
||||
@@ -16,6 +16,27 @@
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
|
||||
function getSoapClientOptions() {
|
||||
$options = array('trace' => 1);
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
$options['proxy_host'] = $sysConf['proxy_host'];
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
$options['proxy_port'] = $sysConf['proxy_port'];
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
$options['proxy_login'] = $sysConf['proxy_user'];
|
||||
}
|
||||
if ($sysConf['proxy_pass'] != '') {
|
||||
$options['proxy_password'] = $sysConf['proxy_pass'];
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* This collection of triggers allows to interact by getting and sending information to SugarCRM
|
||||
* @class pmSugar
|
||||
@@ -25,7 +46,7 @@
|
||||
*/
|
||||
|
||||
function sugarLogin($sugarSoap, $user, $password) {
|
||||
$client = new SoapClient ( $sugarSoap, array ('trace' => 1 ) );
|
||||
$client = new SoapClient ( $sugarSoap, getSoapClientOptions() );
|
||||
$auth_array = array ('user_auth' => array ('user_name' => $user, 'password' => md5 ( $password ), 'version' => '1.0' ) );
|
||||
$login_results = $client->__SoapCall ( 'login', $auth_array );
|
||||
|
||||
@@ -67,7 +88,7 @@ function objectToArray($object) {
|
||||
|
||||
function GetSugarEntry($sugarSoap, $user, $password, $module, $id, $selectFields, $linkNameToFieldsArray, $resultType = 'array') {
|
||||
$sessionId = sugarLogin ( $sugarSoap, $user, $password );
|
||||
$client = new SoapClient ( $sugarSoap, array ('trace' => 1 ) );
|
||||
$client = new SoapClient ( $sugarSoap, getSoapClientOptions() );
|
||||
$request_array = array ('session' => $sessionId, 'module_name' => $module, 'id' => $id,
|
||||
'select_fields' => $select_fields, 'link_name_to_fields_array' => $linkNameToFieldsArray);
|
||||
$sugarEntry = $client->__SoapCall ( 'get_entry', $request_array );
|
||||
@@ -103,7 +124,7 @@ function GetSugarEntry($sugarSoap, $user, $password, $module, $id, $selectFields
|
||||
|
||||
function GetSugarEntries($sugarSoap, $user, $password, $module, $query, $orderBy, $selectedFields, $maxResults, $resultType="array") {
|
||||
$sessionId = sugarLogin ( $sugarSoap, $user, $password );
|
||||
$client = new SoapClient ( $sugarSoap, array ('trace' => 1 ) );
|
||||
$client = new SoapClient ( $sugarSoap, getSoapClientOptions() );
|
||||
$request_array = array ('session' => $sessionId, 'module_name' => $module, 'query' => $query, 'order_by' => $orderBy, 'offset'=>"", 'select_fields'=>"", 'max_result'=>$maxResults );
|
||||
$sugarEntriesO = $client->__SoapCall ( 'get_entry_list', $request_array );
|
||||
|
||||
@@ -266,7 +287,7 @@ function CreateSugarAccount($sugarSoap, $user, $password, $name, $resultType="a
|
||||
|
||||
$module = "Accounts";
|
||||
$sessionId = sugarLogin ( $sugarSoap, $user, $password );
|
||||
$client = new SoapClient ( $sugarSoap, array ('trace' => 1 ) );
|
||||
$client = new SoapClient ( $sugarSoap, getSoapClientOptions() );
|
||||
$request_array = array ('session' => $sessionId, 'module_name' => $module, 'name_value_list' => array(
|
||||
array("name" => 'name', "value" => $name )
|
||||
) );
|
||||
@@ -315,7 +336,7 @@ function CreateSugarContact($sugarSoap, $user, $password, $first_name, $last_nam
|
||||
);
|
||||
*/
|
||||
$sessionId = sugarLogin ( $sugarSoap, $user, $password );
|
||||
$client = new SoapClient ( $sugarSoap, array ('trace' => 1 ) );
|
||||
$client = new SoapClient ( $sugarSoap, getSoapClientOptions() );
|
||||
|
||||
$request_array = array ('session' => $sessionId, 'module_name' => $module, array(
|
||||
array("name" => 'first_name',"value" => $first_name),
|
||||
@@ -374,7 +395,7 @@ function CreateSugarOpportunity($sugarSoap, $user, $password, $name,$account_id,
|
||||
);*/
|
||||
|
||||
$sessionId = sugarLogin ( $sugarSoap, $user, $password );
|
||||
$client = new SoapClient ( $sugarSoap, array ('trace' => 1 ) );
|
||||
$client = new SoapClient ( $sugarSoap, getSoapClientOptions() );
|
||||
|
||||
$request_array = array ('session' => $sessionId, 'module_name' => $module, 'name_value_list' =>array(
|
||||
array('name' => 'name','value' => $name),
|
||||
@@ -423,7 +444,7 @@ function CreateSugarLeads($sugarSoap, $user, $password, $first_name, $last_name,
|
||||
|
||||
$module = "Leads";
|
||||
$sessionId = sugarLogin ( $sugarSoap, $user, $password );
|
||||
$client = new SoapClient ( $sugarSoap, array ('trace' => 1 ) );
|
||||
$client = new SoapClient ( $sugarSoap, getSoapClientOptions() );
|
||||
|
||||
$request_array = array ('session' => $sessionId, 'module_name' => $module, array(
|
||||
array("name" => 'first_name',"value" => $first_name),
|
||||
|
||||
@@ -42,6 +42,20 @@
|
||||
*/
|
||||
function executeTalendWebservice($wsdl,$params=array(), $message){
|
||||
$client = new SoapClient($wsdl,array('trace' => 1));
|
||||
|
||||
//Apply proxy settings
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
curl_setopt($client, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
curl_setopt($client, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
curl_setopt($client, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
||||
}
|
||||
curl_setopt($client, CURLOPT_HTTPHEADER, array('Expect:'));
|
||||
}
|
||||
|
||||
$params[0]="";
|
||||
foreach($params as $paramO){
|
||||
$params[]="--context_param".$paramO[0]."=".$paramO[1];
|
||||
|
||||
@@ -383,6 +383,20 @@ 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";
|
||||
|
||||
@@ -71,6 +71,21 @@ class adminProxy extends HttpProxyController
|
||||
$updatedConf['memory_limit'] = $httpData->memory_limit;
|
||||
}
|
||||
|
||||
if ($sysConf['proxy_host'] != $httpData->proxy_host) {
|
||||
$updatedConf['proxy_host'] = $httpData->proxy_host;
|
||||
}
|
||||
|
||||
if ($sysConf['proxy_port'] != $httpData->proxy_port) {
|
||||
$updatedConf['proxy_port'] = $httpData->proxy_port;
|
||||
}
|
||||
|
||||
if ($sysConf['proxy_user'] != $httpData->proxy_user) {
|
||||
$updatedConf['proxy_user'] = $httpData->proxy_user;
|
||||
}
|
||||
|
||||
if ($sysConf['proxy_pass'] != $httpData->proxy_pass) {
|
||||
$updatedConf['proxy_pass'] = G::encrypt($httpData->proxy_pass, 'proxy_pass');
|
||||
}
|
||||
|
||||
if ($updateRedirector) {
|
||||
if (!file_exists(PATH_HTML . 'index.html')) {
|
||||
|
||||
@@ -51,10 +51,21 @@ function file_get_conditional_contents($szURL){
|
||||
curl_setopt ( $pCurl, CURLOPT_CONNECTTIMEOUT, 10 );
|
||||
curl_setopt ( $pCurl, CURLOPT_TIMEOUT, 20 );
|
||||
|
||||
curl_setopt ( $pCurl, CURLOPT_NOPROGRESS, FALSE);
|
||||
curl_setopt ( $pCurl, CURLOPT_VERBOSE, TRUE);
|
||||
|
||||
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:'));
|
||||
}
|
||||
|
||||
$szContents = curl_exec($pCurl);
|
||||
$aInfo = curl_getinfo($pCurl);
|
||||
@@ -245,6 +256,19 @@ function buildData(){
|
||||
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
|
||||
curl_setopt ( $ch, CURLOPT_TIMEOUT, 20 );
|
||||
|
||||
//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:'));
|
||||
}
|
||||
|
||||
$response = curl_exec ( $ch );
|
||||
$curl_session = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
$headers = curl_getinfo ( $ch );
|
||||
|
||||
@@ -142,7 +142,24 @@ switch ($_POST ['action']) {
|
||||
$endpoint = isset ( $_SESSION ['END_POINT'] ) ? $_SESSION ['END_POINT'] : $defaultEndpoint;
|
||||
|
||||
$sessionId = isset ( $_SESSION ['SESSION_ID'] ) ? $_SESSION ['SESSION_ID'] : '';
|
||||
@$client = new SoapClient ( $endpoint );
|
||||
|
||||
//Apply proxy settings
|
||||
$proxy = array();
|
||||
$sysConf = System::getSystemConfiguration();
|
||||
if ($sysConf['proxy_host'] != '') {
|
||||
$proxy['proxy_host'] = $sysConf['proxy_host'];
|
||||
if ($sysConf['proxy_port'] != '') {
|
||||
$proxy['proxy_port'] = $sysConf['proxy_port'];
|
||||
}
|
||||
if ($sysConf['proxy_user'] != '') {
|
||||
$proxy['proxy_login'] = $sysConf['proxy_user'];
|
||||
}
|
||||
if ($sysConf['proxy_pass'] != '') {
|
||||
$proxy['proxy_password'] = $sysConf['proxy_pass'];
|
||||
}
|
||||
}
|
||||
|
||||
@$client = new SoapClient($endpoint, $proxy);
|
||||
|
||||
switch ($action) {
|
||||
case "Login" :
|
||||
|
||||
@@ -112,7 +112,7 @@ Ext.onReady(function(){
|
||||
});
|
||||
|
||||
xfieldsBelow = new Ext.form.FieldSet({
|
||||
title: '',
|
||||
title: _('ID_PREFERENCES'),
|
||||
items : [
|
||||
cmbSkins,
|
||||
cmbLang,
|
||||
@@ -127,6 +127,65 @@ Ext.onReady(function(){
|
||||
]
|
||||
});
|
||||
|
||||
var proxyConfigurationFields = new Ext.form.FieldSet({
|
||||
title: _('ID_PROXY_SETTINGS'),
|
||||
items: [
|
||||
{
|
||||
xtype: 'textfield',
|
||||
id: 'proxy_host',
|
||||
name: 'proxy_host',
|
||||
fieldLabel: _('ID_PROXY_HOST'),
|
||||
width: 200,
|
||||
value: sysConf.proxy_host,
|
||||
listeners:{
|
||||
change: function(){
|
||||
changeSettings();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'numberfield',
|
||||
id: 'proxy_port',
|
||||
name: 'proxy_port',
|
||||
fieldLabel: _('ID_PROXY_PORT'),
|
||||
width: 100,
|
||||
value: sysConf.proxy_port,
|
||||
listeners:{
|
||||
change: function(){
|
||||
changeSettings();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'textfield',
|
||||
id: 'proxy_user',
|
||||
name: 'proxy_user',
|
||||
fieldLabel: _('ID_PROXY_USER'),
|
||||
width: 200,
|
||||
value: sysConf.proxy_user,
|
||||
listeners:{
|
||||
change: function(){
|
||||
changeSettings();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'textfield',
|
||||
inputType: 'password',
|
||||
id: 'proxy_pass',
|
||||
name: 'proxy_pass',
|
||||
fieldLabel: _('ID_PROXY_PASSWORD'),
|
||||
width: 200,
|
||||
value: sysConf.proxy_pass,
|
||||
listeners:{
|
||||
change: function(){
|
||||
changeSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
var frm = new Ext.FormPanel({
|
||||
title: ' ',
|
||||
id:'frm',
|
||||
@@ -143,7 +202,7 @@ Ext.onReady(function(){
|
||||
msgTarget: 'side',
|
||||
align:'center'
|
||||
},
|
||||
items:[ xfieldsUp, xfieldsBelow ],
|
||||
items:[ xfieldsUp, xfieldsBelow, proxyConfigurationFields ],
|
||||
buttons : [saveButton]
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user