Advertisement
Guest User

Untitled

a guest
May 28th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.0.8.0
  8. * @ Author : DeZender
  9. * @ Release on : 25.09.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class checklicense
  15. {
  16. protected $cl_license_server = null;
  17. protected $cl_ip_address = null;
  18. protected $cl_product_key = null;
  19. protected $cl_license_array = null;
  20. protected $cl_cache_time = null;
  21. protected $cl_cache_file = null;
  22.  
  23. public function __construct($license_server, $cache_time)
  24. {
  25. $this->cl_ip_address = getenv( 'HTTP_HOST' );
  26. $this->cl_product_key = NULL;
  27. $this->cl_license_server = $license_server;
  28. $this->cl_cache_time = $cache_time;
  29. $this->cl_cache_file = 'cache/' . md5( $this->cl_license_server . $this->cl_ip_address ) . '.cache';
  30. $this->_check_ip_address( );
  31. $this->_create_product_key( );
  32.  
  33. if ($this->_is_available_cache( ) != true) {
  34. $this->_write_cache( $this->cl_cache_file, $this->_get_license_file( ) );
  35. $this->_check_license( $this->_read_cache( $this->cl_cache_file ) );
  36. }
  37. else {
  38. $this->_check_license( $this->_read_cache( $this->cl_cache_file ) );
  39. }
  40. }
  41.  
  42. protected function _check_ip_address()
  43. {
  44. if (!(is_numeric( substr( $this->cl_ip_address, 0, 3 ) ))) {
  45. if (substr( $this->cl_ip_address, 0, 4 ) == 'www.') {
  46. $this->cl_ip_address = substr( $this->cl_ip_address, 4 );
  47. }
  48. }
  49. }
  50.  
  51. protected function _create_product_key()
  52. {
  53. $this->cl_product_key = wordwrap( strtoupper( md5( sha1( sha1( $this->cl_ip_address ) ) ) ), 4, '-', true );
  54. }
  55.  
  56. protected function _check_license(array $data)
  57. {
  58. if (!(in_array( $this->cl_product_key, $data ))) {
  59. exit( );
  60. }
  61. }
  62.  
  63. protected function _get_license_file()
  64. {
  65. if (function_exists( 'file' )) {
  66. $file = file( $this->cl_license_server, FILE_IGNORE_NEW_LINES );
  67. $data = array( );
  68.  
  69. foreach ($file as $key => $value) {
  70. $data[$key] = rtrim( $value, '\\r\\n' );
  71. }
  72.  
  73. return $data;
  74. }
  75. }
  76.  
  77. protected function _is_available_cache()
  78. {
  79. if (!(file_exists( 'cache' ))) {
  80. ....................................................................
  81. ....................................
  82. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement