summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimoore76 <imoore76@users.noreply.github.com>2016-03-24 13:03:22 -0400
committerimoore76 <imoore76@users.noreply.github.com>2016-03-24 13:03:22 -0400
commit91bbc54bb697f25093530c0bba9a9a935c6beae2 (patch)
treea7a97aa238b1696185ab922c27edabb25cc8bed0
parentce7c35ce03ace030a6213d943df88f2304d11b40 (diff)
parent4a1336e40ad9eb651661d18ce6a3153e979507aa (diff)
downloadphpvirtualbox-91bbc54bb697f25093530c0bba9a9a935c6beae2.zip
phpvirtualbox-91bbc54bb697f25093530c0bba9a9a935c6beae2.tar.gz
phpvirtualbox-91bbc54bb697f25093530c0bba9a9a935c6beae2.tar.bz2
Merge pull request #14 from ashway83/develop
Fixed enforceVMOwnership and vmQuotaPerUser functionality
-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;
}