Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.6.0
- * @ Author : DeZender
- * @ Release on : 02.06.2013
- * @ Official site : http://DeZender.Net
- *
- */
- define("LICENSEDEFENDER_USERNAME_FIELD", "Default Country Name");
- define("LICENSEDEFENDER_LICENCECHECK_FREQUENCE", 1);
- define("LICENSEDEFENDER_LICENCECHECK_MAXATTEMPTS", 3);
- define("LICENSEDEFENDER_LASTCHECK_FIELD", "Default Payment Type");
- define("LICENSEDEFENDER_SUCCESSFULCONNECTION_MESSAGE", "LICENSE SERVER IS UP");
- define("LICENSE_ATTRIBUTE_PLUS", "plus");
- define("LICENSE_ATTRIBUTE_NOBRANDING", "nobranding");
- define("LICENSE_ATTRIBUTE_LOGKEEN", "logkeen");
- /**
- * License validation methods.
- *
- * @package ClientExec
- * @access public
- */
- class LicenseDefender {
- private $settings = null;
- public function __construct() {
- $this->settings = new CE_Settings();
- return;
- }
- public function validateLicense() {
- $isLicenseValid = $this->settings->get(LICENSEDEFENDER_USERNAME_FIELD);
- if ($isLicenseValid == "1")
- {
- return true;
- }
- if ($this->getXMLLicenseInfo() == "")
- {
- return false;
- }
- $this->updateLicense("1", time());
- return true;
- }
- public function getIdentity() {
- $identity = array();
- require_once "library/CE/NE_UserGateway.php";
- $userGateway = new NE_UserGateway();
- $superadmin = $userGateway->getSuperAdminEmail();
- if (trim($superadmin["email"]) == "")
- {
- return $identity;
- }
- $identity["email"] = $superadmin["email"];
- $identity["first_name"] = $superadmin["firstname"];
- $identity["last_name"] = $superadmin["lastname"];
- return $identity;
- }
- public function getXMLLicenseInfo() {
- if ($_SERVER["HTTP_HOST"] == "localhost")
- {
- return $_SERVER["HTTP_HOST"];
- }
- require_once "library/encrypted/Clientexec.php";
- require_once "library/CE/NE_UserGateway.php";
- require_once "library/CE/RestRequest.php";
- $userGateway = new NE_UserGateway();
- $superadmin = $userGateway->getSuperAdminEmail();
- if (trim($superadmin["email"]) == "")
- {
- CE_Lib::log(1, "License validation failed due to invalid email for admin");
- return "";
- }
- $username = @$this->getUserName();
- $username = str_replace(" ", "~", $username);
- if (isset($_SERVER["SCRIPT_URI"]))
- {
- $URI = $_SERVER["SCRIPT_URI"];
- }
- else
- {
- $URI = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
- }
- if (trim($superadmin["email"]) == "")
- {
- $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());
- }
- else
- {
- $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());
- }
- try
- {
- $request = new RestRequest("https://www.licensedefender.com/api/v2/check/license/", "POST");
- $request->buildPostBody($parameters);
- $request->execute();
- $tResult = $request->getResponseBody();
- $tResult = explode("|", $tResult);
- }
- catch (Exception $e)
- {
- return "";
- }
- if ($tResult[0] == "" || $tResult[0] == "-1" || $tResult[0] == -1)
- {
- return "";
- }
- return $_SERVER["HTTP_HOST"];
- }
- .....................................................................
- ....................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement