summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.dockerignore10
-rw-r--r--CHANGELOG.txt16
-rw-r--r--Dockerfile7
-rw-r--r--README.md (renamed from README.txt)59
-rw-r--r--docker-compose.yml18
-rw-r--r--endpoints/jqueryFileTree.php17
-rw-r--r--endpoints/lib/config.php2
-rw-r--r--endpoints/lib/utils.php36
-rw-r--r--endpoints/lib/vboxconnector.php1
-rw-r--r--js/jquery.projectPlugins.js3
-rw-r--r--js/phpvirtualbox.js22
-rw-r--r--panes/tabVMDetails.html26
12 files changed, 144 insertions, 73 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..2396d41
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,10 @@
+.buildpath
+.gitignore
+.git
+.project
+
+.DS_Store
+.SD_Store?
+.swp
+
+config.php \ No newline at end of file
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6f877e6..3439b3e 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,4 +1,20 @@
-------------------------------------
+ 5.0-4 2015-12-07
+-------------------------------------
+Fixed bug in file / folder browser when $browserRestrictFolders is
+set.
+https://sourceforge.net/p/phpvirtualbox/bugs/50/
+
+Fixed bug in host network interface sorting.
+https://sourceforge.net/p/phpvirtualbox/bugs/36/
+
+Fixed bug where phpVirtualBox installations on the same server may
+share session cookies in certain PHP configurations.
+
+Fixed bug where noPreview=true; was ignored in settings.
+https://sourceforge.net/p/phpvirtualbox/bugs/38/
+
+-------------------------------------
5.0-3 2015-09-09
-------------------------------------
Fixed file browser header content type causing blank file / folder
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..d5c62e7
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,7 @@
+FROM php:5.6-apache
+RUN apt-get update && \
+ apt-get install -y \
+ libxml2 \
+ libxml2-dev && \
+ docker-php-ext-install soap
+COPY . /var/www/html \ No newline at end of file
diff --git a/README.txt b/README.md
index 6254ebe..9210028 100644
--- a/README.txt
+++ b/README.md
@@ -1,27 +1,32 @@
-
-phpVirtualBox is Copyright (C) 2015 Ian Moore (imoore76 at yahoo dot com)
-
-FREE, WITHOUT WARRANTY:
-
-All files of this program (phpVirtualBox) are distributed under the
-terms contained in the LICENSE.txt file in this folder unless otherwise
-specified in an individual source file. By using this software, you are
-agreeing to the terms contained therein. If you have not received and read
-the license file, or do not agree with its conditions, please cease using
-this software immediately and remove any copies you may have in your
-possession.
-
-INSTALLATION:
-
-Rename config.php-example to config.php and edit as needed.
-
-Default login is username: admin password: admin
-
-Please see the wiki located at
-http://sourceforge.net/p/phpvirtualbox/wiki/Home/
-for detailed installation and configuration instructions.
-
-PASSWORD RECOVERY:
-
-Rename the file recovery.php-disabled to recovery.php, navigate to it in
-your web browser, and follow the instructions presented.
+# About
+
+phpVirtualBox is Copyright (C) 2015 Ian Moore (imoore76 at yahoo dot com)
+
+FREE, WITHOUT WARRANTY:
+
+All files of this program (phpVirtualBox) are distributed under the
+terms contained in the LICENSE.txt file in this folder unless otherwise
+specified in an individual source file. By using this software, you are
+agreeing to the terms contained therein. If you have not received and read
+the license file, or do not agree with its conditions, please cease using
+this software immediately and remove any copies you may have in your
+possession.
+
+# Installation from Zip file
+
+1) Download zip file from sourceforge project site: https://sourceforge.net/projects/phpvirtualbox/
+
+2) Rename config.php-example to config.php and edit as needed.
+
+# Post installation
+
+Default login is username: admin password: admin
+
+Please see the wiki located at
+http://sourceforge.net/p/phpvirtualbox/wiki/Home/
+for detailed installation and configuration instructions.
+
+# Password Recovery
+
+Rename the file recovery.php-disabled to recovery.php, navigate to it in
+your web browser, and follow the instructions presented.
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..3dd74bd
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,18 @@
+# Develop phpvirtualbox in docker
+#
+# 1) Get virtualbox host-only interface IP used by docker machine:
+# docker-machine inspect default -f '{{.Driver.HostOnlyCIDR}}' | sed -e 's#/.*##'
+# 2) Start vboxwebsrv on the IP returned from the above command:
+# vboxwebsrv -H 192.168.99.1 # or edit vboxwebsrv startup config
+# 3) Edit config.php to use the IP
+# 4) docker-compose up
+# 5) Get docker machine ip:
+# docker-machine ip default
+# 6) phpVirtualBox should be available at http://<ip returned from above command>
+#
+phpvirtualbox:
+ build: .
+ ports:
+ - "80:80"
+ volumes:
+ - .:/var/www/html \ No newline at end of file
diff --git a/endpoints/jqueryFileTree.php b/endpoints/jqueryFileTree.php
index 016a29d..7c88428 100644
--- a/endpoints/jqueryFileTree.php
+++ b/endpoints/jqueryFileTree.php
@@ -172,17 +172,24 @@ if($request['dir'] == DSEP && count($allowed_folders)) {
*/
if((strtoupper($request['dir']) != strtoupper($f)) && strpos(strtoupper($request['dir']),strtoupper($f)) === 0) {
-
// List entries in this folder
- $path = explode(DSEP,substr($request['dir'],strlen($f)));
+ $path = explode(DSEP, substr($request['dir'],strlen($f)));
- // Folder entry
- array_push($returnData, getdir($f, $request['dirsOnly'], $path));
+ if($path[0] == '') {
+ array_shift($path);
+ }
- } else {
+ $folder_entry = folder_entry($f, true);
+
+ $folder_entry['children'] = getdir($f, $request['dirsOnly'], $path);
+ $folder_entry['expanded'] = true;
+ array_push($returnData, $folder_entry);
+
+ } else {
array_push($returnData, folder_entry($f,true));
}
+
}
/* Just get full path */
diff --git a/endpoints/lib/config.php b/endpoints/lib/config.php
index bf90398..2c0c3b1 100644
--- a/endpoints/lib/config.php
+++ b/endpoints/lib/config.php
@@ -14,7 +14,7 @@
/*
* This version of phpVirtualBox
*/
-define('PHPVBOX_VER', '5.0-3');
+define('PHPVBOX_VER', '5.0-4');
class phpVBoxConfigClass {
diff --git a/endpoints/lib/utils.php b/endpoints/lib/utils.php
index e324c55..703bdb8 100644
--- a/endpoints/lib/utils.php
+++ b/endpoints/lib/utils.php
@@ -1,13 +1,13 @@
<?php
/**
* Common PHP utilities.
- *
+ *
* @author Ian Moore (imoore76 at yahoo dot com)
* @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
* @version $Id: utils.php 592 2015-04-12 19:53:44Z imoore76 $
* @see phpVBoxConfigClass
* @package phpVirtualBox
- *
+ *
*/
require_once(dirname(__FILE__).'/config.php');
@@ -19,15 +19,15 @@ require_once(dirname(__FILE__).'/config.php');
* @uses $_SESSION
*/
function session_init($keepopen = false) {
-
+
$settings = new phpVBoxConfigClass();
-
+
// Sessions provided by auth module?
if(@$settings->auth->capabilities['sessionStart']) {
call_user_func(array($settings->auth, $settings->auth->capabilities['sessionStart']), $keepopen);
return;
}
-
+
// No session support? No login...
if(@$settings->noAuth || !function_exists('session_start')) {
global $_SESSION;
@@ -37,29 +37,29 @@ function session_init($keepopen = false) {
return;
}
- // start session
- session_start();
-
- // Session is auto-started by PHP?
+ // Session not is auto-started by PHP
if(!ini_get('session.auto_start')) {
-
+
ini_set('session.use_trans_sid', 0);
ini_set('session.use_only_cookies', 1);
-
+
// Session path
if(isset($settings->sessionSavePath)) {
session_save_path($settings->sessionSavePath);
}
-
- session_name((isset($settings->session_name) ? $settings->session_name : md5('phpvbx'.$_SERVER['DOCUMENT_ROOT'].$_SERVER['HTTP_USER_AGENT'])));
+
+ if(isset($settings->session_name)) {
+ $session_name = $settings->session_name;
+ } else {
+ $session_name = md5($_SERVER['DOCUMENT_ROOT'].$_SERVER['HTTP_USER_AGENT'].dirname(__FILE__));
+ }
+ session_name($session_name);
session_start();
}
-
-
+
if(!$keepopen)
session_write_close();
-
-
+
}
@@ -69,7 +69,7 @@ function session_init($keepopen = false) {
* @return array
*/
function clean_request() {
-
+
if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
$json = json_decode(file_get_contents('php://input'), true);
if(!is_array($json))
diff --git a/endpoints/lib/vboxconnector.php b/endpoints/lib/vboxconnector.php
index c1d6cd7..d33825c 100644
--- a/endpoints/lib/vboxconnector.php
+++ b/endpoints/lib/vboxconnector.php
@@ -4234,6 +4234,7 @@ class vboxconnector {
'audioDriver' => (string)$m->audioAdapter->audioDriver,
),
'RTCUseUTC' => $m->RTCUseUTC,
+ 'EffectiveParavirtProvider' => (string)$m->getEffectiveParavirtProvider(),
'HWVirtExProperties' => array(
'Enabled' => $m->getHWVirtExProperty('Enabled'),
'NestedPaging' => $m->getHWVirtExProperty('NestedPaging'),
diff --git a/js/jquery.projectPlugins.js b/js/jquery.projectPlugins.js
index 702d14f..fa8bd85 100644
--- a/js/jquery.projectPlugins.js
+++ b/js/jquery.projectPlugins.js
@@ -550,8 +550,7 @@ if(jQuery) (function($){
data.sort(function(a,b){
if(a.type == b.type)
return strnatcasecmp(a.path, b.path);
-
- return a.type == 'folder' ? 1 : -1
+ return a.type == 'folder' ? -1 : 1
});
var elms = [];
diff --git a/js/phpvirtualbox.js b/js/phpvirtualbox.js
index f6f818a..19fd02e 100644
--- a/js/phpvirtualbox.js
+++ b/js/phpvirtualbox.js
@@ -1,7 +1,6 @@
/**
* @fileOverview Common classes and objects used
* @author Ian Moore (imoore76 at yahoo dot com)
- * @version $Id: phpvirtualbox.js 599 2015-07-27 10:40:37Z imoore76 $
* @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
*/
@@ -166,7 +165,9 @@ var vboxHostDetailsSections = {
var netRows = [];
- d['networkInterfaces'].sort(strnatcasecmp);
+ d['networkInterfaces'].sort(function(a,b){
+ return strnatcasecmp(a.name, b.name);
+ });
for(var i = 0; i < d['networkInterfaces'].length; i++) {
@@ -338,7 +339,9 @@ var vboxVMDetailsSections = {
if(d['HWVirtExProperties'].Enabled) acList[acList.length] = trans('VT-x/AMD-V');
if(d['HWVirtExProperties'].NestedPaging) acList[acList.length] = trans('Nested Paging');
if(d['CpuProperties']['PAE']) acList[acList.length] = trans('PAE/NX');
-
+ if(d['EffectiveParavirtProvider'] != 'None')
+ acList[acList.length] = trans(d['EffectiveParavirtProvider'] + ' Paravirtualization');
+
if($('#vboxPane').data('vboxConfig').enableAdvancedConfig) {
if(d['HWVirtExProperties'].LargePages) acList[acList.length] = trans('Large Pages');
if(d['HWVirtExProperties'].UnrestrictedExecution) acList[acList.length] = trans('VT-x unrestricted execution');
@@ -3139,8 +3142,8 @@ function vboxWizard() {
function vboxToolbar(options) {
var self = this;
- this.buttons = options.buttons ? options.buttons : [];
- this.size = options.size ? options.size : 22;
+ this.buttons = options.buttons || [];
+ this.size = options.size || 22;
this.addHeight = 24;
this.lastItem = null;
this.buttonStyle = options.buttonStyle;
@@ -3394,10 +3397,11 @@ function vboxToolbar(options) {
*/
function vboxToolbarSingle(options) {
+ var self = this;
this.parentClass = vboxToolbarSmall;
- options.buttons = [options.button]
- renderTo = options.renderTo
- options.renderTo = undefined
+ options.buttons = [options.button];
+ renderTo = options.renderTo;
+ options.renderTo = undefined;
this.parentClass(options);
this._buttonElement = this.buttonElement; /* copy orig */
@@ -3743,7 +3747,7 @@ function vboxButtonMediaMenu(type,callback,mediumPath) {
* @return {Object} jQuery object containing button element
*/
this.getButtonElm = function () {
- return this._buttonElement;
+ return self._buttonElement;
};
/**
diff --git a/panes/tabVMDetails.html b/panes/tabVMDetails.html
index 17876e6..23df5c6 100644
--- a/panes/tabVMDetails.html
+++ b/panes/tabVMDetails.html
@@ -530,20 +530,24 @@ function __vboxDisplayDetailsData(data, multiSelect, targetDiv, skipTable) {
// Multi-select details table sections
////////////////////////////////////////
if(!skipTable) {
-
+
var tbl = $('<table />').attr({'id':'vboxDetailsGeneralTable-'+data.id,'class':'vboxInvisible vboxVMDetailsBox-vm-'+data.id,'style':'width: 100%;'}).append(
- $('<tr />').attr({'style':'vertical-align: top'}).append(
-
- $('<td />').css({'width':'100%'})
- .append(__vboxCreateDetailsSection(data,'general'))
- .append(__vboxCreateDetailsSection(data,'system'))
+ $('<tr />').attr({'style':'vertical-align: top'})
- ).append(
-
- $('<td />')
- .append(__vboxCreateDetailsSection(data,'preview'))
- )
+ .append(
+
+ $('<td />').css({'width':'100%'})
+ .append(__vboxCreateDetailsSection(data,'general'))
+ .append(__vboxCreateDetailsSection(data,'system'))
+
+ ).append(
+
+ vboxVMDetailsSections['preview'].condition() ?
+ $('<td />')
+ .append(__vboxCreateDetailsSection(data,'preview')) :
+ null
+ )
).data({'vmid':data.id});