summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndriy Sharandakov <ash.ashway@gmail.com>2016-03-24 15:19:08 +0200
committerAndriy Sharandakov <ash.ashway@gmail.com>2016-03-24 15:19:08 +0200
commit4a1336e40ad9eb651661d18ce6a3153e979507aa (patch)
treea7a97aa238b1696185ab922c27edabb25cc8bed0
parentce7c35ce03ace030a6213d943df88f2304d11b40 (diff)
downloadphpvirtualbox-4a1336e40ad9eb651661d18ce6a3153e979507aa.zip
phpvirtualbox-4a1336e40ad9eb651661d18ce6a3153e979507aa.tar.gz
phpvirtualbox-4a1336e40ad9eb651661d18ce6a3153e979507aa.tar.bz2
Fixed enforceVMOwnership and vmQuotaPerUser functionality which is broken in 5.0-5
-rw-r--r--endpoints/lib/vboxconnector.php6
-rw-r--r--js/datamediator.js2
2 files changed, 4 insertions, 4 deletions
diff --git a/endpoints/lib/vboxconnector.php b/endpoints/lib/vboxconnector.php
index d33825c..8c4953c 100644
--- a/endpoints/lib/vboxconnector.php
+++ b/endpoints/lib/vboxconnector.php
@@ -3749,15 +3749,15 @@ class vboxconnector {
if ( @isset($this->settings->vmQuotaPerUser) && @$this->settings->vmQuotaPerUser > 0 && !$_SESSION['admin'] )
{
$newresp = array('data' => array());
- $vmlist = $this->vboxGetMachines(array(), $newresp);
- if ( count($newresp['data']['vmlist']) >= $this->settings->vmQuotaPerUser )
+ $this->vboxGetMachines(array(), array(&$newresp));
+ if ( count($newresp['data']['responseData']) >= $this->settings->vmQuotaPerUser )
{
// we're over quota!
// delete the disk we just created
if ( isset($args['disk']) )
{
$this->mediumRemove(array(
- 'id' => $args['disk'],
+ 'medium' => $args['disk'],
'type' => 'HardDisk',
'delete' => true
), $newresp);
diff --git a/js/datamediator.js b/js/datamediator.js
index a214a4f..c701958 100644
--- a/js/datamediator.js
+++ b/js/datamediator.js
@@ -93,7 +93,7 @@ var vboxVMDataMediator = {
for(var i = 0; i < d.responseData.length; i++) {
// Enforce VM ownership
- if($('#vboxPane').data('vboxConfig').enforceVMOwnership && !$('#vboxPane').data('vboxSession').admin && d.vmlist[i].owner != $('#vboxPane').data('vboxSession').user) {
+ if($('#vboxPane').data('vboxConfig').enforceVMOwnership && !$('#vboxPane').data('vboxSession').admin && d.responseData[i].owner != $('#vboxPane').data('vboxSession').user) {
continue;
}