Advertisement
Guest User

Untitled

a guest
Feb 7th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 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.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function vpnpanel_config()
  15. {
  16. $configarray = [
  17. 'name' => 'VPN Panel',
  18. 'description' => 'The module provide the VPN User and Reseller Management.',
  19. 'author' => '<img src="../modules/addons/vpnpanel/whmcssmarters.png"><br><a href="https://whmcssmarters.com/" target="_blank">WHMCS Smarters</a>',
  20. 'language' => 'english',
  21. 'version' => '2.10',
  22. 'fields' => [
  23. 'licenseregto' => ['FriendlyName' => 'License Registered To', 'Description' => 'Not Available'],
  24. 'licenseregmail' => ['FriendlyName' => 'License Registered Email', 'Description' => 'Not Available'],
  25. 'licenseduedate' => ['FriendlyName' => 'License Due Date', 'Description' => 'Not Available'],
  26. 'licensestatus' => ['FriendlyName' => 'License Status', 'Description' => 'Not Available'],
  27. 'license' => ['FriendlyName' => 'License', 'Type' => 'text', 'Size' => '35'],
  28. 'deletetables' => ['FriendlyName' => 'Delete Records', 'Type' => 'yesno', 'Size' => '25', 'Description' => 'Tick to check it should delete all the tables relative to this module on deactivation'],
  29. 'downloadbutton' => ['FriendlyName' => 'Download Cetificate Button', 'Type' => 'yesno', 'Description' => 'Tick to Show Download Button On Client Area.']
  30. ]
  31. ];
  32. $licenseinfo = vpnpanel_doCheckLicense();
  33.  
  34. if ($licenseinfo['status'] != 'licensekeynotfound') {
  35. if ($licenseinfo['status'] == 'Active') {
  36. if (isset($licenseinfo['localkey']) && !empty($licenseinfo['localkey'])) {
  37. $moduledata = WHMCS\Database\Capsule::table('tbladdonmodules')->where('module', '=', 'vpnpanel')->where('setting', '=', 'localkey')->get();
  38. if (isset($moduledata[0]->setting) && !empty($moduledata[0]->setting)) {
  39. WHMCS\Database\Capsule::table('tbladdonmodules')->where('setting', 'localkey')->where('module', 'vpnpanel')->update(['value' => $licenseinfo['localkey']]);
  40. }
  41. else {
  42. WHMCS\Database\Capsule::table('tbladdonmodules')->insert(['setting' => 'localkey', 'value' => $licenseinfo['localkey'], 'module' => 'vpnpanel']);
  43. }
  44. }
  45. }
  46.  
  47. if ($licenseinfo['registeredname']) {
  48. $configarray['fields']['licenseregto']['Description'] = $licenseinfo['registeredname'];
  49. }
  50.  
  51. if ($licenseinfo['email']) {
  52. $configarray['fields']['licenseregmail']['Description'] = $licenseinfo['email'];
  53. }
  54.  
  55. if ($licenseinfo['nextduedate']) {
  56. $configarray['fields']['licenseduedate']['Description'] = $licenseinfo['nextduedate'];
  57. }
  58.  
  59. $configarray['fields']['licensestatus']['Description'] = $licenseinfo['status'];
  60. $configarray['fields']['license']['Value'] = $licenseinfo['licensekey'];
  61. }
  62.  
  63. return $configarray;
  64. }
  65.  
  66. function vpnpanel_doCheckLicense()
  67. {
  68. $result = WHMCS\Database\Capsule::table('tbladdonmodules')->where('module', '=', 'vpnpanel')->get();
  69.  
  70. foreach ($result as $row) {
  71. $settings[$row->setting] = $row->value;
  72. }
  73.  
  74. if ($settings['license']) {
  75. $localkey = $settings['localkey'];
  76. $licenseinfo = $result = vpnpanel_checkLicense($settings['license'], $localkey);
  77.  
  78. if ($licenseinfo['status'] == 'Active') {
  79. if (isset($licenseinfo['localkey']) && !empty($licenseinfo['localkey'])) {
  80. $moduledata = WHMCS\Database\Capsule::table('tbladdonmodules')->where('module', '=', 'vpnpanel')->where('setting', '=', 'localkey')->get();
  81. if (isset($moduledata[0]->setting) && !empty($moduledata[0]->setting)) {
  82. WHMCS\Database\Capsule::table('tbladdonmodules')->where('setting', 'localkey')->where('module', 'vpnpanel')->update(['value' => $licenseinfo['localkey']]);
  83. }
  84. else {
  85. WHMCS\Database\Capsule::table('tbladdonmodules')->insert(['setting' => 'localkey', 'value' => $licenseinfo['localkey'], 'module' => 'vpnpanel']);
  86. }
  87. }
  88. }
  89.  
  90. $result['licensekey'] = $settings['license'];
  91. }
  92. else {
  93. $result['status'] = 'licensekeynotfound';
  94. }
  95.  
  96. return $result;
  97. }
  98.  
  99. function vpnpanel_checkLicense($licensekey, $localkey = '')
  100. {
  101. $whmcsurl = 'https://www.whmcssmarters.com/clients/';
  102. .......................................................................
  103. ..................................
  104. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement