<?php

include(dirname(__FILE__).'/../../../config/config.inc.php');

if (isset($_POST['token']) AND !empty($_POST['token']))
{
        $token = Tools::getValue('token');
        $realToken = Configuration::get('TREEPODIA_TOKEN');

        if ($token === $realToken)
	{
		Configuration::updateValue('TREEPODIA_ACCOUNT_CODE', $_POST['account-code']);
		die($_POST['account-code']);
	}
        else
                echo 'Bad token';
}
else
        echo 'Bad token';