* @return string
*/
- function genToken(){
+ function genToken()
+ {
return md5(time());
}
@@ -36,14 +39,13 @@ function genToken(){
* @param string $token
* @return boolean
*/
- function checkToken($token = null){
- if($token === null)
- {
+ function checkToken($token = null)
+ {
+ if ($token === null) {
$token = $this->mgToken;
}
- if($_SESSION['mg-token'] === $token)
- {
+ if ($_SESSION['mg-token'] === $token) {
return false;
}
@@ -52,15 +54,14 @@ function checkToken($token = null){
return true;
}
- function dataTablesParseRow($template,$data){
- $row = main\mtLibs\Smarty::I()->view($template,$data);
+ function dataTablesParseRow($template, $data)
+ {
+ $row = main\mtLibs\Smarty::I()->view($template, $data);
$output = array();
- if(preg_match_all('/\(?P.*?)\<\/td\>/s', $row, $result))
- {
- foreach($result['col'] as $col)
- {
+ if (preg_match_all('/\ | (?P.*?)\<\/td\>/s', $row, $result)) {
+ foreach ($result['col'] as $col) {
$output[] = $col;
}
}
@@ -68,26 +69,27 @@ function dataTablesParseRow($template,$data){
return $output;
}
- function registerErrors($errors){
+ function registerErrors($errors)
+ {
$this->registredValidationErros = $errors;
}
- function getFieldError($field,$langspace='validationErrors'){
- if(!isset($this->registredValidationErros[$field]))
- {
+ function getFieldError($field, $langspace = 'validationErrors')
+ {
+ if (!isset($this->registredValidationErros[$field])) {
return false;
}
$message = array();
- foreach($this->registredValidationErros[$field] as $type)
- {
- $message[] = main\mtLibs\Lang::absoluteT($langspace,$type);
+ foreach ($this->registredValidationErros[$field] as $type) {
+ $message[] = main\mtLibs\Lang::absoluteT($langspace, $type);
}
- return implode(',',$message);
+ return implode(',', $message);
}
- public function isActive(){
+ public function isActive()
+ {
return true;
}
}
diff --git a/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/AbstractMainDriver.php b/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/AbstractMainDriver.php
index ecc284f..c4e6fbe 100644
--- a/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/AbstractMainDriver.php
+++ b/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/AbstractMainDriver.php
@@ -2,7 +2,7 @@
namespace WHMCSExpert\mtLibs\process;
-use \WHMCSExpert as main;
+use WHMCSExpert as main;
use WHMCSExpert\mtLibs;
/**
@@ -10,13 +10,14 @@
*
* @SuppressWarnings(PHPMD)
*/
-abstract class AbstractMainDriver{
+abstract class AbstractMainDriver
+{
/**
* Single Ton Instance
*
*
*/
- static private $_instance;
+ private static $_instance;
/**
* This Var define Debug Mode in Module
@@ -65,17 +66,23 @@ abstract class AbstractMainDriver{
/**
* Disable Contruct && Clone
*/
- private final function __construct() {;}
- private final function __clone() {;}
+ final function __construct()
+ {
+ ;
+ }
+ final function __clone()
+ {
+ ;
+ }
/**
* Get SingleTon Instance
*
* @return AbstractMainDriver
*/
- public static function I($force = false, $configs = array()){
- if(empty(self::$_instance) || $force)
- {
+ public static function I($force = false, $configs = array())
+ {
+ if (empty(self::$_instance) || $force) {
$class = get_called_class();
MainInstance::setInstanceName($class);
@@ -85,24 +92,21 @@ public static function I($force = false, $configs = array()){
self::$_instance->_mainNamespace = (new \ReflectionClass($class))->getNamespaceName();
self::$_instance->_mainDIR = call_user_func(array($class,'getMainDIR'));
- $class= self::$_instance->_mainNamespace.'\Configuration';
+ $class = self::$_instance->_mainNamespace . '\Configuration';
self::$_instance->_configuration = new $class();
- foreach($configs as $name => $value)
- {
+ foreach ($configs as $name => $value) {
self::$_instance->_configuration->{$name} = $value;
}
self::$_instance->isLoaded = true;
- if(!empty(self::$_instance->_configuration->debug))
- {
+ if (!empty(self::$_instance->_configuration->debug)) {
self::$_instance->_debug = true;
}
main\mtLibs\MySQL\Query::useCurrentConnection();
-
}
return self::$_instance;
@@ -111,19 +115,21 @@ public static function I($force = false, $configs = array()){
*
* @return main\Configuration
*/
- function configuration(){
+ function configuration()
+ {
return $this->_configuration;
}
- public function isAdmin($status = null){
- if($status !== null)
- {
+ public function isAdmin($status = null)
+ {
+ if ($status !== null) {
$this->_isAdmin = $status;
}
return $this->_isAdmin;
}
- public function isDebug(){
+ public function isDebug()
+ {
return $this->_debug;
}
@@ -132,7 +138,8 @@ public function isDebug(){
*
* @return string
*/
- function getMainNamespace(){
+ function getMainNamespace()
+ {
return $this->_mainNamespace;
}
@@ -141,18 +148,19 @@ function getMainNamespace(){
*
* @return string
*/
- public function getEncryptKey(){
+ public function getEncryptKey()
+ {
- if(empty($this->encryptSecureKey))
- {
- $this->encryptSecureKey = hash('sha256', $GLOBALS['cc_encryption_hash'].$this->configuration()->encryptHash,TRUE);
+ if (empty($this->encryptSecureKey)) {
+ $this->encryptSecureKey = hash('sha256', $GLOBALS['cc_encryption_hash'] . $this->configuration()->encryptHash, true);
}
return $this->encryptSecureKey;
}
- function setMainLangContext(){
- mtLibs\Lang::setContext($this->getType().($this->isAdmin()?'AA':'CA'));
+ function setMainLangContext()
+ {
+ mtLibs\Lang::setContext($this->getType() . ($this->isAdmin() ? 'AA' : 'CA'));
}
/**
@@ -165,52 +173,50 @@ function setMainLangContext(){
* @throws main\mtLibs\exceptions\System
* @throws main\mtLibs\exceptions\System
*/
- function runControler($controller,$action = 'index',$input = array(), $type = 'HTML'){
- try{
- $className = $this->getMainNamespace()."\\controllers\\".$this->getType()."\\".($this->_isAdmin?'admin':'clientarea')."\\".$controller;
+ function runControler($controller, $action = 'index', $input = array(), $type = 'HTML')
+ {
+ try {
+ $className = $this->getMainNamespace() . "\\controllers\\" . $this->getType() . "\\" . ($this->_isAdmin ? 'admin' : 'clientarea') . "\\" . $controller;
- if(!class_exists($className))
- {
+ if (!class_exists($className)) {
throw new main\mtLibs\exceptions\System("Unable to find page");
}
$controllerOBJ = new $className($input);
// display the page or not
- if(method_exists($controllerOBJ, "isActive") && !$controllerOBJ->{"isActive"}())
+ if (method_exists($controllerOBJ, "isActive") && !$controllerOBJ->{"isActive"}()) {
throw new mtLibs\exceptions\System("No access to this page");
+ }
- if(!method_exists($controllerOBJ, $action.$type))
- {
- throw new main\mtLibs\exceptions\System("Unable to find Action: ".$action.$type);
+ if (!method_exists($controllerOBJ, $action . $type)) {
+ throw new main\mtLibs\exceptions\System("Unable to find Action: " . $action . $type);
}
- main\mtLibs\Lang::stagCurrentContext('generate'.$controller);
+ main\mtLibs\Lang::stagCurrentContext('generate' . $controller);
- main\mtLibs\Lang::addToContext(lcfirst ($controller));
+ main\mtLibs\Lang::addToContext(lcfirst($controller));
- main\mtLibs\Smarty::I()->setTemplateDir(self::I()->getModuleTemplatesDir().DS.'pages'.DS.lcfirst ($controller));
+ main\mtLibs\Smarty::I()->setTemplateDir(self::I()->getModuleTemplatesDir() . DS . 'pages' . DS . lcfirst($controller));
- $result = $controllerOBJ->{$action.$type}($input);
+ $result = $controllerOBJ->{$action . $type}($input);
- switch ($type)
- {
+ switch ($type) {
case 'HTML':
- if(empty($result['tpl']))
- {
+ if (empty($result['tpl'])) {
throw new main\mtLibs\exceptions\System("Provide Template Name");
}
- $success = isset($result['vars']['success'])?$result['vars']['success']:false;
- $error = isset($result['vars']['error'])?$result['vars']['error']:false;
+ $success = isset($result['vars']['success']) ? $result['vars']['success'] : false;
+ $error = isset($result['vars']['error']) ? $result['vars']['error'] : false;
$result = main\mtLibs\Smarty::I()->view($result['tpl'], $result['vars']);
- break;
+ break;
default:
- $success = isset($result['success'])?$result['success']:false;
- $error = isset($result['error'])?$result['error']:false;
+ $success = isset($result['success']) ? $result['success'] : false;
+ $error = isset($result['error']) ? $result['error'] : false;
}
- main\mtLibs\Lang::unstagContext('generate'.$controller);
+ main\mtLibs\Lang::unstagContext('generate' . $controller);
return array(
$result
@@ -218,7 +224,7 @@ function runControler($controller,$action = 'index',$input = array(), $type = 'H
,$error
);
} catch (\Exception $ex) {
- main\mtLibs\Lang::unstagContext('generate'.$controller);
+ main\mtLibs\Lang::unstagContext('generate' . $controller);
throw $ex;
return false;
}
@@ -231,8 +237,7 @@ function runControler($controller,$action = 'index',$input = array(), $type = 'H
*/
static function dump($input)
{
- if(self::I()->isDebug())
- {
+ if (self::I()->isDebug()) {
echo "";
print_r($input);
echo " ";
@@ -242,14 +247,17 @@ static function dump($input)
abstract public function getAssetsURL();
abstract public function getType();
- public static function getMainDIR(){
+ public static function getMainDIR()
+ {
return false;
}
- public static function getUrl(){
+ public static function getUrl()
+ {
return false;
}
- public function isActive(){
+ public function isActive()
+ {
return true;
}
}
diff --git a/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/MainInstance.php b/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/MainInstance.php
index 54b4bf9..91746d0 100644
--- a/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/MainInstance.php
+++ b/modules/addons/NFEioServiceInvoices/lib/vendor/whmcsexpert/whmcsexpert/src/WHMCSExpert/mtLibs/process/MainInstance.php
@@ -1,26 +1,30 @@
timestamp)
- {
- if (function_exists('ioncube_read_file'))
- {
- $res = ioncube_read_file($source->filepath);
- if (is_int($res)) $res = false;
- return $res;
- }
- else
- {
- return file_get_contents($source->filepath);
- }
- }
- if ($source instanceof Smarty_Config_Source)
- {
- throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
- }
- throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
- }
-
+ public function getContent(Smarty_Template_Source $source)
+ {
+ if ($source->timestamp) {
+ if (function_exists('ioncube_read_file')) {
+ $res = ioncube_read_file($source->filepath);
+ if (is_int($res)) {
+ $res = false;
+ }
+ return $res;
+ } else {
+ return file_get_contents($source->filepath);
+ }
+ }
+ if ($source instanceof Smarty_Config_Source) {
+ throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
+ }
+ throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+ }
}
|