$lang['ERROR_CRC'], 'error: nem aktiv a program' => $lang['ERROR_PROGRAM_DISABLED'], 'error: masik gep van regisztralva' => $lang['ERROR_ANOTHER_COMPUTER_REGISTERED'], 'error: tul sok telepites' => $lang['ERROR_TOO_MANY_INSTALLATION'], 'error: nincs ilyen password' => $lang['ERROR_UNKNOWN_PASSWORD'], 'error: hianyzo kod' => $lang['ERROR_CODE_IS_MISSING'], 'error: nincs vasarlasi idopont' => $lang['ERROR_SELL_DATE_IS_MISSING'], 'error: nem aktiv regisztracio' => $lang['ERROR_INACTIVE_REGISTRATION'] ); $solutions = array( 'crc_error' => $lang['SOLUTION_CRC'], 'error: nem aktiv a program' => $lang['SOLUTION_PROGRAM_DISABLED'], 'error: masik gep van regisztralva' => $lang['SOLUTION_ANOTHER_COMPUTER_REGISTERED'], 'error: tul sok telepites' => $lang['SOLUTION_TOO_MANY_INSTALLATION'], 'error: nincs ilyen password' => $lang['SOLUTION_UNKNOWN_PASSWORD'], 'error: hianyzo kod' => $lang['SOLUTION_CODE_IS_MISSING'], 'error: nincs vasarlasi idopont' => $lang['SOLUTION_SELL_DATE_IS_MISSING'], 'error: nem aktiv regisztracio' => $lang['SOLUTION_INACTIVE_REGISTRATION'] ); $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = substr($url, 0, strpos($url, "&")); $parsed_url = parse_url($url); $data = substr($parsed_url["query"], 5); if (isset($data) && $data != '') { $data = base64_decode($data); $xmldata = simplexml_load_string($data) or die("Failed to load"); $licenseData = $xmldata["LicenceData"]; $privateKey = crm_hardlock::GetWebformPrivateKey(); $publicKey = substr($licenseData, 22, 22); $licenseData = substr($licenseData, 44, -26); $oldCrc = substr($xmldata["LicenceData"], -4); $oldEncoded = substr($xmldata["LicenceData"], 0, -4); $oldmd5 = substr(md5($oldEncoded), -4); if ($oldCrc != $oldmd5) { $lang['MESSAGE'] = $errors['crc_error'] . "

" . $solutions['crc_error']; $alert = "danger"; $download = false; $showError = false; } $decoded = crm_hardlock::decode($privateKey, $publicKey, $licenseData); $regData = simplexml_load_string($decoded) or die("Failed to load"); $password = $regData["password"]; $installationCode = $regData["installationCode"]; $npid = $regData["npid"]; $computerName = $regData["computerName"]; $isid = crm_hardlock::GetIsidFromTimeCode($installationCode); $register_result = crm_hardlock::RegisterProgram($password, $isid, $installationCode, $npid, $computerName); if (substr($register_result, 0, 6) == "error:" && $showError) { $lang['MESSAGE'] = $errors[$register_result] . "

" . $solutions[$register_result]; $alert = "danger"; $download = false; $showError = false; } $actCode = crm_hardlock::GetOrGenerateTimeCode($password, $isid, $installationCode, $npid); if (substr($actCode, 0, 6) == "error:" && $showError) { $lang['MESSAGE'] = $errors[$actCode] . "

" . $solutions[$actCode]; $alert = "danger"; $download = false; $showError = false; } if ($computerName != "") { $comp = "_" . $computerName; $dataComp = ' computerName="' . $computerName . '"'; } $ver8and9 = crm_hardlock::GetVer8And9FromPassword($password); crm_database::getInstance()->query("SELECT year FROM `" . CRMADATBAZIS . "`.`p_versions` WHERE verPassword8and9 = '" . $ver8and9 . "' LIMIT 1"); $versions = crm_database::getInstance()->fetchAssoc(); $year = $versions[0]['year']; $data = ''; $newPublicKey = crm_hardlock::GenerateRandomString(); $guid = crm_hardlock::GenerateRandomString(); $encodedlicenceData = crm_hardlock::encode($privateKey, $newPublicKey, $data); $md5 = md5($guid . $newPublicKey . $encodedlicenceData . $guid); $crc = substr($md5, -4); $licenceData = '\n'; $filename = "ArchlineXP_" . $year . "_Licence_" . substr($password, 0, 6) . $comp . "_" . $isid . ".allic"; } ?>