Пример #1
0
function IsOkSParams($s_SParams, $s_EncryptKey){
if ($s_SParams == ""){return false;}
$n = strpos($s_SParams, "|");
if ($n === false) {return false;}
$s1 = substr($s_SParams, 0, $n);
$s2 = substr($s_SParams, $n + 1);
if (MD5_16($s_EncryptKey.$s2) != $s1){return false;}
return true;
}
Пример #2
0
function ShowLicense()
{
    if ($GLOBALS["sLicense"] == "") {
        return;
    }
    $r = TrimGet("r");
    if (strlen($r) < 10) {
        return;
    }
    $s_Domain = strtolower($_SERVER["SERVER_NAME"]);
    if ($s_Domain == "127.0.0.1" || $s_Domain == "localhost") {
        return;
    }
    $ret = "";
    $aa = explode(";", $GLOBALS["sLicense"]);
    for ($i = 0; $i < count($aa); $i++) {
        $a = explode(":", $aa[$i]);
        if (count($a) == 8) {
            if (strlen($a[7]) == 32) {
                $b = false;
                if ($a[0] == "3") {
                    if ($a[6] == $s_Domain || "." . $a[6] == substr($s_Domain, -strlen($a[6]) - 1)) {
                        $b = true;
                    }
                } else {
                    if ($a[6] == $s_Domain || "www." . $a[6] == $s_Domain) {
                        $b = true;
                    }
                }
                if ($b) {
                    for ($j = 0; $j < 7; $j++) {
                        $ret = $ret . $a[$j] . ":";
                    }
                    $ret = $ret . MD5_16(substr($a[7], 0, 16) . $r) . MD5_16(substr($a[7], 16, 16) . $r);
                    break;
                }
            }
        }
    }
    echo $ret;
}