Skip to content

Commit 8fb4126

Browse files
Merge pull request #49 from avolovplesk/patch-1
Fix for SVM-2851: now it will be possible to change bandwidth using upgrade/downgrade via configurable options
2 parents 54a07f9 + bc43ad4 commit 8fb4126

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

modules/servers/solusvmpro/solusvmpro.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,11 @@ function solusvmpro_ChangePackage( $params ) {
681681
$ccpu = $solusvm->getCcpu();
682682
$cextraip = $solusvm->getCextraip();
683683
$cnspeed = $solusvm->getCnspeed();
684+
$cbandwidth = $solusvm->getCbandwidth();
684685
#########################################
685686

686687
//Apply custom resources
687-
if ( !empty($cmem) || !empty($cdisk) || !empty($ccpu) || !empty($cextraip) ){
688+
if ( !empty($cmem) || !empty($cdisk) || !empty($ccpu) || !empty($cextraip) || !empty($cbandwidth) ){
688689

689690
$resource_errors = "";
690691
$error_divider = " ";
@@ -722,6 +723,14 @@ function solusvmpro_ChangePackage( $params ) {
722723
}
723724

724725
}
726+
727+
if ( $cbandwidth > 0 ){
728+
$solusvm->apiCall( 'vserver-bandwidth', array( "limit" => $cbandwidth, "vserverid" => $customField["vserverid"] ) );
729+
if ( !$solusvm->isSuccessResponse($solusvm->result) ) {
730+
$resource_errors .= (string) $solusvm->result["statusmsg"];
731+
}
732+
733+
}
725734

726735
if ( $cextraip > 0 ){
727736
//first() function doesn't work
@@ -1264,4 +1273,3 @@ function solusvmpro_customclientareaunavailable( $params, $cparams ) {
12641273
return $output;
12651274
}
12661275
}
1267-

0 commit comments

Comments
 (0)