- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
function check_license()
{
$m = 40141;
$p = 291;
$root_dir = dirname(__FILE__);
$fn = 'file_get_contents';
$lic = ($root_dir.'/license');
$d = split(' ', trim(file_get_contents($lic)));
$result = 1;
$max = count($d);
for ($j=0x0; $j<$max; $j++)
{
$b=base_convert($d[$j],36,10);
$result = 1;
for($i=0x0; $i<$p; $i++)
{
$result = ($result*$b) % $m;
}
$decoded .= chr($result);
}
$license = split('#', $decoded);
$hash = $license[1];
$data = $license[0];
$host = $host1 = $_SERVER['HTTP_HOST'];
$host2 = getenv('HTTP_HOST');
if(function_exists('apache_getenv'))
$host3 = apache_getenv('HTTP_HOST');
else
$host3 = $host1;
if(!($host1 == $host2 && $host1 == $host3))
return false;
$ip = getenv('REMOTE_ADDR');
if($_SERVER['REMOTE_ADDR'] == $ip && substr($ip,0,3)=='127' && strtoupper(substr(php_uname(), 0, 3)) === 'WIN' )
{
return true;
}
$l_array = split(';', $data);
$domain = $l_array[0];
if(isset($l_array[1]))
$start = $l_array[1];
else
return false;
if(isset($l_array[2]))
$end = $l_array[2];
else
return false;
if(isset($l_array[3]))
$comment = $l_array[3];
else
$comment = '';
$domns = split(',', $domain);
$ok = false;
foreach($domns as $d)
{
if(strtolower(trim($d)) == strtolower($host))
$ok = true;
}
if(!$ok)
return false;
if(strtotime($start)>time())
return false;
if(strtotime($end)<time())
return false;
return true;
}