- Compatible XF Versions
- 1.2
- 1.3
- 1.4
- 1.5
Then, here in the file:
Code:
protected $_licenseData = null;
protected $_lcUrl = 'http://brivium.com/index.php?license';
protected function _checkLicense()
{
if(!$response = $this->_validateLicense($errorString)){
throw new XenForo_Exception($errorString, true);
}
if(!empty($response['valid'])){
$this->_initData();
}else{
throw new XenForo_Exception('Invalid data response from server. Please contact Brivium Administrator for more information.');
}
}
protected function _validateLicense(&$errorString)
{
$addOnToInstall = $this->getAddOnToInstall();
try
{
$validator = XenForo_Helper_Http::getClient($this->_lcUrl);
$paths = XenForo_Application::get('requestPaths');
$domain = !empty($paths['host'])?$paths['host']:'';
$validator->setParameterPost('domain', $domain);
$validator->setParameterPost('addOnData', $addOnToInstall);
$validatorResponse = $validator->request('POST');
$response = $validatorResponse->getBody();
$response = trim($response);
if(!$validatorResponse || !$response || ($response != serialize(false) && @unserialize($response) === false) || $validatorResponse->getStatus() != 200)
{
$errorString = 'Request not validated';
return false;
}
if($response == serialize(false) || @unserialize($response) !== false){
$response = @unserialize($response);
}
if($response['error']){
$errorString = $response['error'];
return false;
}
return $response;
}
catch (Zend_Http_Client_Exception $e)
{
$errorString = 'Connection to Brivium server failed';
return false;
}
}
Delete and:
Code:
public function initialize($existingAddOn = array(), $addOnToInstall = array(), $triggerType = 'install')
{
$this->_triggerType = $triggerType;
$this->_existingAddOn = $existingAddOn;
$this->_addOnToInstall = $addOnToInstall;
$this->_versionId = !empty($addOnToInstall['version_id'])?$addOnToInstall['version_id']:0;
$this->_existingVersionId = !empty($existingAddOn['version_id'])?$existingAddOn['version_id']:0;
if($triggerType=='install' && !$existingAddOn && $this->_installerType==1){
$this->_checkLicense();
}else{
$this->_initData();
}
}
Change to :
Code:
public function initialize($existingAddOn = array(), $addOnToInstall = array(), $triggerType = 'install')
{
$this->_triggerType = $triggerType;
$this->_existingAddOn = $existingAddOn;
$this->_addOnToInstall = $addOnToInstall;
$this->_versionId = !empty($addOnToInstall['version_id'])?$addOnToInstall['version_id']:0;
$this->_existingVersionId = !empty($existingAddOn['version_id'])?$existingAddOn['version_id']:0;
if($triggerType=='install' && !$existingAddOn && $this->_installerType==1){
$this->_initData();
}
}
Finished.