*
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author PrestaShop SA <*****@*****.**>
 *  @copyright  2007-2011 PrestaShop SA
 *  @version  Release: $Revision: 1.4 $
 *  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */
$configPath = '../../../config/config.inc.php';
if (file_exists($configPath)) {
    include '../../../config/config.inc.php';
    include '../../../init.php';
    include '../../../modules/ebay/ebay.php';
    if (!Tools::getValue('token') || Tools::getValue('token') != Configuration::get('EBAY_SECURITY_TOKEN')) {
        die('ERROR : Invalid Token');
    }
    global $cookie;
    $cookie = new Cookie('psEbay', '', 3600);
    $cookie2 = new Cookie('psEbaySynch', '1', 3600);
    $ebay = new eBay();
    $ebay->ajaxProductSync();
    unset($cookie);
    unset($cookie2);
} else {
    echo 'ERROR';
}