query($query, array('iiii', $function_id, $product_id, $country_id, $ver_id)); $res = Database::getInstance()->fetchNext(); if (empty($res)) { print "No result found."; } else { $param = base64_decode($param); if ($test && $res['test_url'] != '') { $url = $res['test_url']; $session = Webform::get_valueFromStringUrl("?{$param}", "session"); $privateKey = Webform::GetWebformPrivateKey(); $encoded = Webform::encode($privateKey, $session, base64_encode(date('Y-m-d'))); $encoded = base64_encode($encoded); $param .= "&authCode={$encoded}"; } else { if (strpos($res['secondary_url'], 'https') === false) return; $url = str_replace('secondary_domain', 'secondary.cadline.hu', $res['secondary_url']); } $url .= $param; if ($function_id == 8 || $function_id == 19) $url .= "&ver={$ver_id}"; if ($function_id == 17 || $function_id == 20 || $function_id == 4 || $function_id == 24 || $function_id == 22 || $function_id == 30) $url .= "&prod={$product_id}&ver={$ver_id}&cnt={$country_id}"; if ($function_id == 15) $url .= "&cnt={$country_id}"; if ($function_id == 25) $url .= "&ver={$ver_id}&build={$build}"; if ($function_id == 19) { $se = Webform::get_valueFromStringUrl("?{$param}", "se"); $url .= "&se={$se}"; } $url .= "&secondary=true"; header('Location: ' . $url); }