Advertisement
Guest User

Untitled

a guest
Oct 16th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for SourceGuardian & phpSHIELD)
  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. * Licensing Class.
  16. *
  17. * @author Andy Rockwell <andy@solidphp.com>
  18. */
  19. class licensing {
  20. /**
  21. * Validate licensing
  22. *
  23. * @param string $api_fingerprint
  24. * @param string $server
  25. * @param string $RPC
  26. * @param string $license
  27. * @return mixed string on error; array on success
  28. */
  29. public function validate_license($api_fingerprint, $server, $RPC, $license) {
  30. $returned = licensing::parse_xml( licensing::validate_local_key( ) );
  31.  
  32. if (( $returned['status'] == 'grab_new_key' || $returned['status'] == 'expired' )) {
  33. $returned = licensing::parse_xml( licensing::go_remote( $method, $server, $license ) );
  34.  
  35. if (empty( $returned )) {
  36. $returned['status'] = 'invalid';
  37. }
  38.  
  39.  
  40. if (( $returned['status'] == 'active' || $returned['status'] == 'reissued' )) {
  41. licensing::go_remote_api( $RPC, $api_fingerprint, $license );
  42. $returned = licensing::parse_xml( licensing::validate_local_key( true ) );
  43. }
  44. }
  45.  
  46.  
  47. if (( $returned['status'] != 'active' && $returned['status'] != 'reissued' )) {
  48. if (empty( $returned )) {
  49. $returned['status'] = 'invalid';
  50. }
  51.  
  52. $errors = false;
  53.  
  54. if ($returned['status'] == 'suspended') {
  55. $errors = 'This license has been suspended.';
  56. } else {
  57. if ($returned['status'] == 'pending') {
  58. $errors = 'This license is pending admin approval.';
  59. } else {
  60. if ($returned['status'] == 'expired') {
  61. $errors = 'This license is expired.';
  62. } else {
  63. if ($returned['status'] == 'renew') {
  64. $errors = $returned['message'];
  65. } else {
  66. if (( $returned['status'] == 'active' && strcmp( md5( 'a666d67aae067313345c74abd7b666b0' . $token ), $returned['access_token'] ) != 0 )) {
  67. $errors = 'This license has an invalid checksum.';
  68. } else {
  69. $errors = 'This license appears to be invalid.';
  70. }
  71. }
  72. }
  73. }
  74. }
  75. }
  76.  
  77. return ($errors ? $errors : $returned);
  78. }
  79.  
  80. /**
  81. * Write the local license key to somewhere.
  82. *
  83. * @param string $local_key The local key data to write.
  84. * @return You choose.
  85. */
  86. public function store_local_key($local_key) {
  87. $count = mysql_fetch_row( mysql_query( 'select count(*) from settings where set_name=\'license_local_key\'' ) );
  88. ...............................................................................
  89. ....................................
  90. ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement