Changeset View
Changeset View
Standalone View
Standalone View
core/install.php
Show First 20 Lines • Show All 668 Lines • ▼ Show 20 Line(s) | |||||
switch ($license_source) { | switch ($license_source) { | ||||
case 1: // Download from Intechnic | case 1: // Download from Intechnic | ||||
break; | break; | ||||
case 2: // Upload License File | case 2: // Upload License File | ||||
$file_data = array_map('trim', file($_FILES['license_file']['tmp_name'])); | $file_data = array_map('trim', file($_FILES['license_file']['tmp_name'])); | ||||
if ((count($file_data) == 3) && $file_data[1]) { | if ((count($file_data) == 3) && $file_data[1]) { | ||||
$modules_helper = $this->Application->recallObject('ModulesHelper'); | $modules_helper = $this->Application->recallObject('kModulesHelper'); | ||||
/* @var $modules_helper kModulesHelper */ | /* @var $modules_helper kModulesHelper */ | ||||
if ($modules_helper->verifyLicense($file_data[1])) { | if ($modules_helper->verifyLicense($file_data[1])) { | ||||
$this->toolkit->systemConfig->set('License', 'Intechnic', $file_data[1]); | $this->toolkit->systemConfig->set('License', 'Intechnic', $file_data[1]); | ||||
$this->toolkit->systemConfig->set('LicenseCode', 'Intechnic', $file_data[2]); | $this->toolkit->systemConfig->set('LicenseCode', 'Intechnic', $file_data[2]); | ||||
$this->toolkit->systemConfig->save(); | $this->toolkit->systemConfig->save(); | ||||
} | } | ||||
else { | else { | ||||
$this->errorMessage = 'Invalid License File'; | $this->errorMessage = 'Invalid License File'; | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
$this->errorMessage = 'Invalid License File'; | $this->errorMessage = 'Invalid License File'; | ||||
} | } | ||||
break; | break; | ||||
case 3: // Use Existing License | case 3: // Use Existing License | ||||
$license_hash = $this->toolkit->systemConfig->get('License', 'Intechnic'); | $license_hash = $this->toolkit->systemConfig->get('License', 'Intechnic'); | ||||
if ($license_hash) { | if ($license_hash) { | ||||
$modules_helper = $this->Application->recallObject('ModulesHelper'); | $modules_helper = $this->Application->recallObject('kModulesHelper'); | ||||
/* @var $modules_helper kModulesHelper */ | /* @var $modules_helper kModulesHelper */ | ||||
if (!$modules_helper->verifyLicense($license_hash)) { | if (!$modules_helper->verifyLicense($license_hash)) { | ||||
$this->errorMessage = 'Invalid or corrupt license detected'; | $this->errorMessage = 'Invalid or corrupt license detected'; | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
// happens, when browser's "Back" button is used | // happens, when browser's "Back" button is used | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | |||||
else { | else { | ||||
$this->toolkit->processLicense($file_data); | $this->toolkit->processLicense($file_data); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
case 'select_domain': | case 'select_domain': | ||||
$modules_helper = $this->Application->recallObject('ModulesHelper'); | $modules_helper = $this->Application->recallObject('kModulesHelper'); | ||||
/* @var $modules_helper kModulesHelper */ | /* @var $modules_helper kModulesHelper */ | ||||
// get domain name as entered by user on the form | // get domain name as entered by user on the form | ||||
$domain = $this->GetVar('domain') == 1 ? $_SERVER['HTTP_HOST'] : str_replace(' ', '', $this->GetVar('other')); | $domain = $this->GetVar('domain') == 1 ? $_SERVER['HTTP_HOST'] : str_replace(' ', '', $this->GetVar('other')); | ||||
$license_hash = $this->toolkit->systemConfig->get('License', 'Intechnic'); | $license_hash = $this->toolkit->systemConfig->get('License', 'Intechnic'); | ||||
if ($license_hash) { | if ($license_hash) { | ||||
// when license present, then extract domain from it | // when license present, then extract domain from it | ||||
▲ Show 20 Lines • Show All 971 Lines • Show Last 20 Lines |