Bind CURL calls to WHMCS to ipv4 adapter because WHMCS IP whitelist
doesn't support IPv6 * Fixes WHMCS login for all airtime.pro users
This commit is contained in:
parent
94d9577539
commit
183fa7b3a3
|
@ -572,6 +572,7 @@ class BillingController extends Zend_Controller_Action {
|
|||
try {
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
@ -598,4 +599,4 @@ class BillingController extends Zend_Controller_Action {
|
|||
throw new Exception("Invalid client ID: " . Application_Model_Preference::GetClientId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$user = Application_Model_User::GetCurrentUser();
|
||||
$userType = $user->getType();
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
|
||||
//$this->view->headScript()->appendScript($this->generateGoogleTagManagerDataLayerJavaScript());
|
||||
$this->view->headScript()->appendScript($this->generateGoogleTagManagerDataLayerJavaScript());
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -439,6 +439,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
|
||||
|
|
|
@ -155,6 +155,7 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
|
|||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL);
|
||||
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||
|
@ -164,7 +165,8 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
|
|||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
$jsondata = curl_exec($ch);
|
||||
if (curl_error($ch)) {
|
||||
die(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
|
||||
Logging::error("Failed to reach WHMCS server in " . __FUNCTION__ . ": "
|
||||
. curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
|
||||
//die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch));
|
||||
}
|
||||
curl_close($ch);
|
||||
|
@ -201,6 +203,7 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
|
|||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL);
|
||||
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||
|
@ -210,7 +213,8 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
|
|||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
$jsondata = curl_exec($ch);
|
||||
if (curl_error($ch)) {
|
||||
die(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
|
||||
Logging::error("Failed to reach WHMCS server in " . __FUNCTION__ . ": "
|
||||
. curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
|
||||
//die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch));
|
||||
}
|
||||
curl_close($ch);
|
||||
|
@ -255,4 +259,4 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue