Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fc49808
add gitignore, check curl_exec
Jul 16, 2020
a06cbbc
FEATURE SVM-3051 WHMCS8 support
Oct 9, 2020
b8b56ce
Merge pull request #39 from eruzavin/WHMCS8-support
oneumyvakin Oct 12, 2020
edd2045
Update documentation link
oneumyvakin Oct 21, 2020
38335e4
BUGFIX SVM-3243 Adding http_referer to post request for fallback
Jun 24, 2021
8a2af0d
Merge pull request #43 from plesk/bugfix-aredikultsev-adding-http-ref…
redikultsevsilver Jun 24, 2021
90d173e
Fix for WHMCS 8.2 compatibility
jas8522 Jun 30, 2021
7a6f980
Merge pull request #44 from jas8522/patch-2
redikultsevsilver Jul 1, 2021
4df401a
Replacing __DIR__ with ROOTDIR for WHMCS 8 compatibility
Jul 1, 2021
54a07f9
Merge pull request #45 from solusio/replacing-dir-with-rootdir-for-wh…
redikultsevsilver Jul 1, 2021
bc43ad4
Fix to allow upgrade/downgrade Bandwidth
avolovplesk Oct 29, 2021
8fb4126
Merge pull request #49 from avolovplesk/patch-1
redikultsevsilver Oct 29, 2021
078ed65
Fix for incorrect parsing of configure.ini file path
Dec 23, 2021
62e7a67
Merge pull request #50 from Plsk-test/patch-1
redikultsevsilver Dec 23, 2021
4044ac9
modified: modules/servers/solusvmpro/VERSION
Apr 29, 2022
ad072a9
Merge pull request #51 from Plsk-test/version-update
avolovplesk Apr 29, 2022
0aeaf21
BUGFIX SVM-1789 Fix broken VNC password change functionality
Jun 3, 2022
193c0cb
Merge pull request #52 from eruzavin/bugfix-eruzavin-fix-broken-VNC-p…
eruzavin Jun 3, 2022
d5074a7
FEATURE SVM-1789 Add French translation about VNC password length res…
Jun 29, 2022
e780409
Merge pull request #54 from eruzavin/feature-eruzavin-Add-French-tran…
eruzavin Jun 29, 2022
333215b
BUGFIX SVM-3482 Extra IP was removed on another Configurable Option u…
dshamanskaia Aug 10, 2022
a7bad3a
Merge pull request #55 from solusio/bugfix-dshamanskaia-extra-ip-is-r…
dshamanskaia Aug 10, 2022
48b7c0a
Update VERSION
dshamanskaia Aug 10, 2022
b69595a
BUGFIX SVM-3588 use to get vserverid instead of GET request
avolovplesk Oct 6, 2022
bfd11c9
Merge pull request #59 from avolovplesk/bugfix-avolov-change-how-vser…
avolovplesk Oct 6, 2022
fc1755a
Update VERSION
avolovplesk Oct 6, 2022
bb0f53e
FEATURE SVM-3260 Add PHP 8.1 support
Nov 17, 2022
e793453
Merge pull request #60 from eruzavin/master
eruzavin Nov 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
modules/servers/solusvmpro/.idea
modules/servers/solusvmpro/callback.php
modules/servers/solusvmpro/configure.ini
modules/servers/solusvmpro/custom.php
.idea

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

