Example #1
0
function CheckLicense()
{
    global $LKey, $Trial, $SaveVars, $Errors, $Lang, $CLang;
    if (!$LKey && !$Trial) {
        return false;
    }
    if ($LKey) {
        $BF = new Crypt_Blowfish('ns tracker license ');
        $Decoded = $BF->decrypt($LKey);
        $LArray = GetLicenseText($Decoded);
        if ($LArray) {
            if (!isset($LArray['P'])) {
                $Errors[] = $Lang['SecondaryKey'];
                return;
            }
            $GLOBALS['LArray'] = $LArray;
            foreach ($LArray as $Key => $Val) {
                $GLOBALS['Lc' . $Key] = $Val;
                $SaveVars[] = "Lc" . $Key;
            }
        } else {
            $Errors[] = $Lang['BadLicense'];
        }
    }
    if (count($Errors)) {
        return;
    }
    NextStep();
}
Example #2
0
function GetFullLicenseArr()
{
    $FullArr = array();
    global $Db, $BF;
    $Query = "SELECT * FROM " . PFX . "_tracker_license";
    $Sql = new Query($Query);
    while ($Row = $Sql->Row()) {
        $Row->KEY_DECODE = $BF->decrypt($Row->LICENSE_KEY);
        $Row->License = GetLicenseText($Row->KEY_DECODE);
        if (!$Row->License) {
            continue;
        }
        foreach ($Row->License as $Key => $Value) {
            $FullArr[$Key][] = $Value;
        }
    }
    return $FullArr;
}
Example #3
0
function DeleteKey($Id)
{
    global $Db, $nsProduct, $ClientsCntNow, $SitesCntNow, $BF, $Logs, $Lang;
    $Query = "SELECT * FROM " . PFX . "_tracker_license WHERE ID = {$Id}";
    $Row = $Db->Select($Query);
    $Row->KEY_DECODE = $BF->decrypt($Row->LICENSE_KEY);
    $Row->License = GetLicenseText($Row->KEY_DECODE);
    if (!$Row->License) {
        $Logs->Err($Lang['CantDelete']);
        return;
    }
    if ($ClientsCntNow > 1 && isset($Row->License['P']) && $Row->License['P'] == 3) {
        $Logs->Err($Lang['DelClientsErr']);
        return;
    }
    if ($nsProduct->MAX_SITES - $Row->License['L'] < $SitesCntNow) {
        $Logs->Err($Lang['DelSitesErr']);
        return;
    }
    $Query = "DELETE FROM " . PFX . "_tracker_license WHERE ID = {$Id}";
    $Db->Query($Query);
    $nsProduct->Redir("license", "RDlt=1", "admin");
}