Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for Zend Guard Encoder)
- *
- * @ Version : 3.0.4.0
- * @ Author : DeZender
- * @ Release on : 02.04.2017
- * @ Official site : http://DeZender.Net
- *
- */
- function vpnpanel_config()
- {
- $configarray = array(
- '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.5',
- 'fields' => array(
- 'licenseregto' => array(
- 'FriendlyName' => 'License Registered To',
- 'Description' => 'Not Available'
- ),
- 'licenseregmail' => array(
- 'FriendlyName' => 'License Registered Email',
- 'Description' => 'Not Available'
- ),
- 'licenseduedate' => array(
- 'FriendlyName' => 'License Due Date',
- 'Description' => 'Not Available'
- ),
- 'licensestatus' => array(
- 'FriendlyName' => 'License Status',
- 'Description' => 'Not Available'
- ),
- 'license' => array(
- 'FriendlyName' => 'License',
- 'Type' => 'text',
- 'Size' => '35'
- ),
- 'deletetables' => array(
- 'FriendlyName' => 'Delete Records',
- 'Type' => 'yesno',
- 'Size' => '25',
- 'Description' => 'Tick to check it should delete all the tables relative to this module on deactivation'
- ),
- 'downloadbutton' => array(
- '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 ) && !(empty( $moduledata ))) {
- \WHMCS\Database\Capsule::table( 'tbladdonmodules' )->where( 'setting', 'localkey' )->where( 'module', 'vpnpanel' )->update( array( 'value' => $licenseinfo['localkey'] ) );
- }
- else {
- \WHMCS\Database\Capsule::table( 'tbladdonmodules' )->insert( array(
- '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 ) && !(empty( $moduledata ))) {
- \WHMCS\Database\Capsule::table( 'tbladdonmodules' )->where( 'setting', 'localkey' )->where( 'module', 'vpnpanel' )->update( array( 'value' => $licenseinfo['localkey'] ) );
- }
- else {
- \WHMCS\Database\Capsule::table( 'tbladdonmodules' )->insert( array(
- 'setting' => 'localkey',
- 'value' => $licenseinfo['localkey'],
- 'module' => 'vpnpanel'
- ) );
- }
- }
- }
- $result['licensekey'] = $settings['license'];
- .........................................................................
- ........................................
- ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement