· 7 years ago · Jun 26, 2018, 11:20 AM
1$_SERVER['HTTP_HOST'] = 'yandex.ru';
2$SYSTEM_KEY = '0fb5-6c08-2e45-b8c5';
3
4class Key
5 {
6 function __construct ( $key )
7 {
8 $this->key = intval ( $key );
9 }
10 public function generate ()
11 {
12 $md5 = explode( '.', $_SERVER['HTTP_HOST'] );
13 $count = count( $md5 ) - 1;
14
15 foreach ( $md5 as $array )
16 {
17 $end .= md5( sha1 (md5 ( $array[$count] . $this->key ) . $this->key ) . $this->key);
18 }
19
20 $end = substr( $end, 0, 16 );
21 $GLOBALS['SYSTEM_KEY'] = str_replace( '-', '', $GLOBALS['SYSTEM_KEY'] );
22
23 if( $GLOBALS['SYSTEM_KEY'] == $end )
24 {
25 return true;
26 }
27
28 }
29 }
30
31$Key = new Key(1934);
32
33if( !$Key->generate () )
34 die ( 'License Error!' );