Skip to content

Commit

Permalink
ONAPP-1587 [WHMCS] Unable to select the template on buying the produc…
Browse files Browse the repository at this point in the history
…t from OnAppVPS module

ONAPP-1596 The “Country“ and “City“ field is shown in "Configuration option" on buying the OnAppVPS product.

ONAPP-1593 [WHMCS] The default template values are not set on selecting template.
  • Loading branch information
SlavaKatiukha committed Aug 2, 2024
1 parent c9d6cc6 commit 0cb62c0
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 134 deletions.
36 changes: 24 additions & 12 deletions includes/onappWrapper/class.OnApp_Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class NewOnApp_Connection
* @var NewOnApp_WrapperAPI
*/
protected $_api;

private $apiVersion;

public function setconnection($params, $user = false)
Expand All @@ -22,18 +22,18 @@ public function setconnection($params, $user = false)
if (!$user)
$this->_api = new NewOnApp_WrapperAPI(NewOnApp_WrapperAPI::getHostname($params), $params['serverusername'], $params['serverpassword']);
else {

$this->_api = new NewOnApp_WrapperAPI(NewOnApp_WrapperAPI::getHostname($params), trim($params['username']), trim(htmlspecialchars_decode($params['password'])));

}
}

public function setapi(NewOnApp_WrapperAPI $api)
{

$this->_api = $api;
}

/**
* Get API
*
Expand All @@ -43,7 +43,7 @@ public function getApi()
{
return $this->_api;
}

public function setDetails($auth)
{
$this->_api = new NewOnApp_WrapperAPI($this->_api->getHost(), $auth['email'], $auth['key']);
Expand All @@ -57,15 +57,15 @@ public function isSuccess()
else
return false;
}

public function error()
{
if ($this->_api->getError())
return $this->_api->getError();
else
return false;
}

public function lb_error()
{
$response = $this->_api->getResponse();
Expand All @@ -78,19 +78,19 @@ public function getResponse()
{
return $this->_api->getResponse();
}

public function getHostname($params)
{
return NewOnApp_WrapperAPI::getHostname($params);
}

public function setTimeOut($timeout)
{
if (!$timeout)
return false;
$this->_api->setTimeout((int)$timeout);
}

public function getVersion()
{
if(!is_null($this->apiVersion)){
Expand All @@ -102,5 +102,17 @@ public function getVersion()
}
return $this->apiVersion = $res['version'];
}

public function hasFederationSupport()
{
$version = $this->getVersion();
$version = preg_replace("/[^0-9.]/", "", $version);

if ($version && version_compare($version, "7.1", '<')) {
return true;
}

return false;
}
}

Loading

0 comments on commit 0cb62c0

Please sign in to comment.