[SolusVM WHMCS Module Documentation](https://documentation.solusvm.com/display/DOCS/WHMCS)
[SolusVM WHMCS Module Documentation](https://docs.solusvm.com/display/BET/SolusVM+WHMCS+billing+module)
2 changes: 1 addition & 1 deletion modules/servers/solusvmpro/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.1
4.2.1
6 changes: 3 additions & 3 deletions modules/servers/solusvmpro/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
define( "CLIENTAREA", true );
require( "../../../init.php" );

require_once __DIR__ . '/lib/Curl.php';
require_once __DIR__ . '/lib/CaseInsensitiveArray.php';
require_once __DIR__ . '/lib/SolusVM.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/Curl.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/CaseInsensitiveArray.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/SolusVM.php';

use Illuminate\Database\Capsule\Manager as Capsule;
use SolusVM\SolusVM;
Expand Down
16 changes: 8 additions & 8 deletions modules/servers/solusvmpro/custom-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
# ### server is ordered, if no hostname is specified.
# ###########################################################################
# ################################## CODE ###################################
# $serviceid = $params["serviceid"];
# $clientsdetails = $params["clientsdetails"];
# if(!empty($params[domain])) {
# $currentHost = $params[domain] {
# strlen($params[domain]) - 1}
# $serviceid = $params['serviceid'];
# $clientsdetails = $params['clientsdetails'];
# if(!empty($params['domain'])) {
# $currentHost = $params['domain'] {
# strlen($params['domain']) - 1}
# ;
# if(!strcmp($currentHost, ".")) {
# $newHost = substr($params[domain], 0, -1);
# $newHost = substr($params['domain'], 0, -1);
# mysql_real_escape_string($newHost);
# mysql_query("UPDATE tblhosting SET `domain` = '$newHost' WHERE `id` = '$serviceid'");
# } else {
# $newHost = $params[domain];
# $newHost = $params['domain'];
# }
# } else {
# $newHost = "vps" . $serviceid . $clientsdetails['id'] . ".EXAMPLEDOMAIN.COM";
Expand Down Expand Up @@ -56,7 +56,7 @@
# ### from the server list in whmcs
# ###########################################################################
# ################################## CODE ###################################
# $code = '<form action="https://' . $params["serverip"] . ':5656/admincp/login.php" method="post" target="_blank">
# $code = '<form action="https://' . $params['serverip'] . ':5656/admincp/login.php" method="post" target="_blank">
# <input type="hidden" name="username" value="ADMINUSERNAME" />
# <input type="hidden" name="password" value="ADMINPASSOWRD" />
# <input type="submit" name="Submit" value="Login" />
Expand Down
6 changes: 3 additions & 3 deletions modules/servers/solusvmpro/get_client_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
require( "../../../init.php" );
session_start();

require_once __DIR__ . '/lib/Curl.php';
require_once __DIR__ . '/lib/CaseInsensitiveArray.php';
require_once __DIR__ . '/lib/SolusVM.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/Curl.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/CaseInsensitiveArray.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/SolusVM.php';

use Illuminate\Database\Capsule\Manager as Capsule;
use SolusVM\SolusVM;
Expand Down
6 changes: 3 additions & 3 deletions modules/servers/solusvmpro/html5console.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
define("CLIENTAREA", true);
require("../../../init.php");

require_once __DIR__ . '/lib/Curl.php';
require_once __DIR__ . '/lib/CaseInsensitiveArray.php';
require_once __DIR__ . '/lib/SolusVM.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/Curl.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/CaseInsensitiveArray.php';
require_once ROOTDIR . '/modules/servers/solusvmpro/lib/SolusVM.php';

use Illuminate\Database\Capsule\Manager as Capsule;
use SolusVM\SolusVM;
Expand Down
1 change: 0 additions & 1 deletion modules/servers/solusvmpro/js/hostname.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ $(function () {
button.html('<span class="glyphicon glyphicon-refresh spinning"></span> ' + lang['solusvmpro_change']);
button.prop('disabled', true);
var ajaxData = {
vserverid: vserverid,
modop: 'custom',
a: 'ChangeHostname',
newhostname: newhostname,
Expand Down
1 change: 0 additions & 1 deletion modules/servers/solusvmpro/js/rescuemode.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ $(function () {
button.html('<span class="glyphicon glyphicon-refresh spinning"></span> ' + lang['solusvmpro_processing']);
button.prop('disabled', true);
var ajaxData = {
vserverid: vserverid,
modop: 'custom',
a: 'ChangeRescueMode',
rescueAction: rescueAction,
Expand Down
1 change: 0 additions & 1 deletion modules/servers/solusvmpro/js/rootpassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ $(function () {
button.html('<span class="glyphicon glyphicon-refresh spinning"></span> ' + lang['solusvmpro_change']);
button.prop('disabled', true);
var ajaxData = {
vserverid: vserverid,
modop: 'custom',
a: 'ChangeRootPassword',
newrootpassword: newrootpassword,
Expand Down
1 change: 0 additions & 1 deletion modules/servers/solusvmpro/js/vncpassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ $(function () {
button.html('<span class="glyphicon glyphicon-refresh spinning"></span> ' + lang['solusvmpro_change']);
button.prop('disabled', true);
var ajaxData = {
vserverid: vserverid,
modop: 'custom',
a: 'ChangeVNCPassword',
newvncpassword: newvncpassword,
Expand Down
1 change: 1 addition & 0 deletions modules/servers/solusvmpro/lang/arabic.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$_LANG['solusvmpro_confirmRootPassword'] = 'تأكيد كلمة مرور الجذر';
$_LANG['solusvmpro_confirmVNCPassword'] = 'تأكيد كلمة مرور فنك';
$_LANG['solusvmpro_confirmErrorPassword'] = 'يرجى التحقق من إدخال كلمة المرور وتأكيدها';
$_LANG['solusvmpro_kvmVncPasswordLengthError'] = 'Length of KVM VNC password cannot be greater than 8 characters';
$_LANG['solusvmpro_virtualizationTypeError'] = 'الدالة غير مدعمة لهذا النوع الظاهري';
$_LANG['solusvmpro_unknownError'] = 'خطأ غير معروف. اتصل بالدعم';
$_LANG['solusvmpro_invalidHostname'] = 'اسم مضيف غير صالح';
Expand Down
1 change: 1 addition & 0 deletions modules/servers/solusvmpro/lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$_LANG['solusvmpro_confirmRootPassword'] = 'Confirm a root password';
$_LANG['solusvmpro_confirmVNCPassword'] = 'Confirm VNC password';
$_LANG['solusvmpro_confirmErrorPassword'] = 'Please check that you have entered and confirmed your password';
$_LANG['solusvmpro_kvmVncPasswordLengthError'] = 'Length of KVM VNC password cannot be greater than 8 characters';
$_LANG['solusvmpro_virtualizationTypeError'] = 'Function not supported for this virtualization type';
$_LANG['solusvmpro_unknownError'] = 'Unknown error. Contact support';
$_LANG['solusvmpro_invalidHostname'] = 'Invalid Hostname';
Expand Down
1 change: 1 addition & 0 deletions modules/servers/solusvmpro/lang/french.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$_LANG['solusvmpro_confirmRootPassword'] = 'Confirmer un mot de passe racine';
$_LANG['solusvmpro_confirmVNCPassword'] = 'Confirmer le mot de passe VNC';
$_LANG['solusvmpro_confirmErrorPassword'] = 'Vérifiez que vous avez entré et confirmé votre mot de passe';
$_LANG['solusvmpro_kvmVncPasswordLengthError'] = 'La longueur du mot de passe VNC KVM ne peut pas être supérieure à 8 caractères';
$_LANG['solusvmpro_virtualizationTypeError'] = 'Fonction non prise en charge pour ce type de virtualisation';
$_LANG['solusvmpro_unknownError'] = 'Erreur inconnue. Contactez le support';
$_LANG['solusvmpro_invalidHostname'] = 'Nom d&#39;hôte invalide';
Expand Down
1 change: 1 addition & 0 deletions modules/servers/solusvmpro/lang/italian.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$_LANG['solusvmpro_confirmRootPassword'] = 'Confermare una password di root';
$_LANG['solusvmpro_confirmVNCPassword'] = 'Confermare la password VNC';
$_LANG['solusvmpro_confirmErrorPassword'] = 'Verifica di aver inserito e confermato la tua password';
$_LANG['solusvmpro_kvmVncPasswordLengthError'] = 'Length of KVM VNC password cannot be greater than 8 characters';
$_LANG['solusvmpro_virtualizationTypeError'] = 'Funzione non supportata per questo tipo di virtualizzazione';
$_LANG['solusvmpro_unknownError'] = 'Errore sconosciuto. Contatta il supporto';
$_LANG['solusvmpro_invalidHostname'] = 'hostname non valido';
Expand Down
1 change: 1 addition & 0 deletions modules/servers/solusvmpro/lang/russian.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$_LANG['solusvmpro_confirmRootPassword'] = 'Повторите пароль для root';
$_LANG['solusvmpro_confirmVNCPassword'] = 'Повторите пароль для VNC';
$_LANG['solusvmpro_confirmErrorPassword'] = 'Пароли не совпадают';
$_LANG['solusvmpro_kvmVncPasswordLengthError'] = 'Длина пароля VNC для KVM не может быть больше 8 символов';
$_LANG['solusvmpro_virtualizationTypeError'] = 'Функция не поддерживается для этого типа виртуализации';
$_LANG['solusvmpro_unknownError'] = 'Неизвестная ошибка. Обратитесь в службу поддержки';
$_LANG['solusvmpro_invalidHostname'] = 'Неверный адрес';
Expand Down
1 change: 1 addition & 0 deletions modules/servers/solusvmpro/lang/spanish.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$_LANG['solusvmpro_confirmRootPassword'] = 'Confirmar una contraseña de root';
$_LANG['solusvmpro_confirmVNCPassword'] = 'Confirmar contraseña de VNC';
$_LANG['solusvmpro_confirmErrorPassword'] = 'Comprueba que has ingresado y confirmado tu contraseña.';
$_LANG['solusvmpro_kvmVncPasswordLengthError'] = 'Length of KVM VNC password cannot be greater than 8 characters';
$_LANG['solusvmpro_virtualizationTypeError'] = 'Función no admitida para este tipo de virtualización';
$_LANG['solusvmpro_unknownError'] = 'Error desconocido. Soporte de contacto';
$_LANG['solusvmpro_invalidHostname'] = 'Nombre de host no válido';
Expand Down
1 change: 1 addition & 0 deletions modules/servers/solusvmpro/lang/ukranian.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$_LANG['solusvmpro_confirmRootPassword'] = 'Повторіть пароль для root';
$_LANG['solusvmpro_confirmVNCPassword'] = 'Повторіть пароль для VNC';
$_LANG['solusvmpro_confirmErrorPassword'] = 'Паролі не співпадають';
$_LANG['solusvmpro_kvmVncPasswordLengthError'] = 'Length of KVM VNC password cannot be greater than 8 characters';
$_LANG['solusvmpro_virtualizationTypeError'] = 'Функція не підтримує цей тип віртуалізації';
$_LANG['solusvmpro_unknownError'] = 'Невідома помилка. Зверніться у службу підтримки';
$_LANG['solusvmpro_invalidHostname'] = 'Неправильна адреса';
Expand Down
2 changes: 1 addition & 1 deletion modules/servers/solusvmpro/lib/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function call()
*/
public function close()
{
if (is_resource($this->curl)) {
if (is_resource($this->curl) || is_object($this->curl)) {
curl_close($this->curl);
}
$this->options = null;
Expand Down
84 changes: 61 additions & 23 deletions modules/servers/solusvmpro/lib/SolusVM.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

use SolusVM\Curl;
use Illuminate\Database\Capsule\Manager as Capsule;

use Illuminate\Support\Collection as Collection;
use Exception;

class SolusVM {
protected $url;
Expand Down Expand Up @@ -79,7 +80,7 @@ public function __construct( $params, $debug = false ) {
if ( ! $cport ) {
$cport = "5353";
}
$this->url = "http://" . $conaddr . ":" . $cport . "/api/" . $this->modType . "/command.php/";
$this->url = "http://" . $conaddr . ":" . $cport . "/api/" . $this->modType . "/command.php";
$this->fwdurl = "http://" . $conaddr . ":" . $cport;
}

Expand All @@ -102,7 +103,7 @@ public function __construct( $params, $debug = false ) {
$this->pid = $this->getParam( "pid" ); # Product/Service ID

//Parse Ini file
$config_file = dirname(__DIR__) . '/configure.ini';
$config_file = ROOTDIR . '/modules/servers/solusvmpro/configure.ini';
$this->configIni = parse_ini_file( $config_file );

}
Expand All @@ -126,6 +127,12 @@ public function getExtData( $name ) {
public function apiCall( $faction, $postVars = array() ) {
$this->result = '';

if ( !$this->curl_enabled() ) {
$msg = 'Curl is currently disabled';
$this->debugLog( 'solusvmpro', $faction, '', $msg, '', array() );
die($msg);
}

if ( $faction == "fwdurl" ) {
$result = $this->fwdurl;
$this->debugLog( 'solusvmpro', $faction, '', $result, '', array() );
Expand Down Expand Up @@ -183,13 +190,18 @@ public function apiCall( $faction, $postVars = array() ) {

}

private function curl_enabled() {
$disabled = explode(',', ini_get('disable_functions'));
return !in_array('curl_exec', $disabled);
}

public function sortReturn( $data ) {
preg_match_all( '/<(.*?)>([^<]+)<\/\\1>/i', $data, $matches );
$result = array();
foreach ( $matches[1] as $k => $v ) {
$result[ $v ] = $matches[2][ $k ];
}
$this->debugLog( 'solusvmpro', 'process', $data, $result, $result, '' );
$this->debugLog( 'solusvmpro', 'process', $data, $result, $result, [] );

return $result;
}
Expand Down Expand Up @@ -219,10 +231,10 @@ public function serverExtra( $mServer = array() ) {

public function passwordGen( $length = 10, $chars = 'abcdefghijklmnopqrstuvwxyzABCEFGHIJKLMNOPQRSTUVWXYZ1234567890' ) {
$chars_length = ( strlen( $chars ) - 1 );
$string = $chars{rand( 0, $chars_length )};
$string = $chars[rand( 0, $chars_length )];
for ( $i = 1; $i < $length; $i = strlen( $string ) ) {
$r = $chars{rand( 0, $chars_length )};
if ( $r != $string{$i - 1} ) {
$r = $chars[rand( 0, $chars_length )];
if ( $r != $string[$i - 1]) {
$string .= $r;
}
}
Expand Down Expand Up @@ -636,7 +648,7 @@ public function clientAreaCalculations( $result ) {
)
);

if ( $result["status"] == "success" ) {
if ( $this->isSuccessResponse($result) ) {
$vstatus = '<span style="color: #'.$vstatusAr[$result["state"]]['color'].'"><strong>' . $vstatusAr[$result["state"]]['msg'] . '</strong></span>';
} else {
$vstatus = '<span style="color: #'.$vstatusAr['unavailable']['color'].'"><strong>' . $vstatusAr['unavailable']['msg'] . '</strong></span>';
Expand All @@ -648,10 +660,10 @@ public function clientAreaCalculations( $result ) {
if ($result["state"] == "online" || $result["state"] == "offline") {
//Bandwidth graph
$bandwidthData = explode(",", $result["bandwidth"]);
$usedBwPercentage = $bandwidthData[3];
$bandwidthData[1] = $bandwidthData[1] / 1024;
$bandwidthData[2] = $bandwidthData[2] / 1024;
$bandwidthData[0] = $bandwidthData[0] / 1024;
$usedBwPercentage = (int)$bandwidthData[3];
$bandwidthData[1] = (int)$bandwidthData[1] / 1024;
$bandwidthData[2] = (int)$bandwidthData[2] / 1024;
$bandwidthData[0] = (int)$bandwidthData[0] / 1024;
$bwUsed = $this->bwFormat($bandwidthData[1]);
$bwFree = $this->bwFormat($bandwidthData[2]);
$bwTotal = $this->bwFormat($bandwidthData[0]);
Expand Down Expand Up @@ -679,10 +691,10 @@ public function clientAreaCalculations( $result ) {
if ($result["type"] == "openvz") {
if ($this->getExtData("memusage") != "disable") {
$memData = explode(",", $result["memory"]);
$usedMemPercentage = $memData[3];
$memData[1] = $memData[1] / 1024;
$memData[2] = $memData[2] / 1024;
$memData[0] = $memData[0] / 1024;
$usedMemPercentage = (int)$memData[3];
$memData[1] = (int)$memData[1] / 1024;
$memData[2] = (int)$memData[2] / 1024;
$memData[0] = (int)$memData[0] / 1024;
$memUsed = $this->bwFormat($memData[1]);
$memFree = $this->bwFormat($memData[2]);
$memTotal = $this->bwFormat($memData[0]);
Expand All @@ -709,10 +721,10 @@ public function clientAreaCalculations( $result ) {
if ($result["type"] == "openvz" || $result["type"] == "xen") {
if ($this->getExtData("diskusage") != "disable") {
$hddData = explode(",", $result["hdd"]);
$usedHddPercentage = $hddData[3];
$hddData[1] = $hddData[1] / 1024;
$hddData[2] = $hddData[2] / 1024;
$hddData[0] = $hddData[0] / 1024;
$usedHddPercentage = (int)$hddData[3];
$hddData[1] = (int)$hddData[1] / 1024;
$hddData[2] = (int)$hddData[2] / 1024;
$hddData[0] = (int)$hddData[0] / 1024;
$hddUsed = $this->bwFormat($hddData[1]);
$hddFree = $this->bwFormat($hddData[2]);
$hddTotal = $this->bwFormat($hddData[0]);
Expand Down Expand Up @@ -964,7 +976,7 @@ public static function getParamsFromServiceID( $servid, $uid = null ) {

public static function getParamsFromVserviceID( $vserverid, $uid ) {
/** @var stdClass $hosting */
foreach ( Capsule::table( 'tblhosting' )->where( 'userid', $uid )->get() as $hosting ) {
foreach ( SolusVM::collectionToArray(Capsule::table( 'tblhosting' )->where( 'userid', $uid )->get()) as $hosting ) {

$vserverFieldRow = Capsule::table( 'tblcustomfields' )->where( 'relid', $hosting->packageid )->where( 'fieldname', 'vserverid' )->first();
if ( ! $vserverFieldRow ) {
Expand Down Expand Up @@ -1038,7 +1050,7 @@ public function getVT() {
public static function loadLang( $lang = null ) {
global $_LANG, $CONFIG;

$langDir = __DIR__ . '/../lang/';
$langDir = ROOTDIR . '/modules/servers/solusvmpro/lang/';
$availableLangsFullPath = glob( $langDir . '*.php' );
$availableLangs = array();
foreach ( $availableLangsFullPath as $availableLang ) {
Expand Down Expand Up @@ -1066,10 +1078,36 @@ public static function loadLang( $lang = null ) {
}

public function debugLog( $module, $action, $requestString, $responseData, $processedData, $replaceVars ) {
if ( !$this->configIni[ 'debug' ] ){
if ( !$this->configIni[ 'debug' ] ) {
return;
}
logModuleCall( $module, $action, $requestString, $responseData, $processedData, $replaceVars );
}

public function isSuccessResponse( $result ) {
if ( isset($result["status"]) && $result["status"] == "success" ) {
return true;
}

$this->debugLog( 'solusvmpro', 'isSuccessResponse', '', $result, '', array() );
return false;
}

/**
* Converts Collection to array if required
*
* @param array|Collection|any $object arbitrary object.
*
* @return array
*/
public static function collectionToArray($object) {
if (is_array($object)) {
return $object;
}
if ($object instanceof Collection) {
return $object->toArray();
}
throw new Exception('Object is not an array or Illuminate\Support\Collection');
}
}

Loading