<?php
if (!class_exists('Authenticate')) require_once("common_cadline_libraries/crm_test.class.php");

$encodedSession = $_GET["session"];
$authCode       = $_GET["authCode"];
$session        = base64_decode($encodedSession);

$auth = new Authenticate();
$auth->setAuthCode($authCode);
$auth->setAuthSession($encodedSession);
$auth->auth();

$param      = $_GET["param"];
$privatekey = crm_hardlock::GetWebformPrivateKey();
$url        = crm_hardlock::decode($privatekey, $session, $param);
$url        .= "&restart=true";

Header("Location: " . $url);
