Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- function vpnpanel_config()
- {
- $configarray = [
- 'name' => 'VPN Panel',
- 'description' => 'The module provide the VPN User and Reseller Management.',
- 'author' => '<img src="../modules/addons/vpnpanel/whmcssmarters.png"><br><a href="https://whmcssmarters.com/" target="_blank">WHMCS Smarters</a>',
- 'language' => 'english',
- 'version' => '2.10',
- 'fields' => [
- 'licenseregto' => ['FriendlyName' => 'License Registered To', 'Description' => 'Not Available'],
- 'licenseregmail' => ['FriendlyName' => 'License Registered Email', 'Description' => 'Not Available'],
- 'licenseduedate' => ['FriendlyName' => 'License Due Date', 'Description' => 'Not Available'],
- 'licensestatus' => ['FriendlyName' => 'License Status', 'Description' => 'Not Available'],
- 'license' => ['FriendlyName' => 'License', 'Type' => 'text', 'Size' => '35'],
- 'deletetables' => ['FriendlyName' => 'Delete Records', 'Type' => 'yesno', 'Size' => '25', 'Description' => 'Tick to check it should delete all the tables relative to this module on deactivation'],
- 'downloadbutton' => ['FriendlyName' => 'Download Cetificate Button', 'Type' => 'yesno', 'Description' => 'Tick to Show Download Button On Client Area.']
- ]
- ];
- $licenseinfo = vpnpanel_doCheckLicense();
- if ($licenseinfo['status'] != 'licensekeynotfound') {
- if ($licenseinfo['status'] == 'Active') {
- if (isset($licenseinfo['localkey']) && !empty($licenseinfo['localkey'])) {
- $moduledata = WHMCS\Database\Capsule::table('tbladdonmodules')->where('module', '=', 'vpnpanel')->where('setting', '=', 'localkey')->get();
- if (isset($moduledata[0]->setting) && !empty($moduledata[0]->setting)) {
- WHMCS\Database\Capsule::table('tbladdonmodules')->where('setting', 'localkey')->where('module', 'vpnpanel')->update(['value' => $licenseinfo['localkey']]);
- }
- else {
- WHMCS\Database\Capsule::table('tbladdonmodules')->insert(['setting' => 'localkey', 'value' => $licenseinfo['localkey'], 'module' => 'vpnpanel']);
- }
- }
- }
- if ($licenseinfo['registeredname']) {
- $configarray['fields']['licenseregto']['Description'] = $licenseinfo['registeredname'];
- }
- if ($licenseinfo['email']) {
- $configarray['fields']['licenseregmail']['Description'] = $licenseinfo['email'];
- }
- if ($licenseinfo['nextduedate']) {
- $configarray['fields']['licenseduedate']['Description'] = $licenseinfo['nextduedate'];
- }
- $configarray['fields']['licensestatus']['Description'] = $licenseinfo['status'];
- $configarray['fields']['license']['Value'] = $licenseinfo['licensekey'];
- }
- return $configarray;
- }
- function vpnpanel_doCheckLicense()
- {
- $result = WHMCS\Database\Capsule::table('tbladdonmodules')->where('module', '=', 'vpnpanel')->get();
- foreach ($result as $row) {
- $settings[$row->setting] = $row->value;
- }
- if ($settings['license']) {
- $localkey = $settings['localkey'];
- $licenseinfo = $result = vpnpanel_checkLicense($settings['license'], $localkey);
- if ($licenseinfo['status'] == 'Active') {
- if (isset($licenseinfo['localkey']) && !empty($licenseinfo['localkey'])) {
- $moduledata = WHMCS\Database\Capsule::table('tbladdonmodules')->where('module', '=', 'vpnpanel')->where('setting', '=', 'localkey')->get();
- if (isset($moduledata[0]->setting) && !empty($moduledata[0]->setting)) {
- WHMCS\Database\Capsule::table('tbladdonmodules')->where('setting', 'localkey')->where('module', 'vpnpanel')->update(['value' => $licenseinfo['localkey']]);
- }
- else {
- WHMCS\Database\Capsule::table('tbladdonmodules')->insert(['setting' => 'localkey', 'value' => $licenseinfo['localkey'], 'module' => 'vpnpanel']);
- }
- }
- }
- $result['licensekey'] = $settings['license'];
- }
- else {
- $result['status'] = 'licensekeynotfound';
- }
- return $result;
- }
- function vpnpanel_checkLicense($licensekey, $localkey = '')
- {
- $whmcsurl = 'https://www.whmcssmarters.com/clients/';
- .......................................................................
- ..................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement