setAuthCode($authCode); $auth->setAuthSession($encodedSession); $auth->auth(); $data = ""; $result = ""; $resultForm = ""; $message = ""; $button = ""; $lang = ""; $useResultForm = false; // Amennyiben stringkent akarjuk kezelni a formot, false-ra kell allitani if (isset($_POST["result_ok"])) $result = "result_ok"; elseif (isset($_POST["result_cancel"])) $result = "result_cancel"; switch ($action) { case 'login': require_once '../PasswordHash.php'; $needToken = false; if (isset($_POST['param'])) { // Custom Login $decoded_data = base64_decode($_POST['param']); $data = json_decode($decoded_data); $encodedSession = $data->session; $session = base64_decode($data->session); $decoded_param = '?' . Webform::decode($privatekey, $session, $data->id); $user = json_decode(base64_decode($_POST['data'])); $seatID = Webform::get_valueFromStringUrl($decoded_param, "seatID"); $npid = Webform::get_valueFromStringUrl($decoded_param, "npid"); $isTrial = Webform::get_valueFromStringUrl($decoded_param, "trial"); $ver8and9 = $data->ver; $custom = Webform::get_valueFromStringUrl($decoded_param, "custom"); $userID = crm_hardlock::GetRegistration($user, $npid, $isTrial, $ver8and9, $custom); $nUserID = -$userID; $name = $user->name; $needToken = true; $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $msg = "URL: " . $actual_link; crm_hardlock::AddToDebugTable($msg, "Custom Login"); } else { // Belso Login $username = $_POST['username']; $password = $_POST['password']; $seatID = $_POST['seatID']; $lang = $_POST['lang']; $query = "SELECT * FROM `" . JMLADATBAZIS . "`.`jml_users` WHERE username = ? OR email = ?"; Database::getInstance()->query($query, array('ss', $username, $username)); $res = Database::getInstance()->fetchNext(); if (!empty($res)) { $db_password = $res['password']; $nUserID = $res['nUserID']; $name = $res["name"]; $phpass = new PasswordHash(10, true); $ok = $phpass->CheckPassword($password, $db_password); if ($ok) { $needToken = true; } else { $result = 'result_cancel'; $data = "password_error"; } } else { $result = 'result_cancel'; $data = "username_error"; } } if ($needToken) { $tokenID = crm_hardlock::GetOrGenerateToken($seatID, $nUserID); $result = 'result_ok'; $data = " {$name} {$tokenID} "; } $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); if (isset($_POST['ex']) && $_POST['ex'] == 'true') { header('Location: https://www.archline.hu/maintenance/webform/loginresult.php?lang=' . $lang . '&result=' . $result); } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } die(); break; case 'ext_browser': $result = 'result_cancel'; $data = "external_login"; $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); if (isset($ex) && $ex == "true") { $useResultForm = false; } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } break; case 'cancel_login': $result = 'result_cancel'; $data = "cancel_login"; $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); if (isset($_POST['ex']) && $_POST['ex'] == 'true') { } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } die(); break; case 'sample': $data = $_POST["param"]; break; case 'register': $param = $_GET["param"]; // Encode-olt adat $param = Webform::decode($privatekey, $session, $param); // Adat decode-olása $param = "?" . $param; $serial = Webform::get_valueFromStringUrl($param, "password"); $npid = Webform::get_valueFromStringUrl($param, "npid"); $isid = Webform::get_valueFromStringUrl($param, "isid"); $comp_name = Webform::get_valueFromStringUrl($param, "name"); $ex = Webform::get_valueFromStringUrl($param, "ex"); $instcode = Webform::get_valueFromStringUrl($param, "instcode"); $lang = Webform::get_valueFromStringUrl($param, "lang"); $isTwTw = Webform::get_valueFromStringUrl($param, "twtw") == 'true'; $seatID = Webform::get_valueFromStringUrl($param, "seatid"); $build = Webform::get_valueFromStringUrl($param, "build"); $ver8And9 = crm_hardlock::GetVer8And9FromPassword($serial) >= 40; $isFloating = 'false'; $isOffline = 'false'; if (crm_hardlock::isEmergencyServer($_GET['secondary'])) { $error = crm_hardlock::GetActivationError(crm_hardlock::SERVER_DOWN); $result = 'result_ok'; $data = ' true ' . $error . ' '; goto resultBack; } crm_hardlock::InsertLog($serial); if (isset($instcode) && Codegen::IsValidTimeCode($instcode)) { // 2020-tol a telepites ota eltelt idot jelzi a regisztracio // Amennyiben a telepitesi kod es a password parban all, akkor a valos eltelt idot jelzi $countryNotOK = Codegen::IsSoftwareKey($serial) ? false : Codegen::GetCountryFromTimeCode($installationCode) != Codegen::GetCountryFromPassword($serial); if (substr($instcode, 0, 4) != substr($serial, 2, 4) || $countryNotOK) { // Az installalasi kod nincs parban a passwordel, ilyenkor le kell generalni az installalasi kodot $instcode = ''; $numOfDays = 0; $registrationDate = crm_hardlock::GetInstallationDate_noRegisterAndValidate($serial, $isid, $instcode, $isTwTw); if ($registrationDate != '') { // Ha nem sikerult megallapitani a telepitesi datumot, akkor a mai napot allitjuk be if (strpos($registrationDate, 'error:') === false) { $dateNow = new DateTime(date('Y-m-d')); if ($isTwTw) $numOfDays = Codegen::GetDayInterval(crm_hardlock::getTwTwRootTimeString(), $dateNow->format('Y-m-d')); else $numOfDays = Codegen::GetDayInterval($registrationDate, $dateNow->format('Y-m-d')); $instcode = Codegen::GenerateTimeCode($serial, $isid, $numOfDays); } } } } else $instcode = ''; if (isset($ex) && $ex == "true") $useResultForm = true; // isid kiegeszitese 0-val crm_hardlock::correctIsid($isid); $softwarekey = Codegen::IsSoftwareKey($serial); if (!$softwarekey) // A regisztracional a gepazonositot kuldi a program, ez hardware kulcsnal nem alkalmazhato $isid = crm_hardlock::GetIsidFromPasswordForHardwareKeys($serial); $register_result = crm_hardlock::RegisterProgram($serial, $isid, $instcode, $npid, $comp_name, $isTwTw, $seatID, $build); if (substr($register_result, 0, 6) == "error:") crm_hardlock::_Hibajelento("regisztracio", substr($serial, 0, 6), "isid: {$isid}, valasz: {$register_result}"); if (substr($register_result, 0, 6) == "error:") $result = 'result_cancel'; else $result = 'result_ok'; $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`computers` WHERE computer_id = ?"; Database::getInstance()->query($query, array('s', $npid)); $computers = Database::getInstance()->fetchNext(); $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`p_serial_isid` WHERE serial = ? AND isid = ? AND aktiv = ?"; Database::getInstance()->query($query, array('ssi', $serial, $isid, 1)); $p_serial_isid = Database::getInstance()->fetchNext(); if (empty($p_serial_isid) || $p_serial_isid['computer_id'] == $computers['id']) $npidOK = 'true'; else $npidOK = 'false'; if (substr($register_result, 0, 6) != "error:") { if ($isTwTw) $aktkod = crm_hardlock::GetOrGenerateTimeCodeTWTW($serial, $isid, $instcode, $npid, $computers['computer_name'], $seatID, $build, false); else $aktkod = crm_hardlock::GetOrGenerateTimeCode($serial, $isid, $instcode, $npid, $computers['computer_name']); } if ($ver8And9 >= 40) { if ($ver8And9 > 40 || ($ver8And9 == 40 && $build > '255' && $build != '')) { $query = "SELECT isFloating FROM `" . CRMADATBAZIS . "`.`hardlock` WHERE hlNum = ?"; Database::getInstance()->query($query, array('s', substr($serial, 0, 6))); $key = Database::getInstance()->fetchNext(); if ($key['isFloating'] == 1) { $isFloating = 'true'; $query = "SELECT * FROM `" . SYNCADATBAZIS . "`.`floating_licenses` WHERE hlNum = ? AND seatID = ?"; Database::getInstance()->query($query, array('ss', substr($serial, 0, 6), $seatID)); $floatingLic = Database::getInstance()->fetchNext(); if (!empty($floatingLic) && $floatingLic['offline_expiration_date'] != '') { $isOffline = 'true'; $days = Codegen::GetDayInterval(crm_hardlock::getTwTwRootTimeString(), $floatingLic['offline_expiration_date']); $aktkod = Codegen::GenerateTimeCode($serial, $isid, $days); } } } } $data = ' ' . $npidOK . ' ' . ((isset($aktkod)) && substr($register_result, 0, 6) != "error:" ? '' . $aktkod . '' : '') . ' ' . ((isset($register_result)) && substr($register_result, 0, 6) == "error:" ? '' . $register_result . '' : '') . ' ' . $isFloating . ' ' . $isOffline . ' '; if ($lang == 'hun') { $message = 'Nyomja meg az alábbi gombot, hogy licencét ezen a gépen regisztrálja:'; $button = "LICENC REGISZTRÁLÁS"; } else { $message = 'To register your license on this computer, please press the following button:'; $button = "REGISTER MY LICENSE"; } break; case 'unregister': $param = $_GET["param"]; // Encode-olt adat $param = Webform::decode($privatekey, $session, $param); // Adat decode-olása $param = "?" . $param; $serial = Webform::get_valueFromStringUrl($param, "password"); $isid = Webform::get_valueFromStringUrl($param, "isid"); $npid = Webform::get_valueFromStringUrl($param, "npid"); $ex = Webform::get_valueFromStringUrl($param, "ex"); $lang = Webform::get_valueFromStringUrl($param, "lang"); if (crm_hardlock::isEmergencyServer($_GET['secondary'])) { $error = crm_hardlock::GetActivationError(crm_hardlock::SERVER_DOWN); $result = 'result_ok'; $data = ' true ' . $error . ' '; goto resultBack; } if (isset($ex) && $ex == "true") $useResultForm = true; // isid kiegeszitese 0-val crm_hardlock::correctIsid($isid); $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`computers` WHERE computer_id = ?"; Database::getInstance()->query($query, array('s', $npid)); $computers = Database::getInstance()->fetchNext(); $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`p_serial_isid` WHERE serial = ? AND isid = ? AND aktiv = ?"; Database::getInstance()->query($query, array('ssi', $serial, $isid, 1)); $p_serial_isid = Database::getInstance()->fetchNext(); if (empty($p_serial_isid) || $p_serial_isid['computer_id'] == $computers['id']) $npidOK = 'true'; else $npidOK = 'false'; $register_result = crm_hardlock::UnRegisterProgram($serial, $isid, '', $computers['computer_name']); if (!$register_result) { $error = crm_hardlock::GetActivationError(crm_hardlock::UNREGISTER_FAILED); $result = 'result_cancel'; } else $result = 'result_ok'; $data = ' ' . $npidOK . ' ' . ((isset($error)) ? '' . $error . '' : '') . ' '; if ($lang == 'hun') { $message = 'Ha el akarja távolítani a licencét a számítógépről, kérjük nyomja meg az alábbi gombot:'; $button = "LICENC ELTÁVOLÍTÁSA"; } else { $message = 'If You want to remove Your license from this computer, please press the following button:'; $button = "RELEASE MY LICENSE"; } break; case 'selectProgramDialog': $result = isset($_POST['result_ok']) ? 'result_ok' : 'result_cancel'; // csak akkor lehet true, ha: (mind a 3 ES kapcsolat) // 1. a user ok-t nyomott a dialogban // 2. a hozza tartozo licenc megvaltozott // 3. 1 licenc maradt nala $restartRequired = isset($_POST['result_ok']) ? 'true' : 'false'; if (isset($ex) && $ex == "true") $useResultForm = true; $data = ' '; $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); if (isset($_POST['ex']) && $_POST['ex'] == 'true') { //header('Location: https://www.archline.hu/maintenance/webform/loginresult.php?lang=' . $lang . '&result=' . $result); } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } break; case 'exchange_registration': $param = $_GET["param"]; // Encode-olt adat $param = Webform::decode($privatekey, $session, $param); // Adat decode-olása $param = "?" . $param; $serial = Webform::get_valueFromStringUrl($param, "password"); $npid = Webform::get_valueFromStringUrl($param, "npid"); $isid = Webform::get_valueFromStringUrl($param, "isid"); $comp_name = Webform::get_valueFromStringUrl($param, "name"); $ex = Webform::get_valueFromStringUrl($param, "ex"); $instcode = Webform::get_valueFromStringUrl($param, "instcode"); $lang = Webform::get_valueFromStringUrl($param, "lang"); $isTwTw = Webform::get_valueFromStringUrl($param, "twtw") == 'true'; $seatID = Webform::get_valueFromStringUrl($param, "seatid"); if (isset($ex) && $ex == "true") $useResultForm = true; // isid kiegeszitese 0-val crm_hardlock::correctIsid($isid); $softwarekey = Codegen::IsSoftwareKey($serial); if (!$softwarekey) // A regisztracional a gepazonositot kuldi a program, ez hardware kulcsnal nem alkalmazhato $isid = crm_hardlock::GetIsidFromPasswordForHardwareKeys($serial); $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`p_serial_isid` WHERE serial = ? AND aktiv = ?"; Database::getInstance()->query($query, array('si', $serial, 1)); $p_serial_isid = Database::getInstance()->fetchNext(); $old_isid = $p_serial_isid['isid']; $old_comp_id = $p_serial_isid['computer_id']; $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`computers` WHERE id = ?"; Database::getInstance()->query($query, array('i', $old_comp_id)); $computers = Database::getInstance()->fetchNext(); $register_result = crm_hardlock::UnRegisterProgram($serial, $old_isid, '', $comp_name); if (!$register_result) { $error = crm_hardlock::GetActivationError(crm_hardlock::UNREGISTER_FAILED); $result = 'result_cancel'; } else $result = 'result_ok'; $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`p_serial_isid` WHERE serial = ? AND isid = ? AND aktiv = ?"; Database::getInstance()->query($query, array('ssi', $serial, $isid, 1)); $p_serial_isid = Database::getInstance()->fetchNext(); if (empty($p_serial_isid) || $p_serial_isid['computer_id'] == $computers['id']) $npidOK = 'true'; else $npidOK = 'false'; $register_result = crm_hardlock::RegisterProgram($serial, $isid, $instcode, $npid, $comp_name, $isTwTw, $seatID); if (substr($register_result, 0, 6) == "error:") crm_hardlock::_Hibajelento("regisztracio", substr($serial, 0, 6), "isid: {$isid}, valasz: {$register_result}"); if (substr($register_result, 0, 6) == "error:") $result = 'result_cancel'; else $result = 'result_ok'; if (substr($register_result, 0, 6) != "error:") { if ($isTwTw) $aktkod = crm_hardlock::GetOrGenerateTimeCodeTWTW($serial, $isid, $instcode, $npid, $comp_name, $seatID); else $aktkod = crm_hardlock::GetOrGenerateTimeCode($serial, $isid, $instcode, $npid, $comp_name); } $data = ' ' . $npidOK . ' ' . ((isset($aktkod)) && substr($register_result, 0, 6) != "error:" ? '' . $aktkod . '' : '') . ' ' . ((isset($register_result)) && substr($register_result, 0, 6) == "error:" ? '' . $register_result . '' : '') . ' '; if ($lang == 'hun') { $message = 'Nyomja meg az alábbi gombot, hogy licencét ezen a gépen regisztrálja:'; $button = "LICENC REGISZTRÁLÁS"; } else { $message = 'To register your license on this computer, please press the following button:'; $button = "REGISTER MY LICENSE"; } break; case 'select_distributor': $userID = $_POST['userID']; $distID = $_POST['distID']; if ($userID > 0 && $distID != '') { Database::getInstance()->update( CRMADATBAZIS . ".users", array( 'distID_by_user' => $distID ), array('nUserID' => $userID), 'ii' ); } if (isset($_POST['ex']) && $_POST['ex'] == 'true') { } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } die(); break; case 'unlockLicense': $param = $_GET["param"]; // Encode-olt adat $param = Webform::decode($privatekey, $session, $param); // Adat decode-olása $param = "?" . $param; $serial = Webform::get_valueFromStringUrl($param, "password"); $seatID = Webform::get_valueFromStringUrl($param, "seatid"); if (!crm_hardlock::isEmergencyServer($_GET['secondary'])) { crm_hardlock::floatingUnlock($serial, $seatID); } $result = 'result_ok'; $data = ' ' . $seatID . ' '; break; case 'lockLicense': $param = $_GET["param"]; // Encode-olt adat $param = Webform::decode($privatekey, $session, $param); // Adat decode-olása $param = "?" . $param; $serial = Webform::get_valueFromStringUrl($param, "password"); $seatID = Webform::get_valueFromStringUrl($param, "seatid"); $isid = Webform::get_valueFromStringUrl($param, "isid"); $npid = Webform::get_valueFromStringUrl($param, "npid"); $ex = Webform::get_valueFromStringUrl($param, "ex"); if (crm_hardlock::isEmergencyServer($_GET['secondary'])) { $floatingLock = true; } else { $computerID = crm_hardlock::getComputerIdFromNpid($npid); $floatingLock = crm_hardlock::floatingLock($serial, $seatID, $computerID); } $message = 'Floating Lock message'; $button = 'Floating Lock button'; if (isset($ex) && $ex == "true") $useResultForm = true; $error = ''; $result = 'result_ok'; if (!$floatingLock) $error = 'error: unable to lock floating license'; $data = ' ' . $seatID . ' ' . ((isset($error)) ? '' . $error . '' : '') . ' '; break; case 'offlineFloating': $serial = $_POST['serial']; $seatID = $_POST['seatID']; $actDate = date("Y-m-d", strtotime($_POST['actDate'])); // TODO: errorokat lekezelni (pl. aktivalasi kod) $error = ''; // error: invalid date $message = ''; $button = ''; $result = 'result_ok'; $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`h_programs` WHERE prPass = ?"; Database::getInstance()->query($query, array('s', $serial)); $program = Database::getInstance()->fetchNext(); if ($actDate > $program['prFizetve']) $actDate = $program['prFizetve']; Database::getInstance()->update( SYNCADATBAZIS . ".floating_licenses", array( 'offline_expiration_date' => date("Y-m-d", strtotime($_POST['actDate'])) ), array('seatID' => $seatID), 'ss' ); $query = "SELECT * FROM `" . SYNCADATBAZIS . "`.`floating_licenses` WHERE seatID = ?"; Database::getInstance()->query($query, array('s', $seatID)); $floatingLic = Database::getInstance()->fetchNext(); $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`p_serial_isid` WHERE serial = ? AND computer_id = ?"; Database::getInstance()->query($query, array('si', $serial, $floatingLic['computer_id'])); $serialIsid = Database::getInstance()->fetchNext(); $napok = Codegen::GetDayInterval(crm_hardlock::getTwTwRootTimeString(), $actDate, true); if ($actDate >= '2050-01-01') $napok = 3583; $actCode = Codegen::GenerateTimeCode($serial, $serialIsid['isid'], $napok); Database::getInstance()->insert( 'local_crm.floating_log', array( "seatID" => $seatID, "hlNum" => substr($serial, 0, 6), "inserted" => date('Y-m-d H:i:s'), "isid" => $serialIsid['isid'], "eventID" => 3, "computerID" => $floatingLic['computer_id'] ), 'ssssii' ); $data = " {$actCode} true " . ((isset($error) && $error != '') ? '' . $error . '' : '') . " "; $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); if (isset($_POST['ex']) && $_POST['ex'] == 'true') { //header('Location: https://www.archline.hu/maintenance/webform/loginresult.php?lang=' . $lang . '&result=' . $result); } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } die(); break; case 'removeOffline': $serial = $_POST['serial']; $seatID = $_POST['seatID']; Database::getInstance()->update( SYNCADATBAZIS . ".floating_licenses", array( 'offline_expiration_date' => '' ), array('seatID' => $seatID), 'ss' ); $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`h_programs` WHERE prPass = ?"; Database::getInstance()->query($query, array('s', $serial)); $program = Database::getInstance()->fetchNext(); $actCode = $program['prActCode']; $query = "SELECT * FROM `" . SYNCADATBAZIS . "`.`floating_licenses` WHERE seatID = ?"; Database::getInstance()->query($query, array('s', $seatID)); $key = Database::getInstance()->fetchNext(); $query = "SELECT * FROM `" . CRMADATBAZIS . "`.`p_serial_isid` WHERE serial = ? AND computer_id = ?"; Database::getInstance()->query($query, array('si', $serial, $key['computer_id'])); $p_serial_isid = Database::getInstance()->fetchNext(); Database::getInstance()->insert( 'local_crm.floating_log', array( "seatID" => $seatID, "hlNum" => substr($serial, 0, 6), "inserted" => date('Y-m-d H:i:s'), "isid" => $p_serial_isid['isid'], "eventID" => 4, "computerID" => $key['computer_id'] ), 'ssssii' ); $result = 'result_ok'; $data = " {$actCode} false "; $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); if (isset($_POST['ex']) && $_POST['ex'] == 'true') { //header('Location: https://www.archline.hu/maintenance/webform/loginresult.php?lang=' . $lang . '&result=' . $result); } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } die(); break; case 'hlPin': $serial = $_POST['serial']; $pin = hash('sha256', $_POST['pin-code']); $seatID = $_POST['seatID']; $query = "SELECT * FROM `" . SYNCADATBAZIS . "`.`hardlock_ext` WHERE hlNum = ? AND pin = ?"; Database::getInstance()->query($query, array('ss', substr($serial, 0, 6), $pin)); $hardlockExt = Database::getInstance()->fetchNext(); $result = 'result_ok'; $error = ''; if (empty($hardlockExt)) { $error = 'error: wrong pin code'; } elseif (!crm_hardlock::isEmergencyServer($_POST['secondary'])) { $query = "SELECT * FROM local_crm.hardlock_ext WHERE hlNum = ?"; Database::getInstance()->query($query, array('s', substr($serial, 0, 6))); $localHardlockExtExist = Database::getInstance()->fetchNext(); if (empty($localHardlockExtExist)) { Database::getInstance()->insert( "local_crm.hardlock_ext", array( "seatIDs" => $seatID, "hlNum" => substr($serial, 0, 6) ), 'ss' ); } else { if (strpos($localHardlockExtExist['seatIDs'], $seatID) === false) { $seatIDString = $localHardlockExtExist['seatIDs'] . ';' . $seatID; Database::getInstance()->update( "local_crm.hardlock_ext", array( 'seatIDs' => $seatIDString ), array('hlNum' => substr($serial, 0, 6)), 'ss' ); } } } $data = " {$seatID} " . ((isset($error)) ? '' . $error . '' : '') . " "; $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); if (isset($_POST['ex']) && $_POST['ex'] == 'true') { //header('Location: https://www.archline.hu/maintenance/webform/loginresult.php?lang=' . $lang . '&result=' . $result); } else { $resultForm .= "
"; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } die(); break; default: die(); break; } resultBack: if ($data != '') { $param = Webform::encode($privatekey, $session, $data); Webform::SetWebformResult($session, $result, $param, $message, $button); /*if (crm_hardlock::isEmergencyServer($_GET['secondary'])) { var_dump('session=' . $encodedSession . '&' . $result . '=' . $param); die(); }*/ if ($useResultForm) { $resultForm .= "
"; if ($lang != '') $resultForm .= ""; if ($action == 'exchange_registration') $resultForm .= ""; $resultForm .= ""; $resultForm .= ""; $resultForm .= "
"; $resultForm .= "'"; echo $resultForm; } else { $resultXml .= '<' . '?' . 'xml version="1.0"' . '?' . '>'; $resultXml .= '?session=' . $encodedSession . '&' . $result . '=' . $param . '&'; $resultXml .= ''; header('Content-Type: text/xml; charset=utf-8'); header('Content-Disposition: inline; filename=response.xml'); echo $resultXml; } } /* - kapott adatok (serial, seatid) - xml visszateres - ActCode az XML-be */