Advertisement
Guest User

Untitled

a guest
Apr 10th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 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. define("LICENSEDEFENDER_USERNAME_FIELD", "Default Country Name");
  15. define("LICENSEDEFENDER_LICENCECHECK_FREQUENCE", 1);
  16. define("LICENSEDEFENDER_LICENCECHECK_MAXATTEMPTS", 3);
  17. define("LICENSEDEFENDER_LASTCHECK_FIELD", "Default Payment Type");
  18. define("LICENSEDEFENDER_SUCCESSFULCONNECTION_MESSAGE", "LICENSE SERVER IS UP");
  19. define("LICENSE_ATTRIBUTE_PLUS", "plus");
  20. define("LICENSE_ATTRIBUTE_NOBRANDING", "nobranding");
  21. define("LICENSE_ATTRIBUTE_LOGKEEN", "logkeen");
  22.  
  23. /**
  24. * License validation methods.
  25. *
  26. * @package ClientExec
  27. * @access public
  28. */
  29. class LicenseDefender {
  30.  
  31.  
  32. private $settings = null;
  33. public function __construct() {
  34.  
  35. $this->settings = new CE_Settings();
  36. return;
  37. }
  38.  
  39. public function validateLicense() {
  40.  
  41. $isLicenseValid = $this->settings->get(LICENSEDEFENDER_USERNAME_FIELD);
  42. if ($isLicenseValid == "1")
  43. {
  44. return true;
  45. }
  46. if ($this->getXMLLicenseInfo() == "")
  47. {
  48. return false;
  49. }
  50. $this->updateLicense("1", time());
  51. return true;
  52. }
  53.  
  54. public function getIdentity() {
  55.  
  56. $identity = array();
  57. require_once "library/CE/NE_UserGateway.php";
  58. $userGateway = new NE_UserGateway();
  59. $superadmin = $userGateway->getSuperAdminEmail();
  60. if (trim($superadmin["email"]) == "")
  61. {
  62. return $identity;
  63. }
  64. $identity["email"] = $superadmin["email"];
  65. $identity["first_name"] = $superadmin["firstname"];
  66. $identity["last_name"] = $superadmin["lastname"];
  67. return $identity;
  68. }
  69.  
  70. public function getXMLLicenseInfo() {
  71.  
  72. if ($_SERVER["HTTP_HOST"] == "localhost")
  73. {
  74. return $_SERVER["HTTP_HOST"];
  75. }
  76. require_once "library/encrypted/Clientexec.php";
  77. require_once "library/CE/NE_UserGateway.php";
  78. require_once "library/CE/RestRequest.php";
  79. $userGateway = new NE_UserGateway();
  80. $superadmin = $userGateway->getSuperAdminEmail();
  81. if (trim($superadmin["email"]) == "")
  82. {
  83. CE_Lib::log(1, "License validation failed due to invalid email for admin");
  84. return "";
  85. }
  86. $username = @$this->getUserName();
  87. $username = str_replace(" ", "~", $username);
  88. if (isset($_SERVER["SCRIPT_URI"]))
  89. {
  90. $URI = $_SERVER["SCRIPT_URI"];
  91. }
  92. else
  93. {
  94. $URI = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
  95. }
  96. if (trim($superadmin["email"]) == "")
  97. {
  98. $parameters = array("username" => $username, "domain" => $_SERVER["HTTP_HOST"], "dir" => $URI, "instance" => "CLIENTEXEC", "version" => CE_Lib::getAppVersion(), "email" => "noemail", "first_name" => "nofirstname", "last_name" => "nolastname", "php_version" => phpversion(), "usage" => Clientexec::getusage());
  99. }
  100. else
  101. {
  102. $parameters = array("username" => $username, "domain" => $_SERVER["HTTP_HOST"], "dir" => $URI, "instance" => "CLIENTEXEC", "version" => CE_Lib::getAppVersion(), "php_version" => phpversion(), "email" => $superadmin["email"], "first_name" => $superadmin["firstname"], "last_name" => $superadmin["lastname"], "usage" => Clientexec::getusage());
  103. }
  104. try
  105. {
  106. $request = new RestRequest("https://www.licensedefender.com/api/v2/check/license/", "POST");
  107. $request->buildPostBody($parameters);
  108. $request->execute();
  109. $tResult = $request->getResponseBody();
  110. $tResult = explode("|", $tResult);
  111. }
  112. catch (Exception $e)
  113. {
  114. return "";
  115. }
  116. if ($tResult[0] == "" || $tResult[0] == "-1" || $tResult[0] == -1)
  117. {
  118. return "";
  119. }
  120. return $_SERVER["HTTP_HOST"];
  121. }
  122. .....................................................................
  123. ....................................
  124. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement