<?php
/**
 * @package   Jollyany Framework
 * @author    TemPlaza https://www.templaza.com
 * @copyright Copyright (C) 2011 - 2022 TemPlaza.
 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3 or Later
 */
defined('_JOLLYANY') or die;
$license                    =   new stdClass();
$license->purchase_code     =   $_REQUEST['purchase_code'];
$license->license_type      =   $_REQUEST['license_type'];
$license->purchase_date     =   $_REQUEST['purchase_date'];
$license->supported_until   =   $_REQUEST['supported_until'];
$license->buyer             =   $_REQUEST['buyer'];
$license->domain            =   $_REQUEST['domain'];
$path       =   JPATH_BASE.'/media/jollyanykey';
if (!file_exists($path.'/'.$_REQUEST['key'].'.txt')) {
    return false;
}
if (file_exists($path)) {
    reset_license();
}
if (!file_exists($path)) {
    $origmask = @umask(0);
    // Create the path
    if (!$ret = @mkdir($path, 0755))
    {
        @umask($origmask);
        return false;
    }

    // Reset umask
    @umask($origmask);
}
file_put_contents($path . '/index.html', '<!DOCTYPE html><title></title>');
file_put_contents($path . '/' . uniqid('key_') . '.txt', maybe_serialize($license));
?>
    <div class="uk-section uk-section-default uk-flex uk-flex-middle uk-text-center">
        <div class="uk-container uk-container-small">
            <h1 class="uk-heading-small">Product Activated</h1>
            <p class="uk-margin-medium uk-text-lead">
                Congratulations! <strong><?php echo $license->buyer; ?></strong> has been successfully activated and now you can get latest updates of the template.
            </p>
            <div>
                <a href="#" class="start-using-product close-this-window uk-button uk-button-primary uk-button-large uk-border-pill" onclick="window.close();">Start using Jollyany!</a>
            </div>
        </div>
    </div>
