diff --git a/modules/servers/solusvmpro/VERSION b/modules/servers/solusvmpro/VERSION index 389f774..cc868b6 100644 --- a/modules/servers/solusvmpro/VERSION +++ b/modules/servers/solusvmpro/VERSION @@ -1 +1 @@ -4.0 \ No newline at end of file +4.0.1 \ No newline at end of file diff --git a/modules/servers/solusvmpro/console.php b/modules/servers/solusvmpro/console.php index 97bc91c..f431a3f 100644 --- a/modules/servers/solusvmpro/console.php +++ b/modules/servers/solusvmpro/console.php @@ -27,8 +27,13 @@ $ca = new WHMCS_ClientArea(); if ( ! $ca->isLoggedIn() ) { - echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; - exit(); + if((!isset($_SESSION['adminid']) || ((int)$_SESSION['adminid'] <= 0))){ + echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; + exit(); + } + $uid = (int)$_GET['uid']; +}else{ + $uid = $ca->getUserID(); } $servid = (int) $_GET['id']; if ( $servid == "" ) { @@ -36,8 +41,6 @@ exit(); } -$uid = $ca->getUserID(); - $params = SolusVM::getParamsFromServiceID( $servid, $uid ); if ( $params === false ) { echo '
' . $_LANG['solusvmpro_vserverNotFound'] . '
'; diff --git a/modules/servers/solusvmpro/html5console.php b/modules/servers/solusvmpro/html5console.php index 31cf11b..8ab4ced 100644 --- a/modules/servers/solusvmpro/html5console.php +++ b/modules/servers/solusvmpro/html5console.php @@ -1,7 +1,7 @@ isLoggedIn() ) { - echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; - exit(); +if (!$ca->isLoggedIn()) { + if ((!isset($_SESSION['adminid']) || ((int)$_SESSION['adminid'] <= 0))) { + echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; + exit(); + } + $uid = (int)$_GET['uid']; +} else { + $uid = $ca->getUserID(); } -$servid = (int) $_GET['id']; -if ( $servid == "" ) { + +$servid = (int)$_GET['id']; +if ($servid == "") { echo '
' . $_LANG['solusvmpro_unauthorized'] . '
'; exit(); } -$uid = $ca->getUserID(); - -$params = SolusVM::getParamsFromServiceID( $servid, $uid ); -if ( $params === false ) { +$params = SolusVM::getParamsFromServiceID($servid, $uid); +if ($params === false) { echo '
' . $_LANG['solusvmpro_vserverNotFound'] . '
'; exit; } -$solusvm = new SolusVM( $params ); +$solusvm = new SolusVM($params); -if ( $solusvm->getExtData( "clientfunctions" ) == "disable" ) { +if ($solusvm->getExtData("clientfunctions") == "disable") { echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; exit; } -if ( $solusvm->getExtData( "html5serialconsole" ) == "disable" ) { +if ($solusvm->getExtData("html5serialconsole") == "disable") { echo '
' . $_LANG['solusvmpro_functionDisabled'] . ''; exit; } ################### Code ################### -if ( isset( $_POST["sessioncancel"] ) ) { - $callArray = array( "access" => "disable", "vserverid" => $params['vserver'] ); -} elseif ( isset( $_POST["sessioncreate"] ) ) { +if (isset($_POST["sessioncancel"])) { + $callArray = array("access" => "disable", "vserverid" => $params['vserver']); +} elseif (isset($_POST["sessioncreate"])) { $stime = $_POST["sessiontime"]; - if ( ! is_numeric( $stime ) ) { + if (!is_numeric($stime)) { exit(); } else { - $callArray = array( "access" => "enable", "time" => $stime, "vserverid" => $params['vserver'] ); + $callArray = array("access" => "enable", "time" => $stime, "vserverid" => $params['vserver']); } } else { ## The call string for the connection function - $callArray = array( "vserverid" => $params['vserver'] ); + $callArray = array("vserverid" => $params['vserver']); } -$solusvm->apiCall( 'vserver-console', $callArray ); +$solusvm->apiCall('vserver-console', $callArray); $r = $solusvm->result; -if ( $r["status"] == "success" ) { - if ( $r["sessionactive"] == "1" ) { - if ( $r["type"] != "openvz" && $r["type"] != "xen" ) { +if ($r["status"] == "success") { + if ($r["sessionactive"] == "1") { + if ($r["type"] != "openvz" && $r["type"] != "xen") { exit(); } @@ -112,7 +116,8 @@ ?>
-


+

+

@@ -123,13 +128,16 @@
-
+
Secure Shell Terminal: vt220
- +
-
@@ -264,8 +272,10 @@ function SSH_client() {
- - + +
@@ -276,8 +286,8 @@ function SSH_client() { } else { - if ( isset( $r["statusmsg"] ) ) { - $pagedata = (string) $r["statusmsg"]; + if (isset($r["statusmsg"])) { + $pagedata = (string)$r["statusmsg"]; } else { $pagedata = $_LANG['solusvmpro_couldntConnectMaster']; } diff --git a/modules/servers/solusvmpro/solusvmpro.php b/modules/servers/solusvmpro/solusvmpro.php index e867b7c..520fcce 100644 --- a/modules/servers/solusvmpro/solusvmpro.php +++ b/modules/servers/solusvmpro/solusvmpro.php @@ -24,7 +24,7 @@ function initConfigOption() { - $data = Capsule::table('tblproducts')->where('servertype', 'solusvmpro')->get(); + $data = Capsule::table('tblproducts')->where('servertype', 'solusvmpro')->where('id', $_POST['id'])->get(); $packageconfigoption = []; if(is_array($data) && count($data) > 0) { $packageconfigoption[1] = $data[0]->configoption1; diff --git a/modules/servers/solusvmpro/svm_control.php b/modules/servers/solusvmpro/svm_control.php index 38cc0ba..aaf509e 100644 --- a/modules/servers/solusvmpro/svm_control.php +++ b/modules/servers/solusvmpro/svm_control.php @@ -161,12 +161,12 @@ function setFromGetOrSendError( $param ) { } if ( $r["type"] == "openvz" || $r["type"] == "xen" ) { - $html5Console = ''; } if ( $r["type"] == "openvz" || $r["type"] == "xen" ) { - $console = ''; + $console = ''; $cpass = ''; } else { $console = '';