Esempio n. 1
0
function wpdm_admin_license_notice()
{
    if (basename($_SERVER['REQUEST_URI']) != 'plugins.php' && basename($_SERVER['REQUEST_URI']) != 'index.php' && get_post_type() != 'wpdmpro') {
        return '';
    }
    if ((int) get_option('__wpdm_nlc') > time()) {
        return '';
    }
    if ($_SERVER['HTTP_HOST'] == 'localhost') {
        return '';
    }
    //if (!isAjax()) {
    if (!is_valid_license_key()) {
        $time = (int) get_option('settings_ok');
        if ($time > time()) {
            echo "\n        <div id=\"error\" class=\"error\" style='border-left: 0 !important;border-top: 3px solid #dd3d36 !important;'><p>\n        Please enter a valid <a href='edit.php?post_type=wpdmpro&page=settings&tab=license'>license key</a> for <b>Download Manager</b></p>\n        </div>\n        ";
        } else {
            echo "\n        <div id=\"error\" class=\"error\" style='border-left: 0 !important;border-top: 3px solid #dd3d36 !important;'><p>\n        Trial period for <b>Download Manager</b> is expired.<br/>\n        Please enter a valid <a style='font-weight: 900;text-decoration: underline' href='edit.php?post_type=wpdmpro&page=settings&tab=license'>license key</a> for Download Manager to reactivate it.<br/>\n        <a href='http://www.wpdownloadmanager.com/'>Buy your copy now only at 45.00 usd</a></p>\n        </div>\n        ";
        }
    }
    //}
}
Esempio n. 2
0
function check_license()
{
    if ($_SERVER['HTTP_HOST'] == 'localhost') {
        return true;
    }
    if (!isAjax()) {
        if (!is_valid_license_key()) {
            $time = (int) get_option('settings_ok');
            if ($time > time()) {
                echo "\n        <div id=\"warning\" class=\"error fade\"><p>\n        Please enter a valid <a href='edit.php?post_type=wpdmpro&page=settings&tab=license'>license key</a> for <b>Download Manager</b> \n        </div>\n        ";
            } else {
                echo "\n        <div id=\"warning\" class=\"error fade\"><p>\n        Trial period for <b>Download Manager</b> is expired.<br/>\n        Please enter a valid <a href='edit.php?post_type=wpdmpro&page=settings&tab=license'>license key</a> for <b>Download Manager</b> to reactivate it.<br/>\n        <a href='http://www.wpdownloadmanager.com/'>Buy your copy now only at 45.00 usd</a>\n        </div>\n        ";
            }
        }
    }
}
    function License()
    {
        if (isset($_POST['task']) && $_POST['task'] == 'wdm_save_settings') {
            if (!function_exists('curl_init')) {
                \WPDM_Messages::Error('<b>cURL</b> is not active or installed or not functioning properly in your server', 1);
            }
            if (is_valid_license_key()) {
                update_option('_wpdm_license_key', $_POST['_wpdm_license_key']);
                die('Congratulation! Your <b>Download Manager</b> copy registered successfully!');
            } else {
                delete_option('_wpdm_license_key');
                die('Invalid License Key!');
            }
        }
        ?>
        <div class="panel panel-default">

            <div class="panel-heading"><b>License Key&nbsp;</b></div>
            <div class="panel-body"><input type="text" placeholder="Enter License Key" class="form-control" value="<?php 
        echo get_option('_wpdm_license_key');
        ?>
"
                                           name="_wpdm_license_key"/></div>

        </div>
        <?php 
    }