Guest User

Untitled

a guest
Aug 6th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class ovh_vps_and_dedicated_servers_license_1743PDOWrapper
  15. {
  16. static private $pdoConnection;
  17.  
  18. static private function getDbConnection()
  19. {
  20. if (class_exists('Illuminate\\Database\\Capsule\\Manager')) {
  21. return Illuminate\Database\Capsule\Manager::connection()->getPdo();
  22. }
  23.  
  24. if (self::$pdoConnection === NULL) {
  25. self::$pdoConnection = self::setNewConnection();
  26. }
  27.  
  28. return self::$pdoConnection;
  29. }
  30.  
  31. static private function setNewConnection()
  32. {
  33. try {
  34. $includePath = ROOTDIR . DIRECTORY_SEPARATOR . 'configuration.php';
  35.  
  36. if (file_exists($includePath)) {
  37. require $includePath;
  38. }
  39. else {
  40. throw new Exception('No configuration file found');
  41. }
  42.  
  43. $connection = new PDO(sprintf('mysql:host=%s;dbname=%s;port=%s;charset=utf8', $db_host, $db_name, $db_port ? $db_port : 3360), $db_username, $db_password);
  44. $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  45. return $connection;
  46. }
  47. catch (PDOException $exc) {
  48. }
  49. }
  50.  
  51. static public function query($query, $params = [])
  52. {
  53. $statement = self::getDbConnection()->prepare($query);
  54. $statement->execute($params);
  55. return $statement;
  56. }
  57.  
  58. static public function real_escape_string($string)
  59. {
  60. return substr(self::getDbConnection()->quote($string), 1, -1);
  61. }
  62.  
  63. static public function fetch_assoc($query)
  64. {
  65. return $query->fetch(PDO::FETCH_ASSOC);
  66. }
  67.  
  68. static public function fetch_array($query)
  69. {
  70. return $query->fetch(PDO::FETCH_BOTH);
  71. }
  72.  
  73. static public function fetch_object($query)
  74. {
  75. return $query->fetch(PDO::FETCH_OBJ);
  76. }
  77.  
  78. static public function num_rows($query)
  79. {
  80. $query->fetch(PDO::FETCH_BOTH);
  81. return $query->rowCount();
  82. }
  83.  
  84. static public function insert_id()
  85. {
  86. return self::getDbConnection()->lastInsertId();
  87. }
  88.  
  89. static public function errorInfo()
  90. {
  91. $tmpErr = self::getDbConnection()->errorInfo();
  92. if ($tmpErr[0] && ($tmpErr[0] !== '00000')) {
  93. return $tmpErr;
  94. }
  95.  
  96. return false;
  97. }
  98.  
  99. static public function mysql_get_array($query, $params = [])
  100. {
  101. $qRes = self::query($query, $params);
  102. $arr = [];
  103.  
  104. while ($row = self::fetch_assoc($qRes)) {
  105. $arr[] = $row;
  106. }
  107.  
  108. return $arr;
  109. }
  110.  
  111. static public function mysql_get_row($query, $params = [])
  112. {
  113. $qRes = self::query($query, $params);
  114. return self::fetch_assoc($qRes);
  115. }
  116. }
  117.  
  118. final class ovh_vps_and_dedicated_servers_license_1743
  119. {
  120. const STATUS_ACTIVE = 'active';
  121. const STATUS_INVALID = 'invalid';
  122. const STATUS_INVALID_IP = 'invalid_ip';
  123. const STATUS_INVALID_DOMAIN = 'invalid_domain';
  124. const STATUS_INVALID_DIRECTORY = 'invalid_directory';
  125. const STATUS_EXPIRED = 'expired';
  126. const STATUS_NO_CONNECTION = 'no_connection';
  127. const STATUS_WRONG_RESPONSE = 'wrong_response';
  128. const ERRORS = ['active' => 'Your module license is active.', 'invalid' => 'Your module license is invalid.', 'invalid_ip' => 'Your module license is invalid.', 'invalid_domain' => 'Your module license is invalid.', 'invalid_directory' => 'Your module license is invalid.', 'expired' => 'Your module license has expired.', 'no_connection' => 'Connection not possible. Please report your server IP to contact@modulesgarden.com', 'wrong_response' => 'Connection not possible. Please report your server IP to contact@modulesgarden.com'];
  129.  
  130. /**
  131. * @var array
  132. */
  133. protected $servers = ['https://www.modulesgarden.com/client-area/', 'https://licensing.modulesgarden.com', 'https://zeus.licensing.modulesgarden.com', 'https://ares.licensing.modulesgarden.com', 'https://hades.licensing.modulesgarden.com'];
  134. protected $db = 'ovh_vps_and_dedicated_servers_license_1743PDOWrapper';
  135. protected $verifyPath = 'modules/servers/licensing/verify.php';
  136. protected $moduleName;
  137. protected $secret = '';
  138. protected $localKeyValidTime = 1;
  139. protected $allowCheckFailDays = 4;
  140. protected $dir;
  141. protected $checkToken;
  142. protected $licenseKey = '';
  143.  
  144. /**
  145. * ovh_vps_and_dedicated_servers_license_1743 constructor.
  146. * @param $moduleName
  147. * @throws Exception
  148. */
  149. protected function __construct($moduleName)
  150. {
  151. $this->moduleName = $moduleName;
  152. $this->dir = $this->getModuleDir();
  153. ...................................................................................
  154. ..........................................
  155. ..............
Add Comment
Please, Sign In to add comment