Advertisement
Guest User

Untitled

a guest
Oct 7th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.6.0
  8. * @ Author : DeZender
  9. * @ Release on : 02.06.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. /**
  15. * SPBAS License Validation
  16. *
  17. * @license Commercial / Proprietary
  18. * @copyright SolidPHP, Inc.
  19. * @package SPBAS_License_Method
  20. * @author Andy Rockwell <[email protected]>
  21. */
  22. class spbas {
  23. public $errors = null;
  24. public $license_key = null;
  25. public $api_server = null;
  26. public $remote_port = null;
  27. public $remote_timeout = null;
  28. public $local_key_storage = null;
  29. public $read_query = null;
  30. public $update_query = null;
  31. public $local_key_path = null;
  32. public $local_key_name = null;
  33. public $local_key_transport_order = null;
  34. public $local_key_grace_period = null;
  35. public $local_key_last = null;
  36. public $validate_download_access = null;
  37. public $release_date = null;
  38. public $key_data = null;
  39. public $status_messages = null;
  40. public $valid_for_product_tiers = null;
  41.  
  42. public function spbas() {
  43. $this->errors = false;
  44. $this->remote_port = 80;
  45. $this->remote_timeout = 10;
  46. $this->valid_local_key_types = array( 'spbas' );
  47. $this->local_key_type = 'spbas';
  48. $this->local_key_storage = 'filesystem';
  49. $this->local_key_grace_period = 0;
  50. $this->local_key_last = 0;
  51. $this->read_query = false;
  52. $this->update_query = false;
  53. $this->local_key_path = './';
  54. $this->local_key_name = 'license.txt';
  55. $this->local_key_transport_order = 'csf';
  56. $this->validate_download_access = false;
  57. $this->release_date = false;
  58. $this->valid_for_product_tiers = false;
  59. $this->key_data = array( 'custom_fields' => array( ), 'download_access_expires' => 0, 'license_expires' => 0, 'local_key_expires' => 0, 'status' => 'Invalid' );
  60. $this->status_messages = array( 'active' => 'This license is active.', 'suspended' => 'Error: This license has been suspended.', 'expired' => 'Error: This license has expired.', 'pending' => 'Error: This license is pending review.', 'download_access_expired' => 'Error: This version of the software was released ' . 'after your download access expired. Please ' . 'downgrade or contact support for more information.', 'missing_license_key' => 'Error: The license key variable is empty.', 'unknown_local_key_type' => 'Error: An unknown type of local key validation was requested.', 'could_not_obtain_local_key' => 'Error: I could not obtain a new local license key.', 'maximum_grace_period_expired' => 'Error: The maximum local license key grace period has expired.', 'local_key_tampering' => 'Error: The local license key has been tampered with or is invalid.', 'local_key_invalid_for_location' => 'Error: The local license key is invalid for this location.', 'missing_license_file' => 'Error: Please create the following file (and directories if they don\'t exist already):<br />
  61. <br />
  62. ', 'license_file_not_writable' => 'Error: Please make the following path writable:<br />', 'invalid_local_key_storage' => 'Error: I could not determine the local key storage on clear.', 'could_not_save_local_key' => 'Error: I could not save the local license key.', 'license_key_string_mismatch' => 'Error: The local key is invalid for this license.' );
  63. $this->localization = array( 'active' => 'This license is active.', 'suspended' => 'Error: This license has been suspended.', 'expired' => 'Error: This license has expired.', 'pending' => 'Error: This license is pending review.', 'download_access_expired' => 'Error: This version of the software was released ' . 'after your download access expired. Please ' . 'downgrade or contact support for more information.' );
  64. }
  65.  
  66. /**
  67. * Validate the license
  68. *
  69. * @return string
  70. */
  71. public function validate() {
  72. if (!$this->license_key) {
  73. return $this->errors = $this->status_messages['missing_license_key'];
  74. }
  75.  
  76.  
  77. if (!in_array( strtolower( $this->local_key_type ), $this->valid_local_key_types )) {
  78. return $this->errors = $this->status_messages['unknown_local_key_type'];
  79. }
  80.  
  81. $this->trigger_grace_period = $this->status_messages['could_not_obtain_local_key'];
  82. switch ($this->local_key_storage) {
  83. case 'database': {
  84. $local_key = $this->db_read_local_key( );
  85. break;
  86. }
  87.  
  88. case 'filesystem': {
  89. $local_key = $this->read_local_key( );
  90. break;
  91. }
  92.  
  93. default: {
  94. return $this->errors = $this->status_messages['missing_license_key'];
  95. }
  96. }
  97. ...............................................................
  98. .................................
  99. .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement