Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP8 Decoder for ionCube Encoder)
- *
- * @ Version : 8.1.0.0
- * @ Author : DeZender
- * @ Release on : 21.06.2023
- * @ Official site : http://DeZender.Net
- *
- */
- namespace WHMCS\Module\Addon\Transferwise\Admin;
- /**
- * Sample Admin Area Controller
- */
- class Controller
- {
- /** @var \Smarty Contain a smarty instance */
- public $view = null;
- /** @var string Contain chosen tabs name */
- public $action = null;
- /** @var string Contain a module link */
- public $modulelink = null;
- /** @var array Contain "vars" array from WHMCS */
- protected $vars = null;
- protected $whmcs = null;
- protected $settings = null;
- protected $license = null;
- /**
- * Constructor.
- *
- * @param array $vars "vars" array from WHCMS.
- */
- public function __construct($vars, $controllerName)
- {
- global $templates_compiledir;
- global $customadminpath;
- global $module;
- global $_LANG;
- global $CONFIG;
- $this->view = new \Smarty();
- $this->whmcs = new Service\WhmcsService();
- $this->view->template_dir = ROOTDIR . '/modules/addons/' . $module . '/templates/';
- $this->view->compile_dir = $templates_compiledir;
- $this->view->assign('_LANG', $_LANG);
- $this->view->assign('_CONFIG', $CONFIG);
- $this->view->assign('csrfToken', generate_token('plain'));
- $this->settings = $this->getSettings();
- $this->vars = $vars;
- $this->view->assign('vars', $this->vars);
- $this->view->assign('module', $module);
- $this->view->assign('controller', $controllerName);
- $this->view->assign('customadminpath', $customadminpath);
- $this->modulelink = $CONFIG['SystemURL'] . '/' . $customadminpath . '/addonmodules.php?module=' . $module;
- $this->view->assign('modulelink', $this->modulelink);
- $licenseCheck = $this->checkLicense($this->settings['licensekey'], $this->settings['localkey']);
- if ($licenseCheck['status'] == 'Active') {
- if ($licenseCheck['remotecheck'] == 1) {
- $this->updateLocalKey($licenseCheck['localkey']);
- }
- }
- $this->license = ['status' => $licenseCheck['status'], 'nextduedate' => $licenseCheck['nextduedate'], 'billingcycle' => $licenseCheck['billingcycle'], 'checkdate' => $licenseCheck['checkdate']];
- }
- private function updateLocalKey($localKey)
- {
- $localKeyExists = \WHMCS\Database\Capsule::table('trws_config')->select('value')->where('setting', 'localkey')->exists();
- if ($localKeyExists) {
- $result = \WHMCS\Database\Capsule::table('trws_config')->where('setting', 'localkey')->update(['value' => $localKey]);
- return $result;
- }
- else {
- $result = \WHMCS\Database\Capsule::table('trws_config')->insert(['setting' => 'localkey', 'value' => $localKey]);
- ........................................................................
- ................................................
- .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement