[Vtigercrm-developers] Extension Store behind firewall needs proxy config

Kozure wneuberth at idexcorp.com
Fri Mar 4 12:05:12 GMT 2016


Hi Al,

*@Extension store behind (company) proxy:*
curl proxy settings in:

.\<vtiger root>\modules\Settings\ExtensionStore\libraries\*RestClient.php*

   public function __construct() {
        global $site_URL, $current_vtiger_version;

        $this->defaultOptions[CURLOPT_REFERER] = $site_URL;
        $this->defaultOptions[CURLOPT_USERAGENT] = self::$name . '/' .
self::$version . '(CRM ' . $current_vtiger_version . ')';
        $this->defaultOptions[CURLOPT_RETURNTRANSFER] = true;
        $this->defaultOptions[CURLOPT_FOLLOWLOCATION] = true;
        $this->defaultOptions[CURLOPT_MAXREDIRS] = 5;
        $this->defaultOptions[CURLOPT_SSL_VERIFYPEER] = 0;
        $this->defaultOptions[CURLOPT_SSL_VERIFYHOST] = 0;
        $this->defaultOptions[CURLOPT_TIMEOUT] = 30;
*        // new proxy settings start*
        $this->defaultOptions[CURLOPT_PROXY] = *'user:password at proxy:port';*
       * $this->defaultOptions[CURLOPT_HTTPPROXYTUNNEL] = 1;*
        *// new proxy settings end*
        $this->defaultHeaders['Content-Type'] =
'application/x-www-form-urlencoded';
        $this->defaultHeaders['Cache-Control'] = 'no-cache';
    }

*@Enable Credit Card payment behind (company) proxy for extension store: *

.\<vtigerroot>\include\Zend\Http\Client\Adapter\*Proxy.php*

class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
{
    /**
     * Parameters array
     *
     * @var array
     */
    protected $config = array(
        'ssltransport'  => 'ssl',
        'sslcert'       => null,
        'sslpassphrase' => null,
        'sslusecontext' => false,
        'proxy_host'    => '*<proxyserver>*',
        'proxy_port'    => *<port>*,
        'proxy_user'    => '*<user>*',
        'proxy_pass'    => '*<password>*',
        'proxy_auth'    => Zend_Http_Client::AUTH_BASIC,
        'persistent'    => false
    );

Just enter the proxy related data in the *<placeholder>*.

With* both modifications* (Proxy.php and RestClient.php) the market place
and the saving of the credit card information works.

Another effect: My Vtiger Installation now runs superfast … before, the
dashboard takes up to some minutes until all Widgets were loaded with data …
calling another modul or option also takes long … now all works within some
seconds ;)

*@If this post is related to your extension geo tools:*

with the following changes in .\modules\GeoTools\models\OSMGeoCoder.php
around line 48 the geocoder works behind the (company) proxy:

	   $request_url = self::APIURL . "?q=" . $address . "&" .
http_build_query($params);
                    
               * // proxy settings start*
                    $auth = base64_encode('user:password');

                    $aContext = array(
                        'http' => array(
                            'proxy' => 'tcp://proxyserver:port',
                            'request_fulluri' => true,
                            'header' => "Proxy-Authorization: Basic $auth",
                        ),
                    );
                    $cxContext = stream_context_create($aContext);

                    $result = file_get_contents($request_url, False,
$cxContext);

               * // proxy settings end*

                // $result = file_get_contents($request_url);

Cheers,

Kozure



--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-Extension-Store-behind-firewall-needs-proxy-config-tp18545p18555.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.



More information about the vtigercrm-developers mailing list