Advertisement
Guest User

Untitled

a guest
Dec 10th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 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.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class licensing {
  15. /**
  16. * Validate licensing
  17. *
  18. * @param string $api_fingerprint
  19. * @param string $server
  20. * @param string $RPC
  21. * @param string $license
  22. * @return mixed string on error; array on success
  23. */
  24. function validate_license($api_fingerprint, $server, $RPC, $license) {
  25. $returned = licensing::parse_xml( licensing::validate_local_key( ) );
  26.  
  27. if (( $returned['status'] == 'grab_new_key' || $returned['status'] == 'expired' )) {
  28. $returned = licensing::parse_xml( licensing::go_remote( $method, $server, $license ) );
  29.  
  30. if (empty( $returned )) {
  31. $returned['status'] = 'invalid';
  32. }
  33.  
  34. licensing::go_remote_api( $RPC, $api_fingerprint, $license );
  35. $returned = licensing::parse_xml( licensing::validate_local_key( true ) );
  36. }
  37.  
  38.  
  39. if (( $returned['status'] != 'active' && $returned['status'] != 'reissued' )) {
  40. if (empty( $returned )) {
  41. $returned['status'] = 'invalid';
  42. }
  43.  
  44. $errors = false;
  45.  
  46. if ($returned['status'] == 'suspended') {
  47. $errors = 'This license has been suspended.';
  48. } else {
  49. if ($returned['status'] == 'pending') {
  50. $errors = 'This license is pending admin approval.';
  51. } else {
  52. if ($returned['status'] == 'expired') {
  53. $errors = 'This license is expired.';
  54. } else {
  55. if ($returned['status'] == 'renew') {
  56. $errors = $returned['message'];
  57. } else {
  58. if (( $returned['status'] == 'active' && strcmp( md5( 'a666d67aae067313345c74abd7b666b0' . $token ), $returned['access_token'] ) != 0 )) {
  59. $errors = 'This license has an invalid checksum.';
  60. } else {
  61. if (!empty( $errors )) {
  62. $errors = false;
  63. }
  64.  
  65. $errors = 'This license appears to be invalid.';
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
  72.  
  73.  
  74. if (!empty( $errors )) {
  75. $errors = false;
  76. }
  77.  
  78. return ($errors ? $errors : $returned);
  79. }
  80. .......................................................................
  81. ........................................
  82. ....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement