Browse Source

init

tags/v1.0.0^0
Robin Thoni 6 years ago
commit
1b297505a4
100 changed files with 89037 additions and 0 deletions
  1. 2
    0
      .gitignore
  2. 23
    0
      README
  3. 18
    0
      docker-compose.yml
  4. 4
    0
      env
  5. 47
    0
      phpvirtualbox/Dockerfile
  6. 60
    0
      phpvirtualbox/apache2.conf
  7. 41
    0
      phpvirtualbox/common.sh
  8. 226
    0
      phpvirtualbox/config.php
  9. 10
    0
      phpvirtualbox/phpvirtualbox-5.0-5/.dockerignore
  10. 5
    0
      phpvirtualbox/phpvirtualbox-5.0-5/.gitignore
  11. 1441
    0
      phpvirtualbox/phpvirtualbox-5.0-5/CHANGELOG.txt
  12. 7
    0
      phpvirtualbox/phpvirtualbox-5.0-5/Dockerfile
  13. 621
    0
      phpvirtualbox/phpvirtualbox-5.0-5/GPLv3.txt
  14. 16
    0
      phpvirtualbox/phpvirtualbox-5.0-5/LICENSE.txt
  15. 32
    0
      phpvirtualbox/phpvirtualbox-5.0-5/README.md
  16. 226
    0
      phpvirtualbox/phpvirtualbox-5.0-5/config.php-example
  17. 1189
    0
      phpvirtualbox/phpvirtualbox-5.0-5/css/jquery-ui.css
  18. 261
    0
      phpvirtualbox/phpvirtualbox-5.0-5/css/jquery.projectPlugins.css
  19. 1136
    0
      phpvirtualbox/phpvirtualbox-5.0-5/css/layout.css
  20. 43
    0
      phpvirtualbox/phpvirtualbox-5.0-5/css/tipped.css
  21. 18
    0
      phpvirtualbox/phpvirtualbox-5.0-5/docker-compose.yml
  22. 387
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/api.php
  23. 10
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/config.js
  24. 0
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/index.html
  25. 385
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/jqueryFileTree.php
  26. 117
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/language.php
  27. 203
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/ActiveDirectory.php
  28. 202
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/Builtin.php
  29. 105
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/LDAP.php
  30. 115
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/OpenMediaVault.php
  31. 75
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/WebAuth.php
  32. 0
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/index.html
  33. 107
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/authinterface.php
  34. 269
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/config.php
  35. 0
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/index.html
  36. 151
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/language.php
  37. 95
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/utils.php
  38. 16737
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxServiceWrappers.php
  39. 5828
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxconnector.php
  40. 58555
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxweb-5.0.wsdl
  41. 14
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxwebService-5.0.wsdl
  42. 32
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/rdp.php
  43. 224
    0
      phpvirtualbox/phpvirtualbox-5.0-5/endpoints/screen.php
  44. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/30white.png
  45. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/50px-Question_icon.svg.png
  46. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/50px-Warning_icon.svg.png
  47. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_dn.png
  48. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_left.png
  49. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_right.png
  50. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_up.png
  51. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_dn.png
  52. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_left.png
  53. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_right.png
  54. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_up.png
  55. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/donate.gif
  56. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/downArrow.png
  57. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/header_grad.png
  58. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png
  59. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png
  60. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png
  61. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png
  62. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png
  63. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png
  64. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png
  65. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png
  66. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_222222_256x240.png
  67. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_2e83ff_256x240.png
  68. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_454545_256x240.png
  69. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_888888_256x240.png
  70. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_cd0a0a_256x240.png
  71. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/directory.png
  72. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/file.png
  73. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/folder_open.png
  74. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/spinner.gif
  75. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_bl.png
  76. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_bottom.png
  77. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_br.png
  78. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_glossy.png
  79. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_left.png
  80. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_right.png
  81. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_tl.png
  82. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_top.png
  83. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_tr.png
  84. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/rightArrow.png
  85. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/spinner.gif
  86. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/treeview-default-line.gif
  87. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/treeview-default.gif
  88. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/upArrow.png
  89. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox.icns
  90. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_16px.png
  91. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_20px.png
  92. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_32px.png
  93. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_40px.png
  94. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_48px.png
  95. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_64px.png
  96. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_cube_42px.png
  97. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_win.ico
  98. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/about.png
  99. BIN
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/about_16px.png
  100. 0
    0
      phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/acpi_16px.png

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
1
+env_override
2
+docker-compose.override.yml

+ 23
- 0
README View File

@@ -0,0 +1,23 @@
1
+Install and configure virtualbox on host (as root):
2
+```
3
+apt-get install -y virtualbox
4
+useradd -m vbox -G vboxusers
5
+passwd vbox # put the provided password in env file
6
+echo 'VBOXWEB_USER=vbox' >> /etc/default/virtualbox
7
+echo 'VBOXWEB_HOST=0.0.0.0' >> /etc/default/virtualbox
8
+systemctl enable vboxweb-service
9
+systemctl start vboxweb-service
10
+```
11
+Then reboot
12
+
13
+Allow autostart VMs (as root):
14
+```
15
+echo 'VBOXAUTOSTART_DB=/etc/vbox' >> /etc/default/virtualbox
16
+echo 'VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg' >> /etc/default/virtualbox
17
+echo 'default_policy = allow' > /etc/vbox/vbox.cfg
18
+chgrp vboxusers /etc/vbox
19
+chmod 1775 /etc/vbox
20
+# in vbox shell (su vbox, not sudo): VBoxManage setproperty autostartdbpath /etc/vbox
21
+# for each VM, when not running, in vbox shell (su vbox, not sudo): VBoxManage modifyvm VM_NAME --autostart-enabled on
22
+
23
+```

+ 18
- 0
docker-compose.yml View File

@@ -0,0 +1,18 @@
1
+version: '2'
2
+
3
+services:
4
+    phpvirtualbox:
5
+        build: ./phpvirtualbox
6
+        container_name: phpvirtualbox-phpvirtualbox
7
+#        restart: unless-stopped
8
+        networks:
9
+            phpvirtualbox.internal.docker:
10
+                aliases:
11
+                    - phpvirtualbox.phpvirtualbox.internal.docker
12
+        ports:
13
+            - "127.0.0.1:35020:80"
14
+        env_file:
15
+            - env
16
+
17
+networks:
18
+    phpvirtualbox.internal.docker:

+ 4
- 0
env View File

@@ -0,0 +1,4 @@
1
+PVB_HOST=172.17.0.1
2
+PVB_PORT=18083
3
+PVB_USERNAME=vbox
4
+PVB_PASSWORD=change_it

+ 47
- 0
phpvirtualbox/Dockerfile View File

@@ -0,0 +1,47 @@
1
+FROM robinthoni/debian-multiarch:jessie
2
+
3
+# FROM https://github.com/ZHAJOR/Docker-Apache-2.4-Php-5.6-for-Laravel
4
+MAINTAINER Robin Thoni <robin@rthoni.com>
5
+
6
+ARG CONFIG_DIR=/etc/default/config-files/
7
+
8
+RUN apt-get update && apt-get -y install\
9
+        apache2=2.4.*\
10
+        libapache2-mod-php5\
11
+        php5 &&\
12
+        apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
13
+
14
+RUN /usr/sbin/a2enmod rewrite &&\
15
+    rm -rf /var/www/html &&\
16
+    mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html &&\
17
+    chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
18
+
19
+RUN rm -rf /var/log/* &&\
20
+    mkdir -p /var/log/apache2 &&\
21
+    ln -s /dev/stderr /var/log/apache2/error.log &&\
22
+    ln -s /dev/stdout /var/log/apache2/access.log &&\
23
+    ln -s /dev/stdout /var/log/apache2/other_vhosts_access.log
24
+
25
+RUN apt-get update && \
26
+    apt-get install -y curl && \
27
+    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
28
+
29
+COPY apache2.conf /etc/apache2/apache2.conf
30
+
31
+COPY ./phpvirtualbox-5.0-5/ /var/www/html/
32
+
33
+COPY ./vars-vars /etc/vars-vars
34
+
35
+COPY ./vars-files /etc/vars-files
36
+
37
+COPY ./common.sh /common.sh
38
+
39
+COPY ./run.sh /run.sh
40
+
41
+RUN mkdir "${CONFIG_DIR}"
42
+
43
+COPY config.php "${CONFIG_DIR}/config.php"
44
+
45
+EXPOSE 80
46
+
47
+CMD ["/run.sh"]

+ 60
- 0
phpvirtualbox/apache2.conf View File

@@ -0,0 +1,60 @@
1
+# see http://sources.debian.net/src/apache2/2.4.10-1/debian/config-dir/apache2.conf
2
+
3
+ServerName poweradmin
4
+Mutex file:/var/lock/apache2 default
5
+PidFile /var/run/apache2/apache2.pid
6
+Timeout 300
7
+KeepAlive On
8
+MaxKeepAliveRequests 100
9
+KeepAliveTimeout 5
10
+User www-data
11
+Group www-data
12
+HostnameLookups Off
13
+ErrorLog /var/log/apache2/error.log
14
+LogLevel warn
15
+
16
+IncludeOptional mods-enabled/*.load
17
+IncludeOptional mods-enabled/*.conf
18
+
19
+# ports.conf
20
+Listen 80
21
+<IfModule ssl_module>
22
+    Listen 443
23
+</IfModule>
24
+<IfModule mod_gnutls.c>
25
+    Listen 443
26
+</IfModule>
27
+
28
+DocumentRoot "/var/www/html/"
29
+
30
+<Directory />
31
+    Options FollowSymLinks
32
+    AllowOverride None
33
+    Require all denied
34
+</Directory>
35
+
36
+<Directory /var/www/html/>
37
+    Options FollowSymLinks
38
+    AllowOverride All
39
+    Require all granted
40
+</Directory>
41
+
42
+
43
+
44
+LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
45
+LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
46
+LogFormat "%h %l %u %t \"%r\" %>s %O" common
47
+LogFormat "%{Referer}i -> %U" referer
48
+LogFormat "%{User-agent}i" agent
49
+
50
+CustomLog /var/log/apache2/access.log combined
51
+
52
+<FilesMatch \.php$>
53
+    SetHandler application/x-httpd-php
54
+</FilesMatch>
55
+
56
+# Multiple DirectoryIndex directives within the same context will add
57
+# to the list of resources to look for rather than replace
58
+# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
59
+DirectoryIndex disabled
60
+DirectoryIndex index.php index.html

+ 41
- 0
phpvirtualbox/common.sh View File

@@ -0,0 +1,41 @@
1
+export CONFIG_DIR="/etc/default/config-files/"
2
+
3
+resolv_host()
4
+{
5
+  hostname="${1}"
6
+  ip=$(getent hosts "${hostname}" | cut -d' ' -f1)
7
+  echo "${ip}"
8
+}
9
+
10
+replace_var()
11
+{
12
+  file="${1}"
13
+  var="${2}"
14
+  sed -e "s?${var}?${!var}?g" -i "${file}"
15
+}
16
+
17
+replace_vars()
18
+{
19
+  file="${1}"
20
+  for var in $(cat /etc/vars-vars)
21
+  do
22
+    replace_var "${file}" "${var}"
23
+  done
24
+}
25
+
26
+replace_files()
27
+{
28
+  cat /etc/vars-files | while read line
29
+  do
30
+    filesrc="${CONFIG_DIR}$(echo "${line}" | awk '{print $1}')"
31
+    filedst=$(echo "${line}" | awk '{print $2}')
32
+    if [ -f "${filesrc}" ]
33
+    then
34
+      echo "Expanding file ${filesrc} to ${filedst}"
35
+      cp "${filesrc}" "${filedst}"
36
+      replace_vars "${filedst}"
37
+    else
38
+      echo "File ${filesrc} does not exist. Skipping."
39
+    fi
40
+  done
41
+}

+ 226
- 0
phpvirtualbox/config.php View File

@@ -0,0 +1,226 @@
1
+<?php
2
+/**
3
+ * phpVirtualBox example configuration. 
4
+ * @version $Id: config.php-example 585 2015-04-04 11:39:31Z imoore76 $
5
+ *
6
+ * rename to config.php and edit as needed.
7
+ *
8
+ */
9
+class phpVBoxConfig {
10
+
11
+/* Username / Password for system user that runs VirtualBox */
12
+var $username = 'PVB_USERNAME';
13
+var $password = 'PVB_PASSWORD';
14
+
15
+/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
16
+var $location = 'http://PVB_HOST:PVB_PORT/';
17
+
18
+/* Default language. See languages folder for more language options.
19
+ * Can also be changed in File -> Preferences -> Language in
20
+ * phpVirtualBox.
21
+ */
22
+var $language = 'en';
23
+
24
+/* Set the standard VRDE Port Number / Range, e.g. 1010-1020 or 1027 */
25
+var $vrdeports = '9000-9100';
26
+
27
+/*
28
+ *
29
+ * Not-so-common options / tweaking
30
+ *
31
+ */
32
+
33
+// Multiple servers example config. Uncomment (remove /* and */) to use.
34
+// Add ALL the servers you want to use. Even if you have the server set
35
+// above. The default server will be the first one in the list.
36
+/*
37
+var $servers = array(
38
+        array(
39
+                'name' => 'London',
40
+                'username' => 'user',
41
+                'password' => 'pass',
42
+                'location' => 'http://192.168.1.1:18083/',
43
+                'authMaster' => true // Use this server for authentication
44
+        ),
45
+        array(
46
+                'name' => 'New York',
47
+                'username' => 'user2',
48
+                'password' => 'pass2',
49
+                'location' => 'http://192.168.1.2:18083/'
50
+        ),
51
+);
52
+*/
53
+
54
+// Disable authentication
55
+#var $noAuth = true;
56
+
57
+// Host / ip to use for console connections
58
+#var $consoleHost = '192.168.1.40';
59
+
60
+// Disable "preview" box
61
+#var $noPreview = true;
62
+
63
+// Default preview box update interval in seconds
64
+#var $previewUpdateInterval = 30;
65
+
66
+// Preview box pixel width
67
+#var $previewWidth = 180;
68
+
69
+// Max number of progress operations to keep in list
70
+var $maxProgressList = 5;
71
+
72
+// Change default preview aspect ratio to 1. 
73
+// http://www.wikipedia.org/wiki/Aspect_ratio_%28image%29#Previous_and_presently_used_aspect_ratios
74
+#var $previewAspectRatio = 1.6;
75
+
76
+// Enable custom VM icons
77
+#var $enableCustomIcons = true;
78
+
79
+/*
80
+Exclusively use phpVirtualBox's groups configuration rather than VirtualBox groups.
81
+This has the following effects:
82
+
83
+*) Group changes made in phpVirtualBox will not be reflected in VirtualBox programs such as
84
+	VirtualBox and VBoxManage
85
+*) Group changes will not affect which folder a VM is placed in
86
+*) You can rename groups that contain running VMs and move / copy running VMs to groups
87
+*/
88
+#var $phpVboxGroups = true;
89
+
90
+
91
+/*
92
+Allow to prompt deletion hard disk files on removal from Virtual Media Manager.
93
+If this is not set, files are always kept. If this is set, you will be PROMPTED
94
+to decide whether or not you would like to delete the hard disk file(s) when you
95
+remove a hard disk from virtual media manager. You may still choose not to delete
96
+the file when prompted.
97
+*/
98
+var $deleteOnRemove = true;
99
+
100
+/*
101
+ * File / Folder browser settings
102
+ */
103
+
104
+// Restrict file types
105
+var $browserRestrictFiles = array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.vbox','.cdr','.dmg','.ima','.dsk','.vfd');
106
+
107
+// Restrict locations / folders
108
+#var $browserRestrictFolders = array('D:\\','C:\\Users\\Ian'); // Or something like array('/home/vbox','/var/ISOs')
109
+
110
+// Force use of local, web server based file browser instead of going through vboxwebsrv
111
+#var $browserLocal = true;
112
+
113
+// Disable file / folder browser.
114
+#var $browserDisable = true;
115
+
116
+// Disable Windows drive detection
117
+#var $noWindowsDriveList = true;
118
+
119
+// Just list all drives from C:\ - Z:\ without checking if they exist or not.
120
+// This may be required on older Windows systems with more than one drive.
121
+#var $forceWindowsAllDriveList = true;
122
+
123
+/*
124
+ * Misc
125
+ */
126
+ 
127
+/*
128
+ * Auto-refresh interval in seconds for VirtualBox host memory usage information.
129
+ * Any value below 3 will be ignored.
130
+ */
131
+var $hostMemInfoRefreshInterval = 5;
132
+
133
+/* Show % of free host memory instead of % used */
134
+#var $hostMemInfoShowFreePct = true;
135
+
136
+/*
137
+ * VM Memory warnings.
138
+ * 
139
+ * If $vmMemoryStartLimitWarn is enabled, each time a VM is started through
140
+ * phpVirtualBox, it will check that the available host memory is greater than
141
+ * the base and video memory of the VM + 50MB (a little bit of overhead). If it
142
+ * is not, a confirmation dialog will be presented to confirm that you want to
143
+ * start the VM.
144
+ *
145
+ * If $vmMemoryOffset is set (and $vmMemoryStartLimitWarn), $vmMemoryOffset
146
+ * megabytes is subtracted from the available host memory before the check is
147
+ * performed by $vmMemoryStartLimitWarn logic. For instance it may be a good
148
+ * idea to always have VM memory requirements + 100MB free. 100 is the default.
149
+ */
150
+#var $vmMemoryStartLimitWarn = true;
151
+#var $vmMemoryOffset = 100;
152
+
153
+
154
+/*
155
+ * Display guest additions version of a running VM on its Details tab
156
+ */
157
+#var $enableGuestAdditionsVersionDisplay = true;
158
+
159
+/* Disable any of phpVirtualBox's main tabs */
160
+#var $disableTabVMSnapshots = true; // Snapshots tab
161
+#var $disableTabVMConsole = true; // Console tab
162
+
163
+/* Screen resolutions for console tab */
164
+var $consoleResolutions = array('640x480','800x600','1024x768','1280x720','1440x900');
165
+
166
+/* Console tab keyboard layout. Currently Oracle's RDP client only supports EN and DE. */
167
+var $consoleKeyboardLayout = 'EN';
168
+
169
+/* Max number of network cards per VM. Do not set above VirtualBox's limit (typically 8) or below 1 */
170
+var $nicMax = 4;
171
+
172
+/* Enable advanced configuration items (normally hidden in the VirtualBox GUI)
173
+ * Note that some of these items may not be translated to languages other than English. 
174
+ */
175
+#var $enableAdvancedConfig = true;
176
+
177
+/* Enable startup / shutdown configuration.
178
+ * This only works in linux and you must add the vboxinit file to
179
+ * your startup scripts list.
180
+ */
181
+#var $startStopConfig = true;
182
+
183
+// Authentication library.
184
+// var $authLib = 'Builtin';
185
+
186
+// VM ownership
187
+#var $enforceVMOwnership = true;
188
+
189
+// Per-user VM quota
190
+#var $vmQuotaPerUser = 2;
191
+
192
+
193
+// Allow VDE network configuration. This must be supported by the underlying VirtualBox installation!
194
+// If you do not know what VDE networking is - you do not need it, it is probably not supported by your
195
+// VirtualBox installation and will cause errors if enabled.
196
+#var $enableVDE = true; 
197
+
198
+// Disable setting SATA controllers port count to the max port number found when saving VMs.
199
+#var $disableSataPortCount = true;
200
+
201
+/* Enable Parallel Port configuration - EXPERIMENTAL
202
+LPT support may or may not work for you. 
203
+!!! VirtualBox LPT support only works in Linux. !!!
204
+*/
205
+#var $enableLPTConfig = true;
206
+
207
+/* Enable HardDisk IgnoreFlush configuration. This controls the "ExtraData" setting
208
+ * in "VBoxInternal/Devices/[controller type]/0/LUN#[x]/Config/IgnoreFlush". See
209
+ * Responding to guest IDE/SATA flush requests at:
210
+ * http://www.virtualbox.org/manual/ch12.html#idp12757424
211
+*/
212
+#var $enableHDFlushConfig = true;
213
+
214
+/*
215
+ * Event listener timeout in seconds. This is an advanced option that most people will
216
+ * probably not need to change.
217
+ */
218
+#var $eventListenerTimeout = 20;
219
+
220
+/* END SETTINGS  */
221
+
222
+
223
+}
224
+
225
+
226
+

+ 10
- 0
phpvirtualbox/phpvirtualbox-5.0-5/.dockerignore View File

@@ -0,0 +1,10 @@
1
+.buildpath
2
+.gitignore
3
+.git
4
+.project
5
+
6
+.DS_Store
7
+.SD_Store?
8
+.swp
9
+
10
+config.php

+ 5
- 0
phpvirtualbox/phpvirtualbox-5.0-5/.gitignore View File

@@ -0,0 +1,5 @@
1
+/.settings/
2
+/.buildpath
3
+/.project
4
+/config.php
5
+/phpinfo.php

+ 1441
- 0
phpvirtualbox/phpvirtualbox-5.0-5/CHANGELOG.txt
File diff suppressed because it is too large
View File


+ 7
- 0
phpvirtualbox/phpvirtualbox-5.0-5/Dockerfile View File

@@ -0,0 +1,7 @@
1
+FROM php:5.6-apache
2
+RUN apt-get update && \
3
+    apt-get install -y \
4
+        libxml2 \
5
+        libxml2-dev && \
6
+    docker-php-ext-install soap
7
+COPY . /var/www/html

+ 621
- 0
phpvirtualbox/phpvirtualbox-5.0-5/GPLv3.txt View File

@@ -0,0 +1,621 @@
1
+                    GNU GENERAL PUBLIC LICENSE
2
+                       Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+                            Preamble
9
+
10
+  The GNU General Public License is a free, copyleft license for
11
+software and other kinds of works.
12
+
13
+  The licenses for most software and other practical works are designed
14
+to take away your freedom to share and change the works.  By contrast,
15
+the GNU General Public License is intended to guarantee your freedom to
16
+share and change all versions of a program--to make sure it remains free
17
+software for all its users.  We, the Free Software Foundation, use the
18
+GNU General Public License for most of our software; it applies also to
19
+any other work released this way by its authors.  You can apply it to
20
+your programs, too.
21
+
22
+  When we speak of free software, we are referring to freedom, not
23
+price.  Our General Public Licenses are designed to make sure that you
24
+have the freedom to distribute copies of free software (and charge for
25
+them if you wish), that you receive source code or can get it if you
26
+want it, that you can change the software or use pieces of it in new
27
+free programs, and that you know you can do these things.
28
+
29
+  To protect your rights, we need to prevent others from denying you
30
+these rights or asking you to surrender the rights.  Therefore, you have
31
+certain responsibilities if you distribute copies of the software, or if
32
+you modify it: responsibilities to respect the freedom of others.
33
+
34
+  For example, if you distribute copies of such a program, whether
35
+gratis or for a fee, you must pass on to the recipients the same
36
+freedoms that you received.  You must make sure that they, too, receive
37
+or can get the source code.  And you must show them these terms so they
38
+know their rights.
39
+
40
+  Developers that use the GNU GPL protect your rights with two steps:
41
+(1) assert copyright on the software, and (2) offer you this License
42
+giving you legal permission to copy, distribute and/or modify it.
43
+
44
+  For the developers' and authors' protection, the GPL clearly explains
45
+that there is no warranty for this free software.  For both users' and
46
+authors' sake, the GPL requires that modified versions be marked as
47
+changed, so that their problems will not be attributed erroneously to
48
+authors of previous versions.
49
+
50
+  Some devices are designed to deny users access to install or run
51
+modified versions of the software inside them, although the manufacturer
52
+can do so.  This is fundamentally incompatible with the aim of
53
+protecting users' freedom to change the software.  The systematic
54
+pattern of such abuse occurs in the area of products for individuals to
55
+use, which is precisely where it is most unacceptable.  Therefore, we
56
+have designed this version of the GPL to prohibit the practice for those
57
+products.  If such problems arise substantially in other domains, we
58
+stand ready to extend this provision to those domains in future versions
59
+of the GPL, as needed to protect the freedom of users.
60
+
61
+  Finally, every program is threatened constantly by software patents.
62
+States should not allow patents to restrict development and use of
63
+software on general-purpose computers, but in those that do, we wish to
64
+avoid the special danger that patents applied to a free program could
65
+make it effectively proprietary.  To prevent this, the GPL assures that
66
+patents cannot be used to render the program non-free.
67
+
68
+  The precise terms and conditions for copying, distribution and
69
+modification follow.
70
+
71
+                       TERMS AND CONDITIONS
72
+
73
+  0. Definitions.
74
+
75
+  "This License" refers to version 3 of the GNU General Public License.
76
+
77
+  "Copyright" also means copyright-like laws that apply to other kinds of
78
+works, such as semiconductor masks.
79
+
80
+  "The Program" refers to any copyrightable work licensed under this
81
+License.  Each licensee is addressed as "you".  "Licensees" and
82
+"recipients" may be individuals or organizations.
83
+
84
+  To "modify" a work means to copy from or adapt all or part of the work
85
+in a fashion requiring copyright permission, other than the making of an
86
+exact copy.  The resulting work is called a "modified version" of the
87
+earlier work or a work "based on" the earlier work.
88
+
89
+  A "covered work" means either the unmodified Program or a work based
90
+on the Program.
91
+
92
+  To "propagate" a work means to do anything with it that, without
93
+permission, would make you directly or secondarily liable for
94
+infringement under applicable copyright law, except executing it on a
95
+computer or modifying a private copy.  Propagation includes copying,
96
+distribution (with or without modification), making available to the
97
+public, and in some countries other activities as well.
98
+
99
+  To "convey" a work means any kind of propagation that enables other
100
+parties to make or receive copies.  Mere interaction with a user through
101
+a computer network, with no transfer of a copy, is not conveying.
102
+
103
+  An interactive user interface displays "Appropriate Legal Notices"
104
+to the extent that it includes a convenient and prominently visible
105
+feature that (1) displays an appropriate copyright notice, and (2)
106
+tells the user that there is no warranty for the work (except to the
107
+extent that warranties are provided), that licensees may convey the
108
+work under this License, and how to view a copy of this License.  If
109
+the interface presents a list of user commands or options, such as a
110
+menu, a prominent item in the list meets this criterion.
111
+
112
+  1. Source Code.
113
+
114
+  The "source code" for a work means the preferred form of the work
115
+for making modifications to it.  "Object code" means any non-source
116
+form of a work.
117
+
118
+  A "Standard Interface" means an interface that either is an official
119
+standard defined by a recognized standards body, or, in the case of
120
+interfaces specified for a particular programming language, one that
121
+is widely used among developers working in that language.
122
+
123
+  The "System Libraries" of an executable work include anything, other
124
+than the work as a whole, that (a) is included in the normal form of
125
+packaging a Major Component, but which is not part of that Major
126
+Component, and (b) serves only to enable use of the work with that
127
+Major Component, or to implement a Standard Interface for which an
128
+implementation is available to the public in source code form.  A
129
+"Major Component", in this context, means a major essential component
130
+(kernel, window system, and so on) of the specific operating system
131
+(if any) on which the executable work runs, or a compiler used to
132
+produce the work, or an object code interpreter used to run it.
133
+
134
+  The "Corresponding Source" for a work in object code form means all
135
+the source code needed to generate, install, and (for an executable
136
+work) run the object code and to modify the work, including scripts to
137
+control those activities.  However, it does not include the work's
138
+System Libraries, or general-purpose tools or generally available free
139
+programs which are used unmodified in performing those activities but
140
+which are not part of the work.  For example, Corresponding Source
141
+includes interface definition files associated with source files for
142
+the work, and the source code for shared libraries and dynamically
143
+linked subprograms that the work is specifically designed to require,
144
+such as by intimate data communication or control flow between those
145
+subprograms and other parts of the work.
146
+
147
+  The Corresponding Source need not include anything that users
148
+can regenerate automatically from other parts of the Corresponding
149
+Source.
150
+
151
+  The Corresponding Source for a work in source code form is that
152
+same work.
153
+
154
+  2. Basic Permissions.
155
+
156
+  All rights granted under this License are granted for the term of
157
+copyright on the Program, and are irrevocable provided the stated
158
+conditions are met.  This License explicitly affirms your unlimited
159
+permission to run the unmodified Program.  The output from running a
160
+covered work is covered by this License only if the output, given its
161
+content, constitutes a covered work.  This License acknowledges your
162
+rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+  You may make, run and propagate covered works that you do not
165
+convey, without conditions so long as your license otherwise remains
166
+in force.  You may convey covered works to others for the sole purpose
167
+of having them make modifications exclusively for you, or provide you
168
+with facilities for running those works, provided that you comply with
169
+the terms of this License in conveying all material for which you do
170
+not control copyright.  Those thus making or running the covered works
171
+for you must do so exclusively on your behalf, under your direction
172
+and control, on terms that prohibit them from making any copies of
173
+your copyrighted material outside their relationship with you.
174
+
175
+  Conveying under any other circumstances is permitted solely under
176
+the conditions stated below.  Sublicensing is not allowed; section 10
177
+makes it unnecessary.
178
+
179
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+  No covered work shall be deemed part of an effective technological
182
+measure under any applicable law fulfilling obligations under article
183
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+similar laws prohibiting or restricting circumvention of such
185
+measures.
186
+
187
+  When you convey a covered work, you waive any legal power to forbid
188
+circumvention of technological measures to the extent such circumvention
189
+is effected by exercising rights under this License with respect to
190
+the covered work, and you disclaim any intention to limit operation or
191
+modification of the work as a means of enforcing, against the work's
192
+users, your or third parties' legal rights to forbid circumvention of
193
+technological measures.
194
+
195
+  4. Conveying Verbatim Copies.
196
+
197
+  You may convey verbatim copies of the Program's source code as you
198
+receive it, in any medium, provided that you conspicuously and
199
+appropriately publish on each copy an appropriate copyright notice;
200
+keep intact all notices stating that this License and any
201
+non-permissive terms added in accord with section 7 apply to the code;
202
+keep intact all notices of the absence of any warranty; and give all
203
+recipients a copy of this License along with the Program.
204
+
205
+  You may charge any price or no price for each copy that you convey,
206
+and you may offer support or warranty protection for a fee.
207
+
208
+  5. Conveying Modified Source Versions.
209
+
210
+  You may convey a work based on the Program, or the modifications to
211
+produce it from the Program, in the form of source code under the
212
+terms of section 4, provided that you also meet all of these conditions:
213
+
214
+    a) The work must carry prominent notices stating that you modified
215
+    it, and giving a relevant date.
216
+
217
+    b) The work must carry prominent notices stating that it is
218
+    released under this License and any conditions added under section
219
+    7.  This requirement modifies the requirement in section 4 to
220
+    "keep intact all notices".
221
+
222
+    c) You must license the entire work, as a whole, under this
223
+    License to anyone who comes into possession of a copy.  This
224
+    License will therefore apply, along with any applicable section 7
225
+    additional terms, to the whole of the work, and all its parts,
226
+    regardless of how they are packaged.  This License gives no
227
+    permission to license the work in any other way, but it does not
228
+    invalidate such permission if you have separately received it.
229
+
230
+    d) If the work has interactive user interfaces, each must display
231
+    Appropriate Legal Notices; however, if the Program has interactive
232
+    interfaces that do not display Appropriate Legal Notices, your
233
+    work need not make them do so.
234
+
235
+  A compilation of a covered work with other separate and independent
236
+works, which are not by their nature extensions of the covered work,
237
+and which are not combined with it such as to form a larger program,
238
+in or on a volume of a storage or distribution medium, is called an
239
+"aggregate" if the compilation and its resulting copyright are not
240
+used to limit the access or legal rights of the compilation's users
241
+beyond what the individual works permit.  Inclusion of a covered work
242
+in an aggregate does not cause this License to apply to the other
243
+parts of the aggregate.
244
+
245
+  6. Conveying Non-Source Forms.
246
+
247
+  You may convey a covered work in object code form under the terms
248
+of sections 4 and 5, provided that you also convey the
249
+machine-readable Corresponding Source under the terms of this License,
250
+in one of these ways:
251
+
252
+    a) Convey the object code in, or embodied in, a physical product
253
+    (including a physical distribution medium), accompanied by the
254
+    Corresponding Source fixed on a durable physical medium
255
+    customarily used for software interchange.
256
+
257
+    b) Convey the object code in, or embodied in, a physical product
258
+    (including a physical distribution medium), accompanied by a
259
+    written offer, valid for at least three years and valid for as
260
+    long as you offer spare parts or customer support for that product
261
+    model, to give anyone who possesses the object code either (1) a
262
+    copy of the Corresponding Source for all the software in the
263
+    product that is covered by this License, on a durable physical
264
+    medium customarily used for software interchange, for a price no
265
+    more than your reasonable cost of physically performing this
266
+    conveying of source, or (2) access to copy the
267
+    Corresponding Source from a network server at no charge.
268
+
269
+    c) Convey individual copies of the object code with a copy of the
270
+    written offer to provide the Corresponding Source.  This
271
+    alternative is allowed only occasionally and noncommercially, and
272
+    only if you received the object code with such an offer, in accord
273
+    with subsection 6b.
274
+
275
+    d) Convey the object code by offering access from a designated
276
+    place (gratis or for a charge), and offer equivalent access to the
277
+    Corresponding Source in the same way through the same place at no
278
+    further charge.  You need not require recipients to copy the
279
+    Corresponding Source along with the object code.  If the place to
280
+    copy the object code is a network server, the Corresponding Source
281
+    may be on a different server (operated by you or a third party)
282
+    that supports equivalent copying facilities, provided you maintain
283
+    clear directions next to the object code saying where to find the
284
+    Corresponding Source.  Regardless of what server hosts the
285
+    Corresponding Source, you remain obligated to ensure that it is
286
+    available for as long as needed to satisfy these requirements.
287
+
288
+    e) Convey the object code using peer-to-peer transmission, provided
289
+    you inform other peers where the object code and Corresponding
290
+    Source of the work are being offered to the general public at no
291
+    charge under subsection 6d.
292
+
293
+  A separable portion of the object code, whose source code is excluded
294
+from the Corresponding Source as a System Library, need not be
295
+included in conveying the object code work.
296
+
297
+  A "User Product" is either (1) a "consumer product", which means any
298
+tangible personal property which is normally used for personal, family,
299
+or household purposes, or (2) anything designed or sold for incorporation
300
+into a dwelling.  In determining whether a product is a consumer product,
301
+doubtful cases shall be resolved in favor of coverage.  For a particular
302
+product received by a particular user, "normally used" refers to a
303
+typical or common use of that class of product, regardless of the status
304
+of the particular user or of the way in which the particular user
305
+actually uses, or expects or is expected to use, the product.  A product
306
+is a consumer product regardless of whether the product has substantial
307
+commercial, industrial or non-consumer uses, unless such uses represent
308
+the only significant mode of use of the product.
309
+
310
+  "Installation Information" for a User Product means any methods,
311
+procedures, authorization keys, or other information required to install
312
+and execute modified versions of a covered work in that User Product from
313
+a modified version of its Corresponding Source.  The information must
314
+suffice to ensure that the continued functioning of the modified object
315
+code is in no case prevented or interfered with solely because
316
+modification has been made.
317
+
318
+  If you convey an object code work under this section in, or with, or
319
+specifically for use in, a User Product, and the conveying occurs as
320
+part of a transaction in which the right of possession and use of the
321
+User Product is transferred to the recipient in perpetuity or for a
322
+fixed term (regardless of how the transaction is characterized), the
323
+Corresponding Source conveyed under this section must be accompanied
324
+by the Installation Information.  But this requirement does not apply
325
+if neither you nor any third party retains the ability to install
326
+modified object code on the User Product (for example, the work has
327
+been installed in ROM).
328
+
329
+  The requirement to provide Installation Information does not include a
330
+requirement to continue to provide support service, warranty, or updates
331
+for a work that has been modified or installed by the recipient, or for
332
+the User Product in which it has been modified or installed.  Access to a
333
+network may be denied when the modification itself materially and
334
+adversely affects the operation of the network or violates the rules and
335
+protocols for communication across the network.
336
+
337
+  Corresponding Source conveyed, and Installation Information provided,
338
+in accord with this section must be in a format that is publicly
339
+documented (and with an implementation available to the public in
340
+source code form), and must require no special password or key for
341
+unpacking, reading or copying.
342
+
343
+  7. Additional Terms.
344
+
345
+  "Additional permissions" are terms that supplement the terms of this
346
+License by making exceptions from one or more of its conditions.
347
+Additional permissions that are applicable to the entire Program shall
348
+be treated as though they were included in this License, to the extent
349
+that they are valid under applicable law.  If additional permissions
350
+apply only to part of the Program, that part may be used separately
351
+under those permissions, but the entire Program remains governed by
352
+this License without regard to the additional permissions.
353
+
354
+  When you convey a copy of a covered work, you may at your option
355
+remove any additional permissions from that copy, or from any part of
356
+it.  (Additional permissions may be written to require their own
357
+removal in certain cases when you modify the work.)  You may place
358
+additional permissions on material, added by you to a covered work,
359
+for which you have or can give appropriate copyright permission.
360
+
361
+  Notwithstanding any other provision of this License, for material you
362
+add to a covered work, you may (if authorized by the copyright holders of
363
+that material) supplement the terms of this License with terms:
364
+
365
+    a) Disclaiming warranty or limiting liability differently from the
366
+    terms of sections 15 and 16 of this License; or
367
+
368
+    b) Requiring preservation of specified reasonable legal notices or
369
+    author attributions in that material or in the Appropriate Legal
370
+    Notices displayed by works containing it; or
371
+
372
+    c) Prohibiting misrepresentation of the origin of that material, or
373
+    requiring that modified versions of such material be marked in
374
+    reasonable ways as different from the original version; or
375
+
376
+    d) Limiting the use for publicity purposes of names of licensors or
377
+    authors of the material; or
378
+
379
+    e) Declining to grant rights under trademark law for use of some
380
+    trade names, trademarks, or service marks; or
381
+
382
+    f) Requiring indemnification of licensors and authors of that
383
+    material by anyone who conveys the material (or modified versions of
384
+    it) with contractual assumptions of liability to the recipient, for
385
+    any liability that these contractual assumptions directly impose on
386
+    those licensors and authors.
387
+
388
+  All other non-permissive additional terms are considered "further
389
+restrictions" within the meaning of section 10.  If the Program as you
390
+received it, or any part of it, contains a notice stating that it is
391
+governed by this License along with a term that is a further
392
+restriction, you may remove that term.  If a license document contains
393
+a further restriction but permits relicensing or conveying under this
394
+License, you may add to a covered work material governed by the terms
395
+of that license document, provided that the further restriction does
396
+not survive such relicensing or conveying.
397
+
398
+  If you add terms to a covered work in accord with this section, you
399
+must place, in the relevant source files, a statement of the
400
+additional terms that apply to those files, or a notice indicating
401
+where to find the applicable terms.
402
+
403
+  Additional terms, permissive or non-permissive, may be stated in the
404
+form of a separately written license, or stated as exceptions;
405
+the above requirements apply either way.
406
+
407
+  8. Termination.
408
+
409
+  You may not propagate or modify a covered work except as expressly
410
+provided under this License.  Any attempt otherwise to propagate or
411
+modify it is void, and will automatically terminate your rights under
412
+this License (including any patent licenses granted under the third
413
+paragraph of section 11).
414
+
415
+  However, if you cease all violation of this License, then your
416
+license from a particular copyright holder is reinstated (a)
417
+provisionally, unless and until the copyright holder explicitly and
418
+finally terminates your license, and (b) permanently, if the copyright
419
+holder fails to notify you of the violation by some reasonable means
420
+prior to 60 days after the cessation.
421
+
422
+  Moreover, your license from a particular copyright holder is
423
+reinstated permanently if the copyright holder notifies you of the
424
+violation by some reasonable means, this is the first time you have
425
+received notice of violation of this License (for any work) from that
426
+copyright holder, and you cure the violation prior to 30 days after
427
+your receipt of the notice.
428
+
429
+  Termination of your rights under this section does not terminate the
430
+licenses of parties who have received copies or rights from you under
431
+this License.  If your rights have been terminated and not permanently
432
+reinstated, you do not qualify to receive new licenses for the same
433
+material under section 10.
434
+
435
+  9. Acceptance Not Required for Having Copies.
436
+
437
+  You are not required to accept this License in order to receive or
438
+run a copy of the Program.  Ancillary propagation of a covered work
439
+occurring solely as a consequence of using peer-to-peer transmission
440
+to receive a copy likewise does not require acceptance.  However,
441
+nothing other than this License grants you permission to propagate or
442
+modify any covered work.  These actions infringe copyright if you do
443
+not accept this License.  Therefore, by modifying or propagating a
444
+covered work, you indicate your acceptance of this License to do so.
445
+
446
+  10. Automatic Licensing of Downstream Recipients.
447
+
448
+  Each time you convey a covered work, the recipient automatically
449
+receives a license from the original licensors, to run, modify and
450
+propagate that work, subject to this License.  You are not responsible
451
+for enforcing compliance by third parties with this License.
452
+
453
+  An "entity transaction" is a transaction transferring control of an
454
+organization, or substantially all assets of one, or subdividing an
455
+organization, or merging organizations.  If propagation of a covered
456
+work results from an entity transaction, each party to that
457
+transaction who receives a copy of the work also receives whatever
458
+licenses to the work the party's predecessor in interest had or could
459
+give under the previous paragraph, plus a right to possession of the
460
+Corresponding Source of the work from the predecessor in interest, if
461
+the predecessor has it or can get it with reasonable efforts.
462
+
463
+  You may not impose any further restrictions on the exercise of the
464
+rights granted or affirmed under this License.  For example, you may
465
+not impose a license fee, royalty, or other charge for exercise of
466
+rights granted under this License, and you may not initiate litigation
467
+(including a cross-claim or counterclaim in a lawsuit) alleging that
468
+any patent claim is infringed by making, using, selling, offering for
469
+sale, or importing the Program or any portion of it.
470
+
471
+  11. Patents.
472
+
473
+  A "contributor" is a copyright holder who authorizes use under this
474
+License of the Program or a work on which the Program is based.  The
475
+work thus licensed is called the contributor's "contributor version".
476
+
477
+  A contributor's "essential patent claims" are all patent claims
478
+owned or controlled by the contributor, whether already acquired or
479
+hereafter acquired, that would be infringed by some manner, permitted
480
+by this License, of making, using, or selling its contributor version,
481
+but do not include claims that would be infringed only as a
482
+consequence of further modification of the contributor version.  For
483
+purposes of this definition, "control" includes the right to grant
484
+patent sublicenses in a manner consistent with the requirements of
485
+this License.
486
+
487
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+patent license under the contributor's essential patent claims, to
489
+make, use, sell, offer for sale, import and otherwise run, modify and
490
+propagate the contents of its contributor version.
491
+
492
+  In the following three paragraphs, a "patent license" is any express
493
+agreement or commitment, however denominated, not to enforce a patent
494
+(such as an express permission to practice a patent or covenant not to
495
+sue for patent infringement).  To "grant" such a patent license to a
496
+party means to make such an agreement or commitment not to enforce a
497
+patent against the party.
498
+
499
+  If you convey a covered work, knowingly relying on a patent license,
500
+and the Corresponding Source of the work is not available for anyone
501
+to copy, free of charge and under the terms of this License, through a
502
+publicly available network server or other readily accessible means,
503
+then you must either (1) cause the Corresponding Source to be so
504
+available, or (2) arrange to deprive yourself of the benefit of the
505
+patent license for this particular work, or (3) arrange, in a manner
506
+consistent with the requirements of this License, to extend the patent
507
+license to downstream recipients.  "Knowingly relying" means you have
508
+actual knowledge that, but for the patent license, your conveying the
509
+covered work in a country, or your recipient's use of the covered work
510
+in a country, would infringe one or more identifiable patents in that
511
+country that you have reason to believe are valid.
512
+
513
+  If, pursuant to or in connection with a single transaction or
514
+arrangement, you convey, or propagate by procuring conveyance of, a
515
+covered work, and grant a patent license to some of the parties
516
+receiving the covered work authorizing them to use, propagate, modify
517
+or convey a specific copy of the covered work, then the patent license
518
+you grant is automatically extended to all recipients of the covered
519
+work and works based on it.
520
+
521
+  A patent license is "discriminatory" if it does not include within
522
+the scope of its coverage, prohibits the exercise of, or is
523
+conditioned on the non-exercise of one or more of the rights that are
524
+specifically granted under this License.  You may not convey a covered
525
+work if you are a party to an arrangement with a third party that is
526
+in the business of distributing software, under which you make payment
527
+to the third party based on the extent of your activity of conveying
528
+the work, and under which the third party grants, to any of the
529
+parties who would receive the covered work from you, a discriminatory
530
+patent license (a) in connection with copies of the covered work
531
+conveyed by you (or copies made from those copies), or (b) primarily
532
+for and in connection with specific products or compilations that
533
+contain the covered work, unless you entered into that arrangement,
534
+or that patent license was granted, prior to 28 March 2007.
535
+
536
+  Nothing in this License shall be construed as excluding or limiting
537
+any implied license or other defenses to infringement that may
538
+otherwise be available to you under applicable patent law.
539
+
540
+  12. No Surrender of Others' Freedom.
541
+
542
+  If conditions are imposed on you (whether by court order, agreement or
543
+otherwise) that contradict the conditions of this License, they do not
544
+excuse you from the conditions of this License.  If you cannot convey a
545
+covered work so as to satisfy simultaneously your obligations under this
546
+License and any other pertinent obligations, then as a consequence you may
547
+not convey it at all.  For example, if you agree to terms that obligate you
548
+to collect a royalty for further conveying from those to whom you convey
549
+the Program, the only way you could satisfy both those terms and this
550
+License would be to refrain entirely from conveying the Program.
551
+
552
+  13. Use with the GNU Affero General Public License.
553
+
554
+  Notwithstanding any other provision of this License, you have
555
+permission to link or combine any covered work with a work licensed
556
+under version 3 of the GNU Affero General Public License into a single
557
+combined work, and to convey the resulting work.  The terms of this
558
+License will continue to apply to the part which is the covered work,
559
+but the special requirements of the GNU Affero General Public License,
560
+section 13, concerning interaction through a network will apply to the
561
+combination as such.
562
+
563
+  14. Revised Versions of this License.
564
+
565
+  The Free Software Foundation may publish revised and/or new versions of
566
+the GNU General Public License from time to time.  Such new versions will
567
+be similar in spirit to the present version, but may differ in detail to
568
+address new problems or concerns.
569
+
570
+  Each version is given a distinguishing version number.  If the
571
+Program specifies that a certain numbered version of the GNU General
572
+Public License "or any later version" applies to it, you have the
573
+option of following the terms and conditions either of that numbered
574
+version or of any later version published by the Free Software
575
+Foundation.  If the Program does not specify a version number of the
576
+GNU General Public License, you may choose any version ever published
577
+by the Free Software Foundation.
578
+
579
+  If the Program specifies that a proxy can decide which future
580
+versions of the GNU General Public License can be used, that proxy's
581
+public statement of acceptance of a version permanently authorizes you
582
+to choose that version for the Program.
583
+
584
+  Later license versions may give you additional or different
585
+permissions.  However, no additional obligations are imposed on any
586
+author or copyright holder as a result of your choosing to follow a
587
+later version.
588
+
589
+  15. Disclaimer of Warranty.
590
+
591
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+  16. Limitation of Liability.
601
+
602
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+SUCH DAMAGES.
611
+
612
+  17. Interpretation of Sections 15 and 16.
613
+
614
+  If the disclaimer of warranty and limitation of liability provided
615
+above cannot be given local legal effect according to their terms,
616
+reviewing courts shall apply local law that most closely approximates
617
+an absolute waiver of all civil liability in connection with the
618
+Program, unless a warranty or assumption of liability accompanies a
619
+copy of the Program in return for a fee.
620
+
621
+                     END OF TERMS AND CONDITIONS

+ 16
- 0
phpvirtualbox/phpvirtualbox-5.0-5/LICENSE.txt View File

@@ -0,0 +1,16 @@
1
+phpVirtualBox - A web-based front-end to VirtualBox.
2
+Copyright (C) 2011  Ian Moore
3
+
4
+This program is free software; you can redistribute it and/or
5
+modify it under the terms of the GNU General Public License
6
+version 3 as published by the Free Software Foundation.
7
+
8
+This program is distributed in the hope that it will be useful,
9
+but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
+GNU General Public License for more details.
12
+
13
+You should have received a copy of the GNU General Public License
14
+(GPLv3.txt in this folder) along with this program; if not, write
15
+to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
16
+Floor, Boston, MA  02110-1301, USA.

+ 32
- 0
phpvirtualbox/phpvirtualbox-5.0-5/README.md View File

@@ -0,0 +1,32 @@
1
+# About
2
+
3
+phpVirtualBox is Copyright (C) 2015 Ian Moore (imoore76 at yahoo dot com)
4
+
5
+FREE, WITHOUT WARRANTY:
6
+
7
+All files of this program (phpVirtualBox) are distributed under the
8
+terms contained in the LICENSE.txt file in this folder unless otherwise
9
+specified in an individual source file. By using this software, you are
10
+agreeing to the terms contained therein. If you have not received and read
11
+the license file, or do not agree with its conditions, please cease using
12
+this software immediately and remove any copies you may have in your
13
+possession.
14
+
15
+# Installation from Zip file
16
+
17
+1) Download zip file from sourceforge project site: https://sourceforge.net/projects/phpvirtualbox/
18
+
19
+2) Rename config.php-example to config.php and edit as needed.
20
+
21
+# Post installation
22
+
23
+Default login is username: admin password: admin
24
+
25
+Please see the wiki located at
26
+http://sourceforge.net/p/phpvirtualbox/wiki/Home/
27
+for detailed installation and configuration instructions.
28
+
29
+# Password Recovery
30
+
31
+Rename the file recovery.php-disabled to recovery.php, navigate to it in
32
+your web browser, and follow the instructions presented.

+ 226
- 0
phpvirtualbox/phpvirtualbox-5.0-5/config.php-example View File

@@ -0,0 +1,226 @@
1
+<?php
2
+/**
3
+ * phpVirtualBox example configuration. 
4
+ * @version $Id: config.php-example 585 2015-04-04 11:39:31Z imoore76 $
5
+ *
6
+ * rename to config.php and edit as needed.
7
+ *
8
+ */
9
+class phpVBoxConfig {
10
+
11
+/* Username / Password for system user that runs VirtualBox */
12
+var $username = 'vbox';
13
+var $password = 'pass';
14
+
15
+/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
16
+var $location = 'http://127.0.0.1:18083/';
17
+
18
+/* Default language. See languages folder for more language options.
19
+ * Can also be changed in File -> Preferences -> Language in
20
+ * phpVirtualBox.
21
+ */
22
+var $language = 'en';
23
+
24
+/* Set the standard VRDE Port Number / Range, e.g. 1010-1020 or 1027 */
25
+var $vrdeports = '9000-9100';
26
+
27
+/*
28
+ *
29
+ * Not-so-common options / tweaking
30
+ *
31
+ */
32
+
33
+// Multiple servers example config. Uncomment (remove /* and */) to use.
34
+// Add ALL the servers you want to use. Even if you have the server set
35
+// above. The default server will be the first one in the list.
36
+/*
37
+var $servers = array(
38
+        array(
39
+                'name' => 'London',
40
+                'username' => 'user',
41
+                'password' => 'pass',
42
+                'location' => 'http://192.168.1.1:18083/',
43
+                'authMaster' => true // Use this server for authentication
44
+        ),
45
+        array(
46
+                'name' => 'New York',
47
+                'username' => 'user2',
48
+                'password' => 'pass2',
49
+                'location' => 'http://192.168.1.2:18083/'
50
+        ),
51
+);
52
+*/
53
+
54
+// Disable authentication
55
+#var $noAuth = true;
56
+
57
+// Host / ip to use for console connections
58
+#var $consoleHost = '192.168.1.40';
59
+
60
+// Disable "preview" box
61
+#var $noPreview = true;
62
+
63
+// Default preview box update interval in seconds
64
+#var $previewUpdateInterval = 30;
65
+
66
+// Preview box pixel width
67
+#var $previewWidth = 180;
68
+
69
+// Max number of progress operations to keep in list
70
+var $maxProgressList = 5;
71
+
72
+// Change default preview aspect ratio to 1. 
73
+// http://www.wikipedia.org/wiki/Aspect_ratio_%28image%29#Previous_and_presently_used_aspect_ratios
74
+#var $previewAspectRatio = 1.6;
75
+
76
+// Enable custom VM icons
77
+#var $enableCustomIcons = true;
78
+
79
+/*
80
+Exclusively use phpVirtualBox's groups configuration rather than VirtualBox groups.
81
+This has the following effects:
82
+
83
+*) Group changes made in phpVirtualBox will not be reflected in VirtualBox programs such as
84
+	VirtualBox and VBoxManage
85
+*) Group changes will not affect which folder a VM is placed in
86
+*) You can rename groups that contain running VMs and move / copy running VMs to groups
87
+*/
88
+#var $phpVboxGroups = true;
89
+
90
+
91
+/*
92
+Allow to prompt deletion hard disk files on removal from Virtual Media Manager.
93
+If this is not set, files are always kept. If this is set, you will be PROMPTED
94
+to decide whether or not you would like to delete the hard disk file(s) when you
95
+remove a hard disk from virtual media manager. You may still choose not to delete
96
+the file when prompted.
97
+*/
98
+var $deleteOnRemove = true;
99
+
100
+/*
101
+ * File / Folder browser settings
102
+ */
103
+
104
+// Restrict file types
105
+var $browserRestrictFiles = array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.vbox','.cdr','.dmg','.ima','.dsk','.vfd');
106
+
107
+// Restrict locations / folders
108
+#var $browserRestrictFolders = array('D:\\','C:\\Users\\Ian'); // Or something like array('/home/vbox','/var/ISOs')
109
+
110
+// Force use of local, web server based file browser instead of going through vboxwebsrv
111
+#var $browserLocal = true;
112
+
113
+// Disable file / folder browser.
114
+#var $browserDisable = true;
115
+
116
+// Disable Windows drive detection
117
+#var $noWindowsDriveList = true;
118
+
119
+// Just list all drives from C:\ - Z:\ without checking if they exist or not.
120
+// This may be required on older Windows systems with more than one drive.
121
+#var $forceWindowsAllDriveList = true;
122
+
123
+/*
124
+ * Misc
125
+ */
126
+ 
127
+/*
128
+ * Auto-refresh interval in seconds for VirtualBox host memory usage information.
129
+ * Any value below 3 will be ignored.
130
+ */
131
+var $hostMemInfoRefreshInterval = 5;
132
+
133
+/* Show % of free host memory instead of % used */
134
+#var $hostMemInfoShowFreePct = true;
135
+
136
+/*
137
+ * VM Memory warnings.
138
+ * 
139
+ * If $vmMemoryStartLimitWarn is enabled, each time a VM is started through
140
+ * phpVirtualBox, it will check that the available host memory is greater than
141
+ * the base and video memory of the VM + 50MB (a little bit of overhead). If it
142
+ * is not, a confirmation dialog will be presented to confirm that you want to
143
+ * start the VM.
144
+ *
145
+ * If $vmMemoryOffset is set (and $vmMemoryStartLimitWarn), $vmMemoryOffset
146
+ * megabytes is subtracted from the available host memory before the check is
147
+ * performed by $vmMemoryStartLimitWarn logic. For instance it may be a good
148
+ * idea to always have VM memory requirements + 100MB free. 100 is the default.
149
+ */
150
+#var $vmMemoryStartLimitWarn = true;
151
+#var $vmMemoryOffset = 100;
152
+
153
+
154
+/*
155
+ * Display guest additions version of a running VM on its Details tab
156
+ */
157
+#var $enableGuestAdditionsVersionDisplay = true;
158
+
159
+/* Disable any of phpVirtualBox's main tabs */
160
+#var $disableTabVMSnapshots = true; // Snapshots tab
161
+#var $disableTabVMConsole = true; // Console tab
162
+
163
+/* Screen resolutions for console tab */
164
+var $consoleResolutions = array('640x480','800x600','1024x768','1280x720','1440x900');
165
+
166
+/* Console tab keyboard layout. Currently Oracle's RDP client only supports EN and DE. */
167
+var $consoleKeyboardLayout = 'EN';
168
+
169
+/* Max number of network cards per VM. Do not set above VirtualBox's limit (typically 8) or below 1 */
170
+var $nicMax = 4;
171
+
172
+/* Enable advanced configuration items (normally hidden in the VirtualBox GUI)
173
+ * Note that some of these items may not be translated to languages other than English. 
174
+ */
175
+#var $enableAdvancedConfig = true;
176
+
177
+/* Enable startup / shutdown configuration.
178
+ * This only works in linux and you must add the vboxinit file to
179
+ * your startup scripts list.
180
+ */
181
+#var $startStopConfig = true;
182
+
183
+// Authentication library.
184
+// var $authLib = 'Builtin';
185
+
186
+// VM ownership
187
+#var $enforceVMOwnership = true;
188
+
189
+// Per-user VM quota
190
+#var $vmQuotaPerUser = 2;
191
+
192
+
193
+// Allow VDE network configuration. This must be supported by the underlying VirtualBox installation!
194
+// If you do not know what VDE networking is - you do not need it, it is probably not supported by your
195
+// VirtualBox installation and will cause errors if enabled.
196
+#var $enableVDE = true; 
197
+
198
+// Disable setting SATA controllers port count to the max port number found when saving VMs.
199
+#var $disableSataPortCount = true;
200
+
201
+/* Enable Parallel Port configuration - EXPERIMENTAL
202
+LPT support may or may not work for you. 
203
+!!! VirtualBox LPT support only works in Linux. !!!
204
+*/
205
+#var $enableLPTConfig = true;
206
+
207
+/* Enable HardDisk IgnoreFlush configuration. This controls the "ExtraData" setting
208
+ * in "VBoxInternal/Devices/[controller type]/0/LUN#[x]/Config/IgnoreFlush". See
209
+ * Responding to guest IDE/SATA flush requests at:
210
+ * http://www.virtualbox.org/manual/ch12.html#idp12757424
211
+*/
212
+#var $enableHDFlushConfig = true;
213
+
214
+/*
215
+ * Event listener timeout in seconds. This is an advanced option that most people will
216
+ * probably not need to change.
217
+ */
218
+#var $eventListenerTimeout = 20;
219
+
220
+/* END SETTINGS  */
221
+
222
+
223
+}
224
+
225
+
226
+

+ 1189
- 0
phpvirtualbox/phpvirtualbox-5.0-5/css/jquery-ui.css
File diff suppressed because it is too large
View File


+ 261
- 0
phpvirtualbox/phpvirtualbox-5.0-5/css/jquery.projectPlugins.css View File

@@ -0,0 +1,261 @@
1
+/**
2
+ * CSS for jquery plugins contained in js/jquery.projectPlugins.js
3
+ *
4
+ * $Id: jquery.projectPlugins.css 592 2015-04-12 19:53:44Z imoore76 $
5
+ *
6
+ */
7
+
8
+/*
9
+ * Medium select plugin CSS
10
+ */
11
+
12
+div.vboxMediumSelect {
13
+	background-color: #fff;
14
+	color: #000;
15
+	padding: 2px;
16
+	height: 16px;
17
+	cursor: pointer;
18
+	overflow: hidden;
19
+	margin: 0px;
20
+	width: 100%;
21
+	
22
+}
23
+
24
+
25
+div.vboxMediumSelectReadOnly {
26
+	padding-left: 20px;
27
+	background-position: 2px 2px;
28
+}
29
+
30
+div.vboxMediumSelectDiv { border: 1px solid transparent; }
31
+div.vboxMediumSelectHover {
32
+	background-color: #f0f8ff;
33
+	border: 1px solid #aaaaaa;	
34
+}
35
+
36
+div.vboxMediumSelectImg {
37
+	height: 16px;
38
+	padding: 2px;
39
+	width: 16px;
40
+	background-color: #fff;
41
+	margin: 0px;
42
+	background-position: 2px 6px;
43
+	background-repeat: no-repeat;
44
+}
45
+
46
+table.vboxDisabled div.vboxMediumSelect, table.vboxDisabled div.vboxMediumSelectImg {
47
+	background-color: #efefef;
48
+	border-color: #aaa;
49
+	color: #aaa;
50
+	background-position: -20px -20px;
51
+	cursor: default;
52
+}
53
+
54
+table.vboxMediumSelect td.vboxMediumSelectTableLeft {
55
+	border: 1px solid #000;
56
+	border-right: 0px;
57
+	cursor: pointer;
58
+}
59
+table.vboxMediumSelect td.vboxMediumSelectTableRight {
60
+	border: 1px solid #000;
61
+	border-left: 0px;
62
+	cursor: pointer;
63
+}
64
+
65
+table.vboxDisabled td.vboxMediumSelectTableLeft, table.vboxDisabled td.vboxMediumSelectTableRight {
66
+	border-color: #aaa;
67
+}
68
+
69
+ul.vboxMediumSelect {
70
+	list-style: none;
71
+	position: absolute;
72
+	background-color: #fff;
73
+	color: #000;
74
+	z-index: 9999;
75
+	padding-left: 2px;
76
+	margin: 0px;
77
+	cursor: pointer;
78
+	border: 1px solid #000;
79
+	border-top: 1px solid #99ccff;
80
+	border-left: 1px solid #99ccff;
81
+}
82
+
83
+ul.vboxMediumSelect ul { padding: 0px; margin-left: 8px; list-style: none; }
84
+ul.vboxMediumSelect li { padding: 0px 2px 0px 0px; margin: 0px; white-space: nowrap; }
85
+ul.vboxMediumSelect div { height: 16px; white-space: nowrap; padding: 1px 2px 1px 4px; }
86
+ul.vboxMediumSelect li.vboxMediumReadOnly { background-image: none; }
87
+ul.vboxMediumSelect li.vboxMediumReadOnly ul { padding: 0px 0px 0px 14px; background-image: none; }
88
+ul.vboxMediumSelect div.vboxMediumReadOnly { padding-left: 18px; background-position: 0px 0px; }
89
+
90
+
91
+/**
92
+ * Context menu plugin CSS
93
+ */
94
+.contextMenu {
95
+	position: absolute;
96
+	z-index: 9999999;
97
+	border: 1px solid #CCC;
98
+	padding: 0px;
99
+	margin: 0px;
100
+	display: none;
101
+	background-color: #e9e9e9;
102
+	background-repeat: no-repeat;
103
+}
104
+
105
+.contextMenu span.vboxMenuItemChecked {
106
+	display: none;
107
+	background: #ccc;
108
+	border: 1px solid #999;
109
+	border-radius: 6px;
110
+	-moz-border-radius: 6px;
111
+	-webkit-border-radius: 6px;
112
+	width: 20px;
113
+	height: 18px;
114
+	margin: 0px;
115
+	padding: 0px;
116
+	position: relative;
117
+	top: 1px;
118
+	left: 3px;
119
+}
120
+ul.contextMenu {
121
+	/* From #ffffff to #d9d9d9 */
122
+	background-color: #e9e9e9;
123
+	background: -webkit-gradient(linear, left top, right top, from(#ffffff), to(#d9d9d9)); /* for webkit browsers */
124
+	background: -moz-linear-gradient(left,  #ffffff, #d9d9d9); /* for firefox 3.6+ */
125
+	background: -o-linear-gradient(left,  #ffffff, #d9d9d9);
126
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#d9d9d9'); /* for IE */
127
+}
128
+
129
+ul.contextMenu li {
130
+	list-style: none;
131
+	padding: 0px;
132
+	margin: 0px;
133
+	white-space: nowrap;
134
+	border: 1px solid transparent;
135
+	position: relative;
136
+}
137
+
138
+ul.contextMenu li a.vboxCheckMark {
139
+	padding-left: 12px;
140
+}
141
+ul.contextMenu li a.vboxCheckMark > span.vboxCheckMark {
142
+	display: inline-block;
143
+	position: relative;
144
+	left: -6px;
145
+	padding: 0px;
146
+	margin: 0px;
147
+	width: 16px;
148
+	text-align: center;
149
+}
150
+ul.contextMenu li.vboxMenuItemChecked > span.vboxMenuItemChecked {
151
+	display: inline-block;
152
+}
153
+ul.contextMenu li.vboxMenuItemChecked > a {
154
+	position: absolute;
155
+	top: 0px;
156
+}
157
+.contextMenu LI input {
158
+	padding-left: 2px;
159
+}
160
+.contextMenu a, .contextMenu SPAN {
161
+	color: #333;
162
+	text-decoration: none;
163
+	display: block;
164
+	line-height: 20px;
165
+	height: 20px;
166
+	background-position: 6px center;
167
+	background-repeat: no-repeat;
168
+	outline: none;
169
+	padding: 1px 5px;
170
+	padding-left: 28px;
171
+	border: 0px solid transparent;
172
+	cursor: pointer;
173
+	white-space: nowrap;
174
+}
175
+
176
+ul.contextMenuNoBG li {
177
+	cursor: pointer;
178
+	border: 1px solid transparent;
179
+}
180
+ul.contextMenuNoBG li.disabled {
181
+	cursor: default;
182
+}
183
+ul.contextMenuNoBG SPAN {
184
+	display: inline;
185
+	padding-left: 2px;
186
+}
187
+ul.contextMenuNoBG A {
188
+	padding-left: 2px;
189
+}
190
+
191
+ul.contextMenu LI.vboxHover {
192
+	background-color: #f0f8ff;
193
+	border: 1px solid #aaaaaa;
194
+}
195
+ 
196
+.contextMenu LI.disabled img {
197
+	display: none;
198
+}
199
+
200
+.contextMenu LI.vboxHover.disabled, .contextMenu LI.disabled A, .contextMenu LI.disabled SPAN {
201
+	color: #AAA;
202
+	cursor: default;
203
+}
204
+
205
+.contextMenu LI.vboxHover.disabled, .contextMenu LI.vboxHover.disabled A {
206
+	background-color: transparent;
207
+}
208
+
209
+.contextMenu LI.separator {
210
+	border-top: 1px solid #CCC;
211
+}
212
+
213
+.contextMenu LI:first {
214
+	border-top: 1px solid transparent;
215
+}
216
+
217
+
218
+
219
+/**
220
+ * Filetree plugin css
221
+ */
222
+ul.jqueryFileTree {
223
+	font-family: Verdana, sans-serif;
224
+	font-size: 11px;
225
+	line-height: 18px;
226
+	padding: 0px;
227
+	margin: 0px;
228
+	display: block;
229
+}
230
+
231
+UL.jqueryFileTree LI {
232
+	list-style: none;
233
+	padding: 0px;
234
+	padding-left: 20px;
235
+	margin: 0px;
236
+	white-space: nowrap;
237
+	display: block;
238
+}
239
+
240
+UL.jqueryFileTree A {
241
+	text-decoration: none;
242
+	display: block;
243
+	padding: 0px 2px;
244
+}
245
+
246
+
247
+/* Core Styles */
248
+.jqueryFileTree LI.folder { background: url(../images/jqueryFileTree/directory.png) left top no-repeat; }
249
+.jqueryFileTree LI.expanded { background: url(../images/jqueryFileTree/folder_open.png) left top no-repeat; }
250
+.jqueryFileTree LI.file { background: url(../images/jqueryFileTree/file.png) left top no-repeat; }
251
+.jqueryFileTree LI.wait { background: url(../images/jqueryFileTree/spinner.gif) left top no-repeat; }
252
+.jqueryFileTree LI.file_vmdk { background: url(../images/vbox/virtualbox-vmdk.png) 0px 1px no-repeat; }
253
+.jqueryFileTree LI.file_vdi  { background: url(../images/vbox/virtualbox-vdi.png) 0px 1px no-repeat; }
254
+.jqueryFileTree LI.file_vhd  { background: url(../images/vbox/virtualbox-vhd.png) 0px 1px no-repeat; }
255
+.jqueryFileTree LI.file_hdd { background: url(../images/vbox/virtualbox-hdd.png) 0px 1px no-repeat; }
256
+.jqueryFileTree LI.file_ovf { background: url(../images/vbox/virtualbox-ovf.png) 0px 1px no-repeat; }
257
+.jqueryFileTree LI.file_ova { background: url(../images/vbox/virtualbox-ova.png) 0px 1px no-repeat; }
258
+.jqueryFileTree LI.file_iso, .jqueryFileTree LI.file_cdr, .jqueryFileTree LI.file_dmg { background: url(../images/vbox/cd_16px.png) 0px 1px no-repeat; }
259
+.jqueryFileTree LI.file_img, .jqueryFileTree LI.file_ima, .jqueryFileTree LI.file_dsk, .jqueryFileTree LI.file_vfd { background: url(../images/vbox/fd_16px.png) 0px 1px no-repeat; }
260
+.jqueryFileTree LI.file_vbox, .jqueryFileTree LI.file_xml { background: url(../images/vbox/virtualbox-vbox.png) 0px 1px no-repeat; }
261
+

+ 1136
- 0
phpvirtualbox/phpvirtualbox-5.0-5/css/layout.css
File diff suppressed because it is too large
View File


+ 43
- 0
phpvirtualbox/phpvirtualbox-5.0-5/css/tipped.css View File

@@ -0,0 +1,43 @@
1
+#tipped {
2
+	/* position & display are necessary */
3
+	position:absolute;
4
+	display:none;
5
+	
6
+	/* The rest are just to make it look good & can be changed as you want */
7
+	border: 1px solid #404040;
8
+	color: #404040;
9
+	
10
+	border-radius:5px;
11
+	padding:3px;
12
+	z-index: 99999;
13
+	font-size: 0.9em;
14
+	max-width: 50%;
15
+	
16
+	background: #f0f0f0;
17
+	background: -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); /* FF3.6+ */
18
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */
19
+	background: -webkit-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */
20
+	background: -o-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Opera 11.10+ */
21
+	background: -ms-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* IE10+ */
22
+	background: linear-gradient(to bottom, #ffffff 0%,#e0e0e0 100%); /* W3C */
23
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e0e0e0',GradientType=0 ); /* IE6-9 */
24
+	
25
+	overflow: hidden;
26
+}
27
+
28
+/* The tip content gets inserted into this element */
29
+#tipped-content p, #tipped p { padding: 2px; margin: 0px; padding-bottom:0px; } 
30
+
31
+/* This is the <div> that holds the close button/link.  No styling is required, but you'll likely want some. */
32
+#tipped-closer-wrapper {
33
+	display:none;
34
+	text-align:center;
35
+	margin: 0px;
36
+}
37
+
38
+/* The <span> that is the close button/link.  No styling is required, but you'll likely want some. */
39
+#tipped-closer {
40
+	display:none;
41
+	border:2px outset #999;
42
+	background-color:#CCC;
43
+}

+ 18
- 0
phpvirtualbox/phpvirtualbox-5.0-5/docker-compose.yml View File

@@ -0,0 +1,18 @@
1
+# Develop phpvirtualbox in docker
2
+#
3
+# 1) Get virtualbox host-only interface IP used by docker machine:
4
+#    docker-machine inspect default -f '{{.Driver.HostOnlyCIDR}}' | sed -e 's#/.*##'
5
+# 2) Start vboxwebsrv on the IP returned from the above command: 
6
+#    vboxwebsrv -H 192.168.99.1 # or edit vboxwebsrv startup config
7
+# 3) Edit config.php to use the IP
8
+# 4) docker-compose up
9
+# 5) Get docker machine ip:
10
+#    docker-machine ip default
11
+# 6) phpVirtualBox should be available at http://<ip returned from above command>
12
+#
13
+phpvirtualbox:
14
+  build: .
15
+  ports:
16
+    - "80:80"
17
+  volumes:
18
+    - .:/var/www/html

+ 387
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/api.php View File

@@ -0,0 +1,387 @@
1
+<?php
2
+/**
3
+ * Main API interface between JavaScript ajax calls and PHP functions.
4
+ * Accepts JSON, POST data or simple GET requests, and returns JSON data.
5
+ *
6
+ * @author Ian Moore (imoore76 at yahoo dot com)
7
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
8
+ * @version $Id: api.php 596 2015-04-19 11:50:53Z imoore76 $
9
+ * @package phpVirtualBox
10
+ * @see vboxconnector
11
+ * @see vboxAjaxRequest
12
+ *
13
+ * @global array $GLOBALS['response'] resopnse data sent back via json
14
+ * @name $response
15
+*/
16
+
17
+# Turn off PHP errors
18
+error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
19
+
20
+
21
+//Set no caching
22
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
23
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
24
+header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
25
+header("Pragma: no-cache");
26
+
27
+require_once(dirname(__FILE__).'/lib/config.php');
28
+require_once(dirname(__FILE__).'/lib/utils.php');
29
+require_once(dirname(__FILE__).'/lib/vboxconnector.php');
30
+
31
+// Init session
32
+global $_SESSION;
33
+
34
+/*
35
+ * Clean request
36
+ */
37
+$request = clean_request();
38
+
39
+
40
+global $response;
41
+$response = array('data'=>array('responseData'=>array()),'errors'=>array(),'persist'=>array(),'messages'=>array());
42
+
43
+/*
44
+ * Built-in requests
45
+ */
46
+$vbox = null; // May be set during request handling
47
+
48
+/**
49
+ * Main try / catch. Logic dictated by incoming 'fn' request
50
+ * parameter.
51
+ */
52
+try {
53
+
54
+	/* Check for password recovery file */
55
+	if(file_exists(dirname(dirname(__FILE__)).'/recovery.php')) {
56
+		throw new Exception('recovery.php exists in phpVirtualBox\'s folder. This is a security hazard. phpVirtualBox will not run until recovery.php has been renamed to a file name that does not end in .php such as <b>recovery.php-disabled</b>.',vboxconnector::PHPVB_ERRNO_FATAL);
57
+	}
58
+
59
+	/* Check for PHP version */
60
+	if (!version_compare(PHP_VERSION, '5.2.0', '>=')) {
61
+		throw new Exception('phpVirtualBox requires PHP >= 5.2.0, but this server is running version '. PHP_VERSION .'. Please upgrade PHP.');
62
+	}
63
+
64
+	# Only valid function chars
65
+	$request['fn'] = preg_replace('[^a-zA-Z0-9_-]', '', $request['fn']);
66
+
67
+	/* Check for function called */
68
+	switch($request['fn']) {
69
+
70
+		/*
71
+		 * No method called
72
+		 */
73
+	    case '':
74
+	    	throw new Exception('No method called.');
75
+	    	break;
76
+
77
+		/*
78
+		 * Return phpVirtualBox's configuration data
79
+		 */
80
+		case 'getConfig':
81
+
82
+			$settings = new phpVBoxConfigClass();
83
+			$response['data']['responseData'] = get_object_vars($settings);
84
+			$response['data']['responseData']['host'] = parse_url($response['data']['responseData']['location']);
85
+			$response['data']['responseData']['host'] = $response['data']['responseData']['host']['host'];
86
+			$response['data']['responseData']['phpvboxver'] = @constant('PHPVBOX_VER');
87
+
88
+			// Session
89
+			session_init();
90
+
91
+			// Hide credentials
92
+			unset($response['data']['responseData']['username']);
93
+			unset($response['data']['responseData']['password']);
94
+			foreach($response['data']['responseData']['servers'] as $k => $v)
95
+				$response['data']['responseData']['servers'][$k] = array('name'=>$v['name']);
96
+
97
+			// Vbox version
98
+			$vbox = new vboxconnector();
99
+			$response['data']['responseData']['version'] = $vbox->getVersion();
100
+			$response['data']['responseData']['hostOS'] = $vbox->vbox->host->operatingSystem;
101
+			$response['data']['responseData']['DSEP'] = $vbox->getDsep();
102
+			$response['data']['responseData']['groupDefinitionKey'] = ($settings->phpVboxGroups ? vboxconnector::phpVboxGroupKey : 'GUI/GroupDefinitions');
103
+
104
+			$response['data']['success'] = true;
105
+
106
+			break;
107
+
108
+		/*
109
+		 *
110
+		 * USER FUNCTIONS FOLLOW
111
+		 *
112
+		 */
113
+
114
+		/*
115
+		 * Pass login to authentication module.
116
+		 */
117
+		case 'login':
118
+
119
+
120
+			// NOTE: Do not break. Fall through to 'getSession
121
+			if(!$request['params']['u'] || !$request['params']['p']) {
122
+				break;
123
+			}
124
+
125
+			// Session
126
+			session_init(true);
127
+
128
+			$settings = new phpVBoxConfigClass();
129
+
130
+			// Try / catch here to hide login credentials
131
+			try {
132
+				$settings->auth->login($request['params']['u'], $request['params']['p']);
133
+			} catch(Exception $e) {
134
+				throw new Exception($e->getMessage(), $e->getCode());
135
+			}
136
+
137
+			// We're done writing to session
138
+			if(function_exists('session_write_close'))
139
+				@session_write_close();
140
+
141
+
142
+
143
+		/*
144
+		 * Return $_SESSION data
145
+		 */
146
+		case 'getSession':
147
+
148
+			$settings = new phpVBoxConfigClass();
149
+			if(method_exists($settings->auth,'autoLoginHook'))
150
+			{
151
+				// Session
152
+				session_init(true);
153
+
154
+				$settings->auth->autoLoginHook();
155
+
156
+				// We're done writing to session
157
+				if(function_exists('session_write_close'))
158
+					@session_write_close();
159
+
160
+			} else {
161
+
162
+				session_init();
163
+
164
+			}
165
+
166
+
167
+			$response['data']['responseData'] = $_SESSION;
168
+			$response['data']['success'] = true;
169
+			break;
170
+
171
+		/*
172
+		 * Change phpVirtualBox password. Passed to auth module's
173
+		 * changePassword method.
174
+		 */
175
+		case 'changePassword':
176
+
177
+			// Session
178
+			session_init(true);
179
+
180
+			$settings = new phpVBoxConfigClass();
181
+			$response['data']['success'] = $settings->auth->changePassword($request['params']['old'],
182
+					                                                       $request['params']['new']);
183
+
184
+			// We're done writing to session
185
+			if(function_exists('session_write_close'))
186
+				@session_write_close();
187
+
188
+			break;
189
+
190
+		/*
191
+		 * Get a list of phpVirtualBox users. Passed to auth module's
192
+		 * getUsers method.
193
+		 */
194
+		case 'getUsers':
195
+
196
+			// Session
197
+			session_init();
198
+
199
+			// Must be an admin
200
+			if(!$_SESSION['admin']) break;
201
+
202
+			$settings = new phpVBoxConfigClass();
203
+			$response['data']['responseData'] = $settings->auth->listUsers();
204
+			$response['date']['success'] = true;
205
+
206
+			break;
207
+
208
+		/*
209
+		 * Remove a phpVirtualBox user. Passed to auth module's
210
+		 * deleteUser method.
211
+		 */
212
+		case 'delUser':
213
+
214
+			// Session
215
+			session_init();
216
+
217
+			// Must be an admin
218
+			if(!$_SESSION['admin']) break;
219
+
220
+			$settings = new phpVBoxConfigClass();
221
+			$settings->auth->deleteUser($request['params']['u']);
222
+
223
+			$response['data']['success'] = true;
224
+			break;
225
+
226
+		/*
227
+		 * Edit a phpVirtualBox user. Passed to auth module's
228
+		 * updateUser method.
229
+		 */
230
+		case 'editUser':
231
+
232
+			$skipExistCheck = true;
233
+			// Fall to addUser
234
+
235
+		/*
236
+		 * Add a user to phpVirtualBox. Passed to auth module's
237
+		 * updateUser method.
238
+		 */
239
+		case 'addUser':
240
+
241
+			// Session
242
+			session_init();
243
+
244
+			// Must be an admin
245
+			if(!$_SESSION['admin']) break;
246
+
247
+			$settings = new phpVBoxConfigClass();
248
+			$settings->auth->updateUser($request['params'], @$skipExistCheck);
249
+
250
+			$response['data']['success'] = true;
251
+			break;
252
+
253
+		/*
254
+		 * Log out of phpVirtualBox. Passed to auth module's
255
+		 * logout method.
256
+		 */
257
+		case 'logout':
258
+
259
+			// Session
260
+			session_init(true);
261
+
262
+			$vbox = new vboxconnector();
263
+			$vbox->skipSessionCheck = true;
264
+
265
+			$settings = new phpVBoxConfigClass();
266
+			$settings->auth->logout($response);
267
+
268
+			session_destroy();
269
+
270
+			$response['data']['success'] = true;
271
+
272
+			break;
273
+
274
+
275
+		/*
276
+		 * If the above cases did not match, assume it is a request
277
+		 * that should be passed to vboxconnector.
278
+		 */
279
+		default:
280
+
281
+			$vbox = new vboxconnector();
282
+
283
+
284
+			/*
285
+			 * Every 1 minute we'll check that the account has not
286
+			 * been deleted since login, and update admin credentials.
287
+			 */
288
+			if($_SESSION['user'] && ((intval($_SESSION['authCheckHeartbeat'])+60) < time())) {
289
+
290
+				// init session and keep it open
291
+				session_init(true);
292
+				$vbox->settings->auth->heartbeat($vbox);
293
+
294
+				// We're done writing to session
295
+				if(function_exists('session_write_close'))
296
+					@session_write_close();
297
+
298
+			} else {
299
+
300
+				// init session but close it
301
+				session_init();
302
+
303
+			}
304
+
305
+			/*
306
+			 *  Persistent request data
307
+			 */
308
+			if(is_array($request['persist'])) {
309
+				$vbox->persistentRequest = $request['persist'];
310
+			}
311
+
312
+
313
+			/*
314
+			 * Call to vboxconnector
315
+			 */
316
+			$vbox->{$request['fn']}($request['params'],array(&$response));
317
+
318
+
319
+			/*
320
+			 * Send back persistent request in response
321
+			*/
322
+			if(is_array($vbox->persistentRequest) && count($vbox->persistentRequest)) {
323
+				$response['data']['persist'] = $vbox->persistentRequest;
324
+			}
325
+			break;
326
+
327
+	} // </switch()>
328
+
329
+/*
330
+ * Catch all exceptions and populate errors in the
331
+ * JSON response data.
332
+ */
333
+} catch (Exception $e) {
334
+
335
+	// Just append to $vbox->errors and let it get
336
+	// taken care of below
337
+	if(!$vbox || !$vbox->errors) {
338
+		$vbox->errors = array();
339
+	}
340
+	$vbox->errors[] = $e;
341
+}
342
+
343
+
344
+// Add any messages
345
+if($vbox && count($vbox->messages)) {
346
+	foreach($vbox->messages as $m)
347
+		$response['messages'][] = 'vboxconnector('.$request['fn'] .'): ' . $m;
348
+}
349
+// Add other error info
350
+if($vbox && $vbox->errors) {
351
+
352
+	foreach($vbox->errors as $e) { /* @var $e Exception */
353
+
354
+		ob_start();
355
+		print_r($e);
356
+		$d = ob_get_contents();
357
+		ob_end_clean();
358
+
359
+		# Add connection details to connection errors
360
+		if($e->getCode() == vboxconnector::PHPVB_ERRNO_CONNECT && isset($vbox->settings))
361
+			$d .= "\n\nLocation:" . $vbox->settings->location;
362
+
363
+		$response['messages'][] = htmlentities($e->getMessage()).' ' . htmlentities($details);
364
+
365
+		$response['errors'][] = array(
366
+			'error'=> ($e->getCode() & vboxconnector::PHPVB_ERRNO_HTML ? $e->getMessage() : htmlentities($e->getMessage())),
367
+			'details'=>htmlentities($d),
368
+			'errno'=>$e->getCode(),
369
+			// Fatal errors halt all processing
370
+			'fatal'=>($e->getCode() & vboxconnector::PHPVB_ERRNO_FATAL),
371
+			// Connection errors display alternate servers options
372
+			'connection'=>($e->getCode() & vboxconnector::PHPVB_ERRNO_CONNECT)
373
+		);
374
+	}
375
+}
376
+
377
+/*
378
+ * Return response as JSON encoded data or use PHP's
379
+ * print_r to dump data to browser.
380
+ */
381
+if(isset($request['printr'])) {
382
+	print_r($response);
383
+} else {
384
+    header('Content-type: application/json');
385
+	echo(json_encode($response));
386
+}
387
+

+ 10
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/config.js View File

@@ -0,0 +1,10 @@
1
+/*
2
+ * Endpoint configuration for phpVirtualBox
3
+ */
4
+var vboxEndpointConfig = {
5
+	api: 'endpoints/api.php',
6
+	screen: 'endpoints/screen.php',
7
+	rdpGen: 'endpoints/rdp.php',
8
+	filebrowser: 'endpoints/jqueryFileTree.php',
9
+	require: ['endpoints/language.php']
10
+}

+ 0
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/index.html View File


+ 385
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/jqueryFileTree.php View File

@@ -0,0 +1,385 @@
1
+<?php
2
+//
3
+// jQuery File Tree PHP Connector
4
+//
5
+// Version 1.01
6
+//
7
+// Cory S.N. LaViska
8
+// A Beautiful Site (http://abeautifulsite.net/)
9
+// 24 March 2008
10
+//
11
+// History:
12
+//
13
+// 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
14
+// 1.00 - released (24 March 2008)
15
+//
16
+// Output a list of files for jQuery File Tree
17
+//
18
+//	]--- Modified by Ian Moore for phpVirtualBox.
19
+//
20
+// $Id: jqueryFileTree.php 592 2015-04-12 19:53:44Z imoore76 $
21
+//
22
+//
23
+
24
+# Turn off PHP notices
25
+error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
26
+
27
+global $vbox, $localbrowser, $allowed;
28
+
29
+require_once(dirname(__FILE__).'/lib/config.php');
30
+require_once(dirname(__FILE__).'/lib/utils.php');
31
+require_once(dirname(__FILE__).'/lib/vboxconnector.php');
32
+
33
+error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
34
+
35
+session_init();
36
+if(!$_SESSION['valid']) return;
37
+
38
+/*
39
+ * Get Settings
40
+ */
41
+$settings = new phpVBoxConfigClass();
42
+
43
+
44
+$vbox = new vboxconnector();
45
+$vbox->connect();
46
+
47
+/*
48
+ * Clean request
49
+ */
50
+global $request;
51
+$request = clean_request();
52
+
53
+/*
54
+ * Determine directory separator
55
+ */
56
+$localbrowser = @$settings->browserLocal;
57
+if($localbrowser) {
58
+    define('DSEP', DIRECTORY_SEPARATOR);
59
+} else {
60
+    define('DSEP',$vbox->getDsep());
61
+}
62
+
63
+/*
64
+ * Compose allowed file types list
65
+ */
66
+$allowed_exts = $settings->browserRestrictFiles;
67
+if(is_array($allowed_exts) && count($allowed_exts) > 0) $allowed_exts = array_combine($allowed_exts,$allowed_exts);
68
+else $allowed_exts = array();
69
+
70
+/* Allowed folders list */
71
+$allowed_folders = @$settings->browserRestrictFolders;
72
+if(!is_array($allowed_folders))
73
+	$allowed_folders = array();
74
+
75
+/*
76
+ * Get a list of windows drives
77
+ */
78
+function get_windows_drives() {
79
+    $checklist = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
80
+    $drives = array();
81
+    for($i = 0; $i < strlen($d); $i++) {
82
+        if(is_dir($checklist[$i].':\\')) {
83
+            $drives[] = $checklist[$i].':\\';
84
+        }
85
+    }
86
+    return $drives;
87
+}
88
+
89
+/*
90
+ * Allowed folders in windows if none are set
91
+ */
92
+if(stripos($vbox->vbox->host->operatingSystem,'win') === 0 && !count($allowed_folders)) {
93
+
94
+	/*
95
+	 * Assumes web server and vbox host are the same physical machine
96
+	 */
97
+    if($request['fullpath'] && !$settings->forceWindowsAllDriveList && !$settings->noWindowsDriveList && stripos(PHP_OS,'win') === 0) {
98
+
99
+
100
+        $allowed_folders = get_windows_drives();
101
+
102
+    /*
103
+     * Just show all C-Z drive letters if vboxhost is windows and our web server is not...
104
+     */
105
+    } else if($request['fullpath'] && ($settings->forceWindowsAllDriveList || (!$settings->noWindowsDriveList && stripos(PHP_OS,'win') === false))) {
106
+    	$allowed_folders = array();
107
+        for($i = 67; $i < 91; $i++) {
108
+        	$allowed_folders[] = chr($i) .':\\';
109
+        }
110
+    }
111
+    $allowed_folders = array_combine($allowed_folders,$allowed_folders);
112
+
113
+}
114
+
115
+
116
+/* Deterine target DIR requested.
117
+ * In some cases, "dir" passed is just a file name
118
+ */
119
+if(strpos($request['dir'],DSEP)===false) {
120
+	$request['dir'] = DSEP;
121
+}
122
+
123
+// Eliminate duplicate DSEPs
124
+$request['dir'] = str_replace(DSEP.DSEP,DSEP,$request['dir']);
125
+
126
+
127
+/*
128
+ * Check that folder restriction validates if it exists
129
+ */
130
+if($request['dir'] != DSEP && count($allowed_folders)) {
131
+	$valid = false;
132
+	foreach($allowed_folders as $f) {
133
+		if(strpos(strtoupper($request['dir']),strtoupper($f)) === 0) {
134
+			$valid = true;
135
+			break;
136
+		}
137
+	}
138
+	if(!$valid) {
139
+		$request['dir'] = DSEP;
140
+	}
141
+}
142
+
143
+/*
144
+ * Populate $returnData with directory listing
145
+ */
146
+$returnData = array();
147
+
148
+/* Folder Restriction with root '/' requested */
149
+if($request['dir'] == DSEP && count($allowed_folders)) {
150
+
151
+	/* Just return restricted folders */
152
+	foreach($allowed_folders as $f) {
153
+		array_push($returnData, folder_entry($f, true));
154
+
155
+	}
156
+
157
+} else {
158
+
159
+
160
+    /* Full, expanded path to $dir */
161
+    if($request['fullpath']) {
162
+
163
+
164
+    	/* Go through allowed folders if it is set */
165
+    	if(count($allowed_folders)) {
166
+
167
+
168
+    		foreach($allowed_folders as $f) {
169
+
170
+    			/* If this was not exactly the requested folder, but a parent,
171
+    			 * list everything below it.
172
+    			 */
173
+    			if((strtoupper($request['dir']) != strtoupper($f)) && strpos(strtoupper($request['dir']),strtoupper($f)) === 0) {
174
+
175
+    				// List entries in this folder
176
+    				$path = explode(DSEP, substr($request['dir'],strlen($f)));
177
+
178
+    				if($path[0] == '') {
179
+    				    array_shift($path);
180
+    				}
181
+
182
+    			    $folder_entry = folder_entry($f, true);
183
+
184
+    			    $folder_entry['children'] = getdir($f, $request['dirsOnly'], $path);
185
+    			    $folder_entry['expanded'] = true;
186
+
187
+    			    array_push($returnData, $folder_entry);
188
+
189
+    			} else {
190
+    				array_push($returnData, folder_entry($f,true));
191
+    			}
192
+
193
+    		}
194
+
195
+    	/* Just get full path */
196
+    	} else {
197
+
198
+			// List entries in this folder
199
+			$path = explode(DSEP,$request['dir']);
200
+			$root = array_shift($path).DSEP;
201
+
202
+			// Folder entry
203
+			$returnData = getdir($root, $request['dirsOnly'], $path);
204
+
205
+    	}
206
+
207
+
208
+    } else {
209
+
210
+        /* Default action. Return dir requested */
211
+        $returnData = getdir($request['dir'], $request['dirsOnly']);
212
+
213
+    }
214
+
215
+}
216
+
217
+header('Content-type: application/json');
218
+echo(json_encode($returnData));
219
+
220
+
221
+/*
222
+ * Get directory entries
223
+ */
224
+function getdir($dir, $dirsOnly=false, $recurse=array()) {
225
+
226
+	if(!$dir) $dir = DSEP;
227
+
228
+	$entries = getDirEntries($dir, $dirsOnly);
229
+
230
+    if(!count($entries))
231
+    	return array();
232
+
233
+    $dirents = array();
234
+    foreach($entries as $path => $type) {
235
+
236
+        if($type == 'folder' && count($recurse) && (strcasecmp($recurse[0],vbox_basename($path)) == 0)) {
237
+
238
+        	$entry = folder_entry($path, false, true);
239
+
240
+            $entry['children'] = getdir($dir.DSEP.array_shift($recurse), $dirsOnly, $recurse);
241
+
242
+            array_push($dirents, $entry);
243
+
244
+        } else {
245
+
246
+        	// Push folder on to stack
247
+        	if($type == 'folder') {
248
+
249
+        	   array_push($dirents, folder_entry($path));
250
+
251
+        	// Push file on to stack
252
+        	} else {
253
+
254
+        		$ext = strtolower(preg_replace('/^.*\./', '', $file));
255
+
256
+                if(count($allowed) && !$allowed['.'.$ext]) continue;
257
+
258
+                array_push($dirents, file_entry($path));
259
+        	}
260
+        }
261
+
262
+    }
263
+
264
+    return $dirents;
265
+
266
+}
267
+
268
+function vbox_basename($b) { return substr($b,strrpos($b,DSEP)+1); }
269
+function file_entry($f) {
270
+	$f = str_replace(DSEP.DSEP,DSEP,$f);
271
+    $ext = strtolower(preg_replace('/^.*\./', '', $f));
272
+    return array(
273
+        'ext' => $ext,
274
+        'name' => htmlentities(vbox_basename($f), ENT_QUOTES),
275
+        'path' => htmlentities($f, ENT_QUOTES),
276
+        'type' => 'file'
277
+    );
278
+}
279
+function folder_entry($f,$full=false,$expanded=false) {
280
+	$f = str_replace(DSEP.DSEP,DSEP,$f);
281
+    $selected = (strnatcasecmp(rtrim($f,DSEP),rtrim($GLOBALS['request']['dir'],DSEP)) == 0) && $expanded;
282
+    return array(
283
+        'expanded' => (bool)$expanded,
284
+        'selected' => (bool)$selected,
285
+        'path' => htmlentities($f,ENT_QUOTES),
286
+        'name' => htmlentities(($full ? $f : vbox_basename($f)),ENT_QUOTES),
287
+        'type' => 'folder',
288
+		'children' => array()
289
+    );
290
+}
291
+
292
+
293
+
294
+/**
295
+ * Rreturn a list of directory entries
296
+ *
297
+ * @param String $dir
298
+ * @return Array of entries
299
+ */
300
+
301
+function getDirEntries($dir, $foldersOnly=false) {
302
+
303
+	global $localbrowser, $allowed_exts, $vbox;
304
+
305
+	// Append trailing slash if it isn't here
306
+	if(substr($dir,-1) != DSEP)
307
+	    $dir .= DSEP;
308
+
309
+
310
+    /*
311
+     * Use local file / folder browser (PHP)
312
+     */
313
+	if($localbrowser) {
314
+
315
+		// If the dir doesn't exist or we can't scan it, just return
316
+		if(!(file_exists($dir) && ($ents = @scandir($dir))))
317
+			return array();
318
+
319
+		$newtypes = array();
320
+		$newents = array();
321
+		for($i = 0; $i < count($ents); $i++) {
322
+
323
+			// Skip . and ..
324
+			if($ents[$i] == '.' || $ents[$i] == '..')
325
+				continue;
326
+
327
+			$fullpath = $dir.$ents[$i];
328
+			$isdir = @is_dir($fullpath);
329
+
330
+			if(!$isdir && $foldersOnly)
331
+				continue;
332
+
333
+			array_push($newtypes, $isdir ? 'folder' : 'file');
334
+			array_push($newents, $fullpath);
335
+		}
336
+		return array_combine($newents, $newtypes);
337
+
338
+	/*
339
+	 * Use remote file / folder browser (vbox)
340
+	 */
341
+	} else {
342
+
343
+		try {
344
+
345
+
346
+		    $appl = $vbox->vbox->createAppliance();
347
+		    $vfs = $appl->createVFSExplorer('file://'.str_replace(DSEP.DSEP,DSEP,$dir));
348
+		    $progress = $vfs->update();
349
+		    $progress->waitForCompletion(-1);
350
+		    $progress->releaseRemote();
351
+		    list($ents,$types) = $vfs->entryList();
352
+		    $vfs->releaseRemote();
353
+		    $appl->releaseRemote();
354
+
355
+		} catch (Exception $e) {
356
+
357
+		    echo($e->getMessage());
358
+
359
+		    return array();
360
+
361
+		}
362
+
363
+		// Convert types to file / folder
364
+		$newtypes = array();
365
+		$newents = array();
366
+		for($i = 0; $i < count($types); $i++) {
367
+
368
+			// Skip . and ..
369
+			if($ents[$i] == '.' || $ents[$i] == '..')
370
+			    continue;
371
+
372
+			$isdir = $types[$i] == 4;
373
+
374
+			if(!$isdir && $foldersOnly)
375
+				continue;
376
+
377
+			array_push($newtypes, $isdir ? 'folder' : 'file');
378
+			array_push($newents, $dir.$ents[$i]);
379
+		}
380
+		return array_combine($newents,$newtypes);
381
+
382
+	}
383
+
384
+
385
+}

+ 117
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/language.php View File

@@ -0,0 +1,117 @@
1
+<?php
2
+/*
3
+ * Injects language translations into phpVirtualBox as a JavaScript object and
4
+ * provides interface translation logic
5
+ * Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
6
+ *
7
+ * $Id: language.php 595 2015-04-17 09:50:36Z imoore76 $
8
+ */
9
+
10
+
11
+error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
12
+
13
+require_once(dirname(__FILE__).'/lib/language.php');
14
+
15
+if(!is_object($_vbox_language)) $_vbox_language = new __vbox_language();
16
+
17
+
18
+header("Content-type: application/javascript; charset=utf-8", true);
19
+
20
+//Set no caching
21
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
22
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
23
+header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
24
+header("Pragma: no-cache");
25
+
26
+if(isset($_GET['debug']) && $_GET['debug']) {
27
+	print_r(__vbox_language::$langdata);
28
+	return;
29
+}
30
+
31
+/*
32
+ * Dump in JavaScript
33
+ */
34
+echo('var __vboxLangData = ' . json_encode(__vbox_language::$langdata) .";\n\nvar __vboxLangName = '".constant('VBOXLANG')."';\n\n");
35
+
36
+
37
+?>
38
+
39
+
40
+// Failsafe wrapper
41
+function trans(s,c,n,h) {
42
+
43
+    if(s && c && c.constructor === Array) {
44
+        o = c.shift();
45
+        n = c.shift();
46
+        h = c.shift();
47
+        c = o;
48
+    }
49
+	if(!c) c = 'VBoxGlobal';
50
+
51
+	var r = transreal(s,c,n,h);
52
+
53
+	if(typeof r != 'string') {
54
+	   // console.log('Could not translate ' + s + ' with ' + c);
55
+	   return s;
56
+	}
57
+
58
+	return r;
59
+}
60
+
61
+function transreal(w,context,number,comment) {
62
+
63
+	try {
64
+
65
+		if(__vboxLangData['contexts'][context]['messages'][w]['translation']) {
66
+
67
+			if(__vboxLangData['contexts'][context]['messages'][w]['translation']['numerusform']) {
68
+
69
+				var t = __vboxLangData['contexts'][context]['messages'][w]['translation']['numerusform'];
70
+
71
+				if(!number) number = 1;
72
+
73
+				if(number <= 1 && t[0]) return t[0];
74
+				if(number > 1 && t[1]) return t[1];
75
+				if(t[0]) return t[0];
76
+				return t[1];
77
+			}
78
+			/*
79
+			if (__vboxLangData['contexts'][context]['messages'][w] && __vboxLangData['contexts'][context]['messages'][w]['translation_attr'] && __vboxLangData['contexts'][context]['messages'][w]['translation_attr']['type'] == 'obsolete') {
80
+			   console.log(w + ' in ' + context + ' is obsolete');
81
+			}
82
+			*/
83
+			return __vboxLangData['contexts'][context]['messages'][w]['translation'];
84
+
85
+		} else if(__vboxLangData['contexts'][context]['messages'][w][0]) {
86
+
87
+			if(comment) {
88
+				for(var i in __vboxLangData['contexts'][context]['messages'][w]) {
89
+					if(__vboxLangData['contexts'][context]['messages'][w][i]['comment'] == comment) {
90
+					    /*
91
+						if (__vboxLangData['contexts'][context]['messages'][w][i]['translation_attr'] && __vboxLangData['contexts'][context]['messages'][w][i]['translation_attr']['type'] == 'obsolete') {
92
+						    console.log(w + ' ' + ' and ' + comment + ' is obsolete');
93
+			             }
94
+			             */
95
+
96
+					    return __vboxLangData['contexts'][context]['messages'][w][i]['translation'];
97
+					}
98
+				}
99
+			}
100
+			/*
101
+			if (__vboxLangData['contexts'][context]['messages'][w][0] && __vboxLangData['contexts'][context]['messages'][w][0]['translation_attr'] && __vboxLangData['contexts'][context]['messages'][w][0]['translation_attr']['type'] == 'obsolete') {
102
+			   console.log(w + ' in ' + context + ' is obsolete');
103
+			}
104
+			*/
105
+
106
+			return __vboxLangData['contexts'][context]['messages'][w][0]['translation'];
107
+
108
+		} else {
109
+			return w;
110
+		}
111
+
112
+	} catch(err) {
113
+		// console.log(w + ' - ' + context + ': ' + err);
114
+		return w;
115
+	}
116
+}
117
+

+ 203
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/ActiveDirectory.php View File

@@ -0,0 +1,203 @@
1
+<?php
2
+/*
3
+ * $Id: ActiveDirectory.php 501 2013-07-11 17:44:37Z imooreyahoo@gmail.com $
4
+* Experimental!
5
+*/
6
+class phpvbAuthActiveDirectory implements phpvbAuth {
7
+
8
+	var $capabilities = array(
9
+		'canChangePassword' => false,
10
+		'canLogout' => true
11
+	);
12
+
13
+	var $config = array(
14
+		'host' => '127.0.0.1',
15
+		'admin_group' => null,
16
+		'adminUser' => null,
17
+		'user_group' => null,
18
+		'container' => 'CN=Users',
19
+		'domain' =>   'internal.local',
20
+		'filter' => '(&(objectclass=User)(objectCategory=Person))'
21
+	);
22
+
23
+	/**
24
+	 * Constructor
25
+	 * @param array $userConfig - user configuration for this module
26
+	 */
27
+	function phpvbAuthActiveDirectory($userConfig = null) {
28
+		// Merge user config
29
+		if($userConfig) {
30
+			$this->config = array_merge($this->config,$userConfig);
31
+		}		
32
+	}
33
+
34
+	/**
35
+	 * Test log in and set $_SESSION vars
36
+	 * @param string $username
37
+	 * @param string $password
38
+	 * @see phpvbAuth::login()
39
+	 */
40
+	function login($username, $password)
41
+	{
42
+		global $_SESSION;
43
+
44
+
45
+		/*
46
+		 * Check for LDAP functionality and provide some direction
47
+		 */
48
+		if(!function_exists('ldap_connect')) {
49
+
50
+			$ex = 'LDAP support is not enabled in your PHP configuration.';
51
+
52
+			if(strtolower(substr(PHP_OS, 0, 3)) == 'win') {
53
+
54
+				ob_start();
55
+				phpinfo(INFO_GENERAL);
56
+				$phpinfo = ob_get_contents();
57
+				ob_end_clean();
58
+				preg_match('/Loaded Configuration File <\/td><td.*?>(.*?)\s*</', $phpinfo, $phpinfo);
59
+
60
+				$ex .= ' You probably just need to uncomment the line ;extension=php_ldap.dll in php.ini'.
61
+						(count($phpinfo) > 1 ? ' (' .trim($phpinfo[1]).')' : '') . ' by removing the ";" and restart your web server.';
62
+
63
+			} else if(strtolower(substr(PHP_OS, 0, 5)) == 'Linux') {
64
+
65
+				$ex .= ' You probably need to install the php5-ldap (or similar depending on your distribution) package and restart your web server.';
66
+					
67
+			}
68
+			throw new Exception($ex);
69
+		}
70
+
71
+		$_SESSION['valid'] = false;
72
+
73
+		// Connect to server
74
+		if(!($auth = ldap_connect($this->config['host']))) {
75
+			throw new Exception('Active Directory error ('.ldap_errno($auth).') ' . ldap_error($auth));
76
+		}
77
+
78
+		// Set relevant LDAP options
79
+		ldap_set_option($auth,LDAP_OPT_PROTOCOL_VERSION, 3);
80
+		
81
+
82
+		// Main login /bind
83
+		if(!($bind = @ldap_bind($auth, $username . "@" .$this->config['domain'], $password))) {
84
+			if(ldap_errno($auth) == 49) return false;
85
+			throw new Exception('Active Directory error ('.ldap_errno($auth).') ' . ldap_error($auth));
86
+		}
87
+		
88
+		
89
+		// Get user information from AD
90
+		////////////////////////////////////
91
+		
92
+		
93
+		// Set filter and sanitize username before sending it to AD
94
+		$filter = "(sAMAccountName=" .
95
+			str_replace(array(',','=','+','<','>',';','\\','"','#','(',')','*',chr(0)), '', $username) . ")";
96
+		if($this->config['filter'] && false) {
97
+			$filter = '(&'. $this->config['filter'] .' ('. $filter .'))';
98
+		}
99
+		
100
+		$result = @ldap_search($auth,
101
+				$this->config['container'] . ',DC=' . join(',DC=', explode('.', $this->config['domain'])),
102
+				$filter, array("memberof","useraccountcontrol"));
103
+
104
+		if(!result) throw new Exception ("Unable to search Active Directory server: " . ldap_error($auth));
105
+		@list($entries) = @ldap_get_entries($auth, $result);
106
+		@ldap_unbind($auth);
107
+		if(!$entries) {
108
+			throw new Exception("Permission denied");
109
+		}
110
+		
111
+		
112
+		// Check for disabled user
113
+		if((intval($entries['useraccountcontrol'][0]) & 2)) {
114
+			throw new Exception('This account is disabled in Active Directory.');
115
+		}
116
+
117
+		// check for valid admin group
118
+		if($this->config['admin_group']) {
119
+			foreach($entries['memberof'] as $group) {
120
+				list($group) = explode(',', $group);
121
+				if(strtolower($group) == strtolower('cn='.$this->config['admin_group'])) {
122
+					$_SESSION['admin'] = $_SESSION['valid'] = true;
123
+					break;
124
+				}
125
+			}
126
+		}
127
+		
128
+		// Admin user explicitly set?
129
+		if(!$_SESSION['admin'] && $this->config['adminUser']) {
130
+			$_SESSION['admin'] = (strtolower($this->config['adminUser']) == strtolower($username));
131
+			// Admin is ok
132
+			$_SESSION['valid'] = ($_SESSION['admin'] || $_SESSION['valid']);
133
+		}
134
+
135
+		// check for valid user group
136
+		if($this->config['user_group'] && !$_SESSION['valid']) {
137
+			foreach($entries['memberof'] as $group) {
138
+				list($group) = explode(',', $group);
139
+				if(strtolower($group) == strtolower('cn='.$this->config['user_group'])) {
140
+					$_SESSION['valid'] = true;
141
+					break;
142
+				}
143
+			}
144
+		} else {
145
+			$_SESSION['valid'] = true;
146
+		}
147
+		
148
+		if(!$_SESSION['valid'])
149
+			throw new Exception("Permission denied");
150
+
151
+		// Admin user explicitly set?
152
+		if(!$_SESSION['admin'] && $this->config['adminUser']) {
153
+			$_SESSION['admin'] = (strtolower($this->config['adminUser']) == strtolower($username));
154
+		}
155
+
156
+		// No admin information specified makes everyone an admin
157
+		if(!$this->config['adminUser'] && !$this->config['admin_group'])
158
+			$_SESSION['admin'] = true;
159
+		
160
+		// user has permission. establish session variables
161
+		$_SESSION['user'] = $username;
162
+		$_SESSION['authCheckHeartbeat'] = time();
163
+
164
+		
165
+		return true;
166
+		
167
+	}
168
+
169
+	function heartbeat($vbox)
170
+	{
171
+		global $_SESSION;
172
+
173
+		$_SESSION['valid'] = true;
174
+		$_SESSION['authCheckHeartbeat'] = time();
175
+	}
176
+
177
+	function changePassword($old, $new)
178
+	{
179
+	}
180
+
181
+	function logout(&$response)
182
+	{
183
+		global $_SESSION;
184
+		if(function_exists('session_destroy')) session_destroy();
185
+		else unset($_SESSION['valid']);
186
+		$response['data']['result'] = 1;
187
+	}
188
+
189
+	function listUsers()
190
+	{
191
+
192
+	}
193
+
194
+	function updateUser($vboxRequest, $skipExistCheck)
195
+	{
196
+
197
+	}
198
+
199
+	function deleteUser($user)
200
+	{
201
+
202
+	}
203
+}

+ 202
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/Builtin.php View File

@@ -0,0 +1,202 @@
1
+<?php
2
+/**
3
+ *
4
+ * Built-in authentication module. Uses VirtualBox's set/getExtraData capability
5
+ * to store / retrieve user credentials. Called from API when authentication
6
+ * functions are requested.
7
+ *
8
+ * @author Ian Moore (imoore76 at yahoo dot com)
9
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
10
+ * @version $Id: Builtin.php 595 2015-04-17 09:50:36Z imoore76 $
11
+ * @package phpVirtualBox
12
+ * @see vboxconnector
13
+ *
14
+ */
15
+class phpvbAuthBuiltin implements phpvbAuth {
16
+
17
+	/**
18
+	 *
19
+	 * A list of capabilities describing this authentication module.
20
+	 * @var array capability values:
21
+	 * 		@var boolean canChangePassword
22
+	 * 		@var boolean canModifyUsers
23
+	 * 		@var boolean canLogout
24
+	 *
25
+	 */
26
+	var $capabilities = array(
27
+			'canChangePassword' => true,
28
+			'canModifyUsers' => true,
29
+			'canLogout' => true
30
+		);
31
+
32
+	/**
33
+	 *
34
+	 * Log in function. Populates $_SESSION
35
+	 * @param string $username user name
36
+	 * @param string $password password
37
+	 */
38
+	function login($username, $password)
39
+	{
40
+		global $_SESSION;
41
+
42
+		$vbox = new vboxconnector(true);
43
+		$vbox->skipSessionCheck = true;
44
+		$vbox->connect();
45
+		$p = $vbox->vbox->getExtraData('phpvb/users/'.$username.'/pass');
46
+
47
+		// Check for initial login
48
+		if($username == 'admin' && !$p && !$vbox->vbox->getExtraData('phpvb/usersSetup')) {
49
+			$vbox->vbox->setExtraData('phpvb/usersSetup','1');
50
+			$vbox->vbox->setExtraData('phpvb/users/'.$username.'/pass', hash('sha512', 'admin'));
51
+			$vbox->vbox->setExtraData('phpvb/users/'.$username.'/admin', '1');
52
+			$p = hash('sha512', 'admin');
53
+		}
54
+
55
+		if($p == hash('sha512', $password)) {
56
+			$_SESSION['valid'] = true;
57
+			$_SESSION['user'] = $username;
58
+			$_SESSION['admin'] = intval($vbox->vbox->getExtraData('phpvb/users/'.$username.'/admin'));
59
+			$_SESSION['authCheckHeartbeat'] = time();
60
+			$_SESSION['uHash'] = $p;
61
+		}
62
+	}
63
+
64
+	/**
65
+	 *
66
+	 * Change password function.
67
+	 * @param string $old old password
68
+	 * @param string $new new password
69
+	 * @return boolean true on success
70
+	 */
71
+	function changePassword($old, $new)
72
+	{
73
+		global $_SESSION;
74
+
75
+		// Use main / auth server
76
+		$vbox = new vboxconnector(true);
77
+		$vbox->connect();
78
+		$p = $vbox->vbox->getExtraData('phpvb/users/'.$_SESSION['user'].'/pass');
79
+
80
+		if($p == hash('sha512', $old)) {
81
+			$np = hash('sha512', $new);
82
+			$vbox->vbox->setExtraData('phpvb/users/'.$_SESSION['user'].'/pass', $np);
83
+			$response['data']['result'] = 1;
84
+			$_SESSION['uHash'] = $np;
85
+			return true;
86
+		}
87
+		return false;
88
+	}
89
+
90
+	/**
91
+	 *
92
+	 * Revalidate login info and set authCheckHeartbeat session variable.
93
+	 * @param vboxconnector $vbox vboxconnector object instance
94
+	 */
95
+	function heartbeat($vbox)
96
+	{
97
+		global $_SESSION;
98
+
99
+		// Check to see if we only have 1 server or are already connected
100
+		// to the authentication master server
101
+		if(@$vbox->settings->authMaster || count($vbox->settings->servers) == 1) {
102
+			$vbcheck = &$vbox;
103
+		} else {
104
+			$vbcheck = new vboxconnector(true);
105
+		}
106
+
107
+		$vbcheck->connect();
108
+		$p = $vbcheck->vbox->getExtraData('phpvb/users/'.$_SESSION['user'].'/pass');
109
+		if(!@$p || @$_SESSION['uHash'] != $p) {
110
+			if(function_exists('session_destroy')) session_destroy();
111
+			unset($_SESSION['valid']);
112
+		} else {
113
+			$_SESSION['admin'] = intval($vbcheck->vbox->getExtraData('phpvb/users/'.$_SESSION['user'].'/admin'));
114
+			$_SESSION['authCheckHeartbeat'] = time();
115
+		}
116
+
117
+		if(!@$_SESSION['valid'])
118
+			throw new Exception(trans('Not logged in.','UIUsers'), vboxconnector::PHPVB_ERRNO_FATAL);
119
+	}
120
+
121
+	/**
122
+	 *
123
+	 * Log out user present in $_SESSION
124
+	 * @param array $response response passed byref by API and populated within function
125
+	 */
126
+	function logout(&$response)
127
+	{
128
+		global $_SESSION;
129
+		if(function_exists('session_destroy')) session_destroy();
130
+		else unset($_SESSION['valid']);
131
+		$response['data']['result'] = 1;
132
+	}
133
+
134
+	/**
135
+	 *
136
+	 * Return a list of users
137
+	 * @return array list of users
138
+	 */
139
+	function listUsers()
140
+	{
141
+		$response = array();
142
+
143
+		// Use main / auth server
144
+		$vbox = new vboxconnector(true);
145
+		$vbox->connect();
146
+
147
+		$keys = $vbox->vbox->getExtraDataKeys();
148
+		foreach($keys as $k) {
149
+			if(strpos($k,'phpvb/users/') === 0) {
150
+				$user = substr($k,12,strpos($k,'/',13)-12);
151
+				if(isset($response[$user])) continue;
152
+				$admin = intval($vbox->vbox->getExtraData('phpvb/users/'.$user.'/admin'));
153
+				$response[$user] = array('username'=>$user,'admin'=>$admin);
154
+			}
155
+		}
156
+		return $response;
157
+	}
158
+
159
+	/**
160
+	 *
161
+	 * Update user information such as password and admin status
162
+	 * @param array $vboxRequest request passed from API representing the request. Contains user, password and administration level.
163
+	 * @param boolean $skipExistCheck Do not check that the user exists first. Essentially, if this is set and the user does not exist, it is added.
164
+	 */
165
+	function updateUser($vboxRequest, $skipExistCheck)
166
+	{
167
+		global $_SESSION;
168
+
169
+		// Must be an admin
170
+		if(!$_SESSION['admin'])
171
+		    return;
172
+
173
+		// Use main / auth server
174
+		$vbox = new vboxconnector(true);
175
+		$vbox->connect();
176
+
177
+		// See if it exists
178
+		if(!$skipExistCheck && $vbox->vbox->getExtraData('phpvb/users/'.$vboxRequest['u'].'/pass'))
179
+			return;
180
+
181
+		if($vboxRequest['p'])
182
+			$vbox->vbox->setExtraData('phpvb/users/'.$vboxRequest['u'].'/pass', hash('sha512', $vboxRequest['p']));
183
+
184
+		$vbox->vbox->setExtraData('phpvb/users/'.$vboxRequest['u'].'/admin', ($vboxRequest['a'] ? '1' : '0'));
185
+	}
186
+
187
+	/**
188
+	 *
189
+	 * Remove the user $user
190
+	 * @param string $user Username to remove
191
+	 */
192
+	function deleteUser($user)
193
+	{
194
+		// Use main / auth server
195
+		$vbox = new vboxconnector(true);
196
+		$vbox->connect();
197
+
198
+		$vbox->vbox->setExtraData('phpvb/users/'.$user.'/pass','');
199
+		$vbox->vbox->setExtraData('phpvb/users/'.$user.'/admin','');
200
+		$vbox->vbox->setExtraData('phpvb/users/'.$user,'');
201
+	}
202
+}

+ 105
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/LDAP.php View File

@@ -0,0 +1,105 @@
1
+<?php
2
+/*
3
+ * $Id: LDAP.php 501 2013-07-11 17:44:37Z imooreyahoo@gmail.com $
4
+ * Experimental!
5
+ */
6
+
7
+
8
+class phpvbAuthLDAP implements phpvbAuth {
9
+	
10
+	var $capabilities = array(
11
+		'canChangePassword' => false,
12
+		'canLogout' => true
13
+	);
14
+	
15
+	var $config = array(
16
+		'host' => '127.0.0.1', // LDAP server ip
17
+		'bind_dn' => 'uid=%s, ou=admins, dc=internal, dc=local', // %s will be replaced with login username
18
+		'adminUser' => ''
19
+	);
20
+	
21
+	function phpvbAuthLDAP($userConfig = null) {
22
+		if($userConfig) $this->config = array_merge($this->config,$userConfig);
23
+	}
24
+	
25
+	function login($username, $password)
26
+	{
27
+		global $_SESSION;
28
+		
29
+		// Check for LDAP functions
30
+		if(!function_exists('ldap_connect')) {
31
+			
32
+			$ex = 'LDAP support is not enabled in your PHP configuration.';
33
+			
34
+			if(strtolower(substr(PHP_OS, 0, 3)) == 'win') {
35
+				
36
+				ob_start();
37
+				phpinfo(INFO_GENERAL);
38
+				$phpinfo = ob_get_contents();
39
+				ob_end_clean();
40
+				preg_match('/Loaded Configuration File <\/td><td.*?>(.*?)\s*</', $phpinfo, $phpinfo);
41
+				
42
+				$ex .= ' You probably just need to uncomment the line ;extension=php_ldap.dll in php.ini'. 
43
+					(count($phpinfo) > 1 ? ' (' .trim($phpinfo[1]).')' : '') . ' by removing the ";" and restart your web server.';
44
+				
45
+			} else if(strtolower(substr(PHP_OS, 0, 5)) == 'Linux') {
46
+				
47
+				$ex .= ' You probably need to install the php5-ldap (or similar depending on your distribution) package.';	
48
+			
49
+			}
50
+			throw new Exception($ex);
51
+		}
52
+
53
+		$auth = ldap_connect($this->config['host']);
54
+		
55
+		if(!$auth) return false;
56
+		
57
+		ldap_set_option($auth,LDAP_OPT_PROTOCOL_VERSION, 3);
58
+		
59
+		if(!@ldap_bind($auth, sprintf($this->config['bind_dn'], $username), $password))
60
+			return false;
61
+		
62
+		
63
+		$_SESSION['valid'] = true;
64
+		$_SESSION['user'] = $username;
65
+		$_SESSION['admin'] = (!$this->config['adminUser']) || ($_SESSION['user'] == $this->config['adminUser']);
66
+		$_SESSION['authCheckHeartbeat'] = time();
67
+		
68
+	}
69
+	
70
+	
71
+	function heartbeat($vbox)
72
+	{
73
+		global $_SESSION;
74
+
75
+		$_SESSION['valid'] = true;
76
+		$_SESSION['authCheckHeartbeat'] = time();
77
+	}
78
+	
79
+	function changePassword($old, $new)
80
+	{
81
+	}
82
+	
83
+	function logout(&$response)
84
+	{
85
+		global $_SESSION;
86
+		if(function_exists('session_destroy')) session_destroy();
87
+		else unset($_SESSION['valid']);
88
+		$response['data']['result'] = 1;
89
+	}
90
+	
91
+	function listUsers()
92
+	{
93
+		
94
+	}
95
+	
96
+	function updateUser($vboxRequest, $skipExistCheck)
97
+	{
98
+		
99
+	}
100
+	
101
+	function deleteUser($user)
102
+	{
103
+		
104
+	}
105
+}

+ 115
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/OpenMediaVault.php View File

@@ -0,0 +1,115 @@
1
+<?php
2
+/*
3
+ * $Id: OpenMediaVault.php 470 2012-10-24 21:43:25Z imooreyahoo@gmail.com $
4
+*/
5
+
6
+/*
7
+ * OMV Specific
8
+*/
9
+try {
10
+
11
+	// Must be made global or OMV breaks 
12
+	global $xmlConfig, $OMV_DEFAULT_FILE;
13
+
14
+	require_once("openmediavault/globals.inc");
15
+	require_once("openmediavault/session.inc");
16
+	require_once("rpc/authentication.inc");
17
+
18
+} catch(Exception $e) {
19
+
20
+	header("Content-Type: text/html");
21
+	die("Error #".$e->getCode().":<br/>". str_replace("\n", "<br/>",$e->__toString()));
22
+}
23
+
24
+class phpvbAuthOpenMediaVault implements phpvbAuth {
25
+
26
+	static $session = null;
27
+	
28
+	var $capabilities = array(
29
+		'canChangePassword' => false,
30
+		'sessionStart' => 'sessionStart',
31
+		'canLogout' => true
32
+	);
33
+
34
+	var $config = array(
35
+		'allowNonAdmin' => false
36
+	);
37
+
38
+	function __construct($userConfig = null) {
39
+		if($userConfig) $this->config = array_merge($this->config,$userConfig);
40
+	}
41
+
42
+	function login($username, $password)
43
+	{
44
+		# Try / catch so that we don't expose
45
+		# usernames / passwords
46
+		require_once("rpc/authentication.inc");
47
+		$a = new AuthenticationRpc();
48
+		try {
49
+			
50
+			$auth = $a->login(array('username'=>$username,'password'=>$password));
51
+			
52
+			self::$session = &OMVSession::getInstance();
53
+			
54
+			if(@$auth["authenticated"] &&
55
+			(self::$session->getRole() !== OMV_ROLE_USER || $this->config['allowNonAdmin'])) {
56
+				$_SESSION['admin'] = (self::$session->getRole() !== OMV_ROLE_USER);
57
+				$_SESSION['user'] = $_SESSION['username'];
58
+				$_SESSION['valid'] = ($_SESSION['admin'] || $this->config['allowNonAdmin']);
59
+				$_SESSION['authCheckHeartbeat'] = time();
60
+	
61
+			}
62
+	
63
+			if(!@$_SESSION['valid']) {
64
+				return false;
65
+			}
66
+			return true;
67
+	
68
+		} catch (Exception $e) {
69
+			return false;
70
+		}
71
+		return false;
72
+	}
73
+	
74
+	function sessionStart($keepopen) {
75
+		
76
+		self::$session = &OMVSession::getInstance();
77
+		self::$session->start();
78
+		
79
+
80
+		if (self::$session->isAuthenticated() && !self::$session->isTimeout()) {
81
+			
82
+			self::$session->validate();
83
+			self::$session->updateLastAccess();
84
+			
85
+			$_SESSION['admin'] = (self::$session->getRole() !== OMV_ROLE_USER);
86
+			$_SESSION['user'] = $_SESSION['username'];
87
+			$_SESSION['valid'] = (self::$session->getRole() !== OMV_ROLE_USER || $this->config['allowNonAdmin']);
88
+			
89
+		} else {
90
+			
91
+			$_SESSION['admin'] = $_SESSION['user'] = $_SESSION['valid'] = null;
92
+			
93
+		}
94
+
95
+		if(!$keepopen)
96
+			session_write_close();
97
+
98
+	}
99
+
100
+
101
+	function logout(&$response)
102
+	{
103
+		require_once("rpc/authentication.inc");
104
+		$a = new AuthenticationRpc();
105
+		$a->logout();
106
+		$response['data']['result'] = 1;
107
+	}
108
+
109
+	/* Defined for compatibility with implemented interface */
110
+	function heartbeat($vbox){}
111
+	function changePassword($old, $new){}
112
+	function listUsers(){}
113
+	function updateUser($vboxRequest, $skipExistCheck){}
114
+	function deleteUser($user){}
115
+}

+ 75
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/WebAuth.php View File

@@ -0,0 +1,75 @@
1
+<?php
2
+/*
3
+ * $Id: WebAuth.php 470 2012-10-24 21:43:25Z imooreyahoo@gmail.com $
4
+ */
5
+
6
+class phpvbAuthWebAuth implements phpvbAuth {
7
+	
8
+	var $capabilities = array(
9
+			'canChangePassword' => false,
10
+			'canLogout' => false
11
+		);
12
+	
13
+	var $config = array(
14
+		'serverUserKey' => 'REMOTE_USER'
15
+	);
16
+	
17
+	function phpvbAuthWebAuth($userConfig = null) {
18
+		if($userConfig) $this->config = array_merge($this->config,$userConfig);
19
+	}
20
+	
21
+	function login($username, $password)
22
+	{
23
+	}
24
+	
25
+	function autoLoginHook()
26
+	{
27
+		global $_SESSION;
28
+		// WebAuth passthrough
29
+		if ( isset($_SERVER[$this->config['serverUserKey']]) )
30
+		{
31
+			$_SESSION['valid'] = true;
32
+			$_SESSION['user'] = $_SERVER[$this->config['serverUserKey']];
33
+			$_SESSION['admin'] = (!$this->config['adminUser']) || ($_SESSION['user'] == $this->config['adminUser']);
34
+			$_SESSION['authCheckHeartbeat'] = time();			
35
+		}
36
+	}
37
+	
38
+	function heartbeat($vbox)
39
+	{
40
+		global $_SESSION;
41
+		if ( isset($_SERVER[$this->config['serverUserKey']]) )
42
+		{
43
+			$_SESSION['valid'] = true;
44
+			$_SESSION['authCheckHeartbeat'] = time();
45
+		}
46
+	}
47
+	
48
+	function changePassword($old, $new)
49
+	{
50
+	}
51
+	
52
+	function logout(&$response)
53
+	{
54
+		$response['data']['result'] = 1;
55
+		if ( isset($this->config['logoutURL']) )
56
+		{
57
+			$response['data']['url'] = $this->config['logoutURL'];
58
+		}
59
+	}
60
+	
61
+	function listUsers()
62
+	{
63
+		
64
+	}
65
+	
66
+	function updateUser($vboxRequest, $skipExistCheck)
67
+	{
68
+		
69
+	}
70
+	
71
+	function deleteUser($user)
72
+	{
73
+		
74
+	}
75
+}

+ 0
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/auth/index.html View File


+ 107
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/authinterface.php View File

@@ -0,0 +1,107 @@
1
+<?php
2
+/**
3
+ * Interface for phpVirtualBox authentication modules
4
+ *
5
+ * @author Ian Moore (imoore76 at yahoo dot com)
6
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
7
+ * @version $Id: authinterface.php 595 2015-04-17 09:50:36Z imoore76 $
8
+ * @package phpVirtualBox
9
+ * 
10
+ * A class wishing to implement this interface must also contain
11
+ * a list of capabilities describing its capabilities in a public
12
+ * object member array called capabilities.
13
+ * 
14
+ * boolean canChangePassword - Users can change passwords
15
+ * boolean canModifyUsers - Users can be modified
16
+ * boolean canLogout - Users can log out
17
+ * 	
18
+ * E.g.
19
+ * var $capabilities = array(
20
+ *		'canChangePassword' => true,
21
+ *		'canModifyUsers' => true,
22
+ *		'canLogout' => true
23
+ *	);
24
+ *
25
+ * The implementing class may also define a public autoLoginHook
26
+ * method that auto-populates $_SESSION. This would automatically
27
+ * log the user in, bypassing the login() function.
28
+ * 
29
+ * E.g.
30
+ * 
31
+ * 	function autoLoginHook()
32
+ *	{
33
+ *		global $_SESSION;
34
+ *
35
+ *		// HTTP Authentication passthrough
36
+ *		if ( isset($_SERVER['HTTP_X_WEBAUTH_USER']) )
37
+ *		{
38
+ *			$_SESSION['valid'] = true;
39
+ *			$_SESSION['user'] = $_SERVER['HTTP_X_WEBAUTH_USER']];
40
+ *			$_SESSION['admin'] = ($_SESSION['user'] === 'bob');
41
+ *			$_SESSION['authCheckHeartbeat'] = time();
42
+ *		}
43
+ *	}
44
+ *
45
+ * Implementing classes should be prefixed with phpvbAuth. E.g.
46
+ * phpvbAuthMySiteAuth. authLib in config.php would then be set
47
+ * to 'MySiteAuth'
48
+ */
49
+interface phpvbAuth {
50
+
51
+	/**
52
+	*
53
+	* Log in function. Populates $_SESSION
54
+	* @param string $username user name
55
+	* @param string $password password
56
+	*/
57
+	function login($username, $password);
58
+	
59
+	/**
60
+	*
61
+	* Change password function.
62
+	* @param string $old old password
63
+	* @param string $new new password
64
+	* @return boolean true on success
65
+	*/
66
+	function changePassword($old, $new);
67
+	
68
+	/**
69
+	*
70
+	* Revalidate login info and set authCheckHeartbeat session variable.
71
+	* @param vboxconnector $vbox vboxconnector object instance
72
+	*/
73
+	function heartbeat($vbox);
74
+	
75
+	/**
76
+	*
77
+	* Log out user present in $_SESSION
78
+	* @param array $response response passed byref by API and populated within function
79
+	*/
80
+	function logout(&$response);
81
+	
82
+	/**
83
+	*
84
+	* Return a list of users
85
+	* @return array list of users
86
+	*/
87
+	function listUsers();
88
+	
89
+	/**
90
+	*
91
+	* Update user information such as password and admin status
92
+	* @param array $vboxRequest request passed from API representing the ajax request. Contains user, password and administration level.
93
+	* @param boolean $skipExistCheck Do not check that the user exists first. Essentially, if this is set and the user does not exist, it is added.
94
+	*/
95
+	function updateUser($vboxRequest, $skipExistCheck);
96
+	
97
+	
98
+	/**
99
+	*
100
+	* Remove the user $user
101
+	* @param string $user Username to remove
102
+	*/
103
+	function deleteUser($user);
104
+	
105
+	
106
+	
107
+}

+ 269
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/config.php View File

@@ -0,0 +1,269 @@
1
+<?php
2
+/**
3
+ * phpVirtualBox configuration class. Parses user configuration, applies
4
+ * defaults, and sanitizes user values.
5
+ *
6
+ * @author Ian Moore (imoore76 at yahoo dot com)
7
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
8
+ * @version $Id: config.php 595 2015-04-17 09:50:36Z imoore76 $
9
+ * @package phpVirtualBox
10
+ * @see config.php-example
11
+ *
12
+*/
13
+
14
+/*
15
+ * This version of phpVirtualBox
16
+ */
17
+define('PHPVBOX_VER', '5.0-5');
18
+
19
+class phpVBoxConfigClass {
20
+
21
+	/* DEFAULTS */
22
+
23
+	/**
24
+	 * Default language
25
+	 * @var string
26
+	 */
27
+	var $language = 'en';
28
+
29
+	/**
30
+	 * Exclusively use phpVirtualBox groups rather than
31
+	 * VirtualBox groups
32
+	 */
33
+	var $phpVboxGroups = false;
34
+
35
+	/**
36
+	 * Preview screen width
37
+	 * @var integer
38
+	 */
39
+	var $previewWidth = 180;
40
+
41
+	/**
42
+	 * Aspect ratio of preview screen
43
+	 * @var float
44
+	 */
45
+	var $previewAspectRatio = 1.6;
46
+
47
+	/**
48
+	 * Allow users to delete media when it is removed
49
+	 * @var boolean
50
+	 */
51
+	var $deleteOnRemove = true;
52
+
53
+	/**
54
+	 * Restrict file / folder browsers to files ending in extensions found in this array
55
+	 * @var array
56
+	 */
57
+	var $browserRestrictFiles = array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.vbox','.cdr','.dmg','.ima','.dsk','.vfd');
58
+
59
+	/**
60
+	 * Force file / folder browser to use local PHP functions rather than VirtualBox's IVFSExplorer.
61
+	 * If this is set to true, the assumption is made that the web server is on the same host as VirtualBox.
62
+	 * @var boolean
63
+	 */
64
+	var $browserLocal = false;
65
+
66
+	/**
67
+	 * List of console resolutions available on console tab
68
+	 * @var array
69
+	 */
70
+	var $consoleResolutions = array('640x480','800x600','1024x768','1280x720','1440x900');
71
+
72
+	/**
73
+	 * Maximum number of NICs displayed per VM
74
+	 * @var integer
75
+	 */
76
+	var $nicMax = 4;
77
+
78
+	/**
79
+	 * Max number of operations to keep in progress list
80
+	 * @var integer
81
+	 */
82
+	var $maxProgressList = 5;
83
+
84
+	/**
85
+	 * Enable custom icon per VM
86
+	 * @var boolean
87
+	 */
88
+	var $enableCustomIcons = false;
89
+
90
+	/**
91
+	 * true if there is no user supplied config.php found.
92
+	 * @var boolean
93
+	 */
94
+	var $warnDefault = false;
95
+
96
+	/**
97
+	 * Set the standard VRDE port number range to be used when
98
+	 * creating new VMs
99
+	 * @var string
100
+	 */
101
+	var $vrdeports = '9000-9100';
102
+
103
+	/**
104
+	 * Key used to uniquely identify the current server in this
105
+	 * instantiation of phpVBoxConfigClass.
106
+	 * Set in __construct()
107
+	 * @var string
108
+	 */
109
+	var $key = null;
110
+
111
+	/**
112
+	 * Auth library object instance. See lib/auth for classes.
113
+	 * Set in __construct() based on authLib config setting value.
114
+	 * @var phpvbAuth
115
+	 */
116
+	var $auth = null;
117
+
118
+	/**
119
+	 * Enable VirtualBox start / stop configuration.
120
+	 * Only available in Linux (I beleive)
121
+	 * @var boolean
122
+	 */
123
+	var $vboxAutostartConfig = false;
124
+
125
+	/**
126
+	 * Authentication capabilities provided by authentication module.
127
+	 * Set in __construct
128
+	 * @var phpvbAuthBuiltin::authCapabilities
129
+	 */
130
+	var $authCapabilities = null;
131
+
132
+	/**
133
+	 * Configuration passed to authentication module
134
+	 * @var array
135
+	 */
136
+	var $authConfig = array();
137
+
138
+	/**
139
+	 * Event listener timeout in seconds.
140
+	 * @var integer
141
+	 */
142
+	var $eventListenerTimeout = 20;
143
+
144
+	/**
145
+	 * Read user configuration, apply defaults, and do some sanity checking
146
+	 * @see vboxconnector
147
+	 */
148
+	function __construct() {
149
+
150
+		@include_once(dirname(dirname(dirname(__FILE__))).'/config.php');
151
+
152
+		$ep = error_reporting(0);
153
+
154
+		/* Apply object vars of configuration class to this class */
155
+		if(class_exists('phpVBoxConfig')) {
156
+			$c = new phpVBoxConfig();
157
+			foreach(get_object_vars($c) as $k => $v) {
158
+				// Safety checks
159
+				if($k == 'browserRestrictFiles' && !is_array($v)) continue;
160
+				if($k == 'consoleResolutions' && !is_array($v)) continue;
161
+				if($k == 'browserRestrictFolders' && !is_array($v)) continue;
162
+				$this->$k = $v;
163
+			}
164
+
165
+		/* User config.php does not exist. Send warning */
166
+		} else {
167
+			$this->warnDefault = true;
168
+		}
169
+
170
+		// Ignore any server settings if we have servers
171
+		// in the servers array
172
+		if(isset($this->servers) && is_array($this->servers) && count($this->servers) && is_array($this->servers[0])) {
173
+			unset($this->location);
174
+			unset($this->user);
175
+			unset($this->pass);
176
+		}
177
+		// Set to selected server based on browser cookie
178
+		if(isset($_COOKIE['vboxServer']) && isset($this->servers) && is_array($this->servers) && count($this->servers)) {
179
+			foreach($this->servers as $s) {
180
+				if($s['name'] == $_COOKIE['vboxServer']) {
181
+					foreach($s as $k=>$v) $this->$k = $v;
182
+					break;
183
+				}
184
+			}
185
+		// If servers is not an array, set to empty array
186
+		} elseif(!isset($this->servers) || !is_array($this->servers)) {
187
+			$this->servers = array();
188
+		}
189
+		// We still have no server set, use the first one from
190
+		// the servers array
191
+		if(empty($this->location) && count($this->servers)) {
192
+			foreach($this->servers[0] as $k=>$v) $this->$k = $v;
193
+		}
194
+		// Make sure name is set
195
+		if(!isset($this->name) || !$this->name) {
196
+			$this->name = parse_url($this->location);
197
+			$this->name = $this->name['host'];
198
+		}
199
+
200
+		// Key used to uniquely identify this server in this
201
+		// phpvirtualbox installation
202
+		$this->setKey();
203
+
204
+		// legacy rdpHost setting
205
+		if(!empty($this->rdpHost) && empty($this->consoleHost))
206
+			$this->consoleHost = $this->rdpHost;
207
+
208
+		// Ensure authlib is set
209
+		if(empty($this->authLib)) $this->authLib = 'Builtin';
210
+		// include interface
211
+		include_once(dirname(__FILE__).'/authinterface.php');
212
+		include_once(dirname(__FILE__).'/auth/'.str_replace(array('.','/','\\'),'',$this->authLib).'.php');
213
+
214
+		// Check for session functionality
215
+		if(!function_exists('session_start')) $this->noAuth = true;
216
+
217
+		$alib = "phpvbAuth{$this->authLib}";
218
+		$this->auth = new $alib(@$this->authConfig);
219
+		$this->authCapabilities = $this->auth->capabilities;
220
+
221
+		/* Sanity checks */
222
+		if(!@$this->nicMax)
223
+			$this->nicMax = 4;
224
+
225
+		$this->previewUpdateInterval = max(3, @$this->previewUpdateInterval);
226
+
227
+		error_reporting($ep);
228
+	}
229
+
230
+	/**
231
+	 * Set VirtualBox server to use
232
+	 * @param string $server server from config.php $servers array
233
+	 */
234
+	function setServer($server) {
235
+		// do nothing if we are already using this server
236
+		if($server == $this->name) return;
237
+		foreach($this->servers as $s) {
238
+			if($s['name'] == $server) {
239
+				foreach($s as $k=>$v) $this->$k = $v;
240
+				$this->setKey();
241
+				break;
242
+			}
243
+		}
244
+	}
245
+
246
+	/**
247
+	 * Generate a key for current server settings and populate $this->key
248
+	 */
249
+	function setKey() {
250
+		$this->key = md5($this->location);
251
+	}
252
+
253
+	/**
254
+	 * Return the name of the server marked as the authentication master
255
+	 * @return string name of server marked as authMaster
256
+	 */
257
+	function getServerAuthMaster() {
258
+		foreach($this->servers as $s) {
259
+			if($s['authMaster']) {
260
+				return $s['name'];
261
+			}
262
+		}
263
+		return @$this->servers[0]['name'];
264
+	}
265
+
266
+}
267
+
268
+
269
+

+ 0
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/index.html View File


+ 151
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/language.php View File

@@ -0,0 +1,151 @@
1
+<?php
2
+/**
3
+ * __vbox_language class and trans() function
4
+ *
5
+ * @author Ian Moore (imoore76 at yahoo dot com)
6
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
7
+ * @version $Id: language.php 591 2015-04-11 22:40:47Z imoore76 $
8
+ * @see languages/languages.txt
9
+ * @package phpVirtualBox
10
+ *
11
+ */
12
+
13
+global $_vbox_language;
14
+
15
+// Settings contains language
16
+require_once(dirname(__FILE__).'/config.php');
17
+require_once(dirname(__FILE__).'/utils.php');
18
+
19
+define('VBOX_BASE_LANG_DIR', dirname(dirname(dirname(__FILE__))) .'/languages');
20
+
21
+/**
22
+ * Language class. Parses language file and stores translations in an array.
23
+ *
24
+ * @author Ian Moore (imoore76 at yahoo dot com)
25
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
26
+ * @version $Id: language.php 591 2015-04-11 22:40:47Z imoore76 $
27
+ * @package phpVirtualBox
28
+ *
29
+ * @global __vbox_language $GLOBALS['_vbox_language'] global __vbox_language instance
30
+ * @name $_vbox_language
31
+*/
32
+class __vbox_language {
33
+
34
+	/**
35
+	 * Static language data used for translations
36
+	 * @var array
37
+	 */
38
+	static $langdata = null;
39
+
40
+	/**
41
+	 *
42
+	 * Constructor parses language file and stores translations.
43
+	 */
44
+	function __construct() {
45
+
46
+		# Already initialized?
47
+		if(is_array(self::$langdata)) return;
48
+
49
+		self::$langdata = array();
50
+
51
+		$settings = new phpVBoxConfigClass();
52
+		$lang = strtolower($settings->language);
53
+
54
+		if(@$_COOKIE['vboxLanguage']) {
55
+			$lang = str_replace(array('/','\\','.'),'',$_COOKIE['vboxLanguage']);
56
+		}
57
+
58
+		// File as specified
59
+		if($lang && file_exists(VBOX_BASE_LANG_DIR.'/source/'.$lang.'.dat')) {
60
+			@define('VBOXLANG', $lang);
61
+
62
+		// No lang file found
63
+		} else {
64
+			$lang = 'en';
65
+			@define('VBOXLANG', $lang);
66
+			self::$langdata['contexts'] = array();
67
+			return;
68
+		}
69
+
70
+
71
+		self::$langdata = unserialize(@file_get_contents(VBOX_BASE_LANG_DIR.'/source/'.$lang.'.dat'));
72
+
73
+		$xmlObj = simplexml_load_string(@file_get_contents(VBOX_BASE_LANG_DIR.'/'.$lang.'.xml'));
74
+		$arrXml = $this->objectsIntoArray($xmlObj);
75
+
76
+		$lang = array();
77
+		if(!@$arrXml['context'][0]) $arrXml['context'] = array($arrXml['context']);
78
+		foreach($arrXml['context'] as $c) {
79
+
80
+			if(!is_array($c) || !@$c['name']) continue;
81
+			if(!@$c['message'][0]) $c['message'] = array($c['message']);
82
+
83
+		   	$lang['contexts'][$c['name']] = array();
84
+		   	$lang['contexts'][$c['name']]['messages'] = array();
85
+
86
+			foreach($c['message'] as $m) {
87
+
88
+		       if(!is_array($m)) continue;
89
+
90
+		       $s = $m['source'];
91
+		       unset($m['source']);
92
+		       $lang['contexts'][$c['name']]['messages'][$s] = $m;
93
+	    	}
94
+		}
95
+		self::$langdata = array_merge_recursive(self::$langdata, $lang);
96
+	}
97
+
98
+	/**
99
+	 * Translate text.
100
+	 * @param string $item message to translate
101
+	 * @param string $context context in which the translation should be performed
102
+	 */
103
+	function trans($item,$context='phpVirtualBox') {
104
+		$t = @self::$langdata['contexts'][$context]['messages'][$item]['translation'];
105
+		return ($t ? $t : $item);
106
+	}
107
+
108
+	/**
109
+	 *
110
+	 * Converts objects into array. Called from class constructor.
111
+	 * @param array|object $arrObjData object or array to convert to array
112
+	 * @param array $arrSkipIndices array of indices to skip
113
+	 * @return array
114
+	 */
115
+	function objectsIntoArray($arrObjData, $arrSkipIndices = array())
116
+	{
117
+	    $arrData = array();
118
+
119
+	    // if input is object, convert into array
120
+	    if (is_object($arrObjData)) {
121
+	        $arrObjData = get_object_vars($arrObjData);
122
+	    }
123
+
124
+	    if (is_array($arrObjData)) {
125
+	        foreach ($arrObjData as $index => $value) {
126
+	            if (is_object($value) || is_array($value)) {
127
+	                $value = $this->objectsIntoArray($value, $arrSkipIndices); // recursive call
128
+	            }
129
+	            if (in_array($index, $arrSkipIndices)) {
130
+	                continue;
131
+	            }
132
+	            $arrData[$index] = $value;
133
+	        }
134
+	    }
135
+	    return $arrData;
136
+	}
137
+
138
+}
139
+
140
+/**
141
+ * Translate text. If $GLOBALS['_vbox_language'] is not set, create a new
142
+ * instance and pass params to its trans() method
143
+ * @param string $msg message to translate
144
+ * @param string $context context in which the translation should be performed
145
+ * @uses $_vbox_language
146
+ * @return string
147
+ */
148
+function trans($msg,$context='phpVirtualBox') {
149
+	if(!is_object($GLOBALS['_vbox_language'])) $GLOBALS['_vbox_language'] = new __vbox_language();
150
+	return $GLOBALS['_vbox_language']->trans($msg,$context);
151
+}

+ 95
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/utils.php View File

@@ -0,0 +1,95 @@
1
+<?php
2
+/**
3
+ * Common PHP utilities.
4
+ *
5
+ * @author Ian Moore (imoore76 at yahoo dot com)
6
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
7
+ * @version $Id: utils.php 592 2015-04-12 19:53:44Z imoore76 $
8
+ * @see phpVBoxConfigClass
9
+ * @package phpVirtualBox
10
+ *
11
+*/
12
+
13
+require_once(dirname(__FILE__).'/config.php');
14
+
15
+/**
16
+ * Initialize session.
17
+ * @param boolean $keepopen keep session open? The default is
18
+ * 			to close the session after $_SESSION has been populated.
19
+ * @uses $_SESSION
20
+ */
21
+function session_init($keepopen = false) {
22
+
23
+	$settings = new phpVBoxConfigClass();
24
+
25
+	// Sessions provided by auth module?
26
+	if(@$settings->auth->capabilities['sessionStart']) {
27
+		call_user_func(array($settings->auth, $settings->auth->capabilities['sessionStart']), $keepopen);
28
+		return;
29
+	}
30
+
31
+	// No session support? No login...
32
+	if(@$settings->noAuth || !function_exists('session_start')) {
33
+		global $_SESSION;
34
+		$_SESSION['valid'] = true;
35
+		$_SESSION['authCheckHeartbeat'] = time();
36
+		$_SESSION['admin'] = true;
37
+		return;
38
+	}
39
+
40
+	// Session not is auto-started by PHP
41
+	if(!ini_get('session.auto_start')) {
42
+
43
+		ini_set('session.use_trans_sid', 0);
44
+		ini_set('session.use_only_cookies', 1);
45
+
46
+		// Session path
47
+		if(isset($settings->sessionSavePath)) {
48
+			session_save_path($settings->sessionSavePath);
49
+		}
50
+
51
+		if(isset($settings->session_name)) {
52
+		    $session_name = $settings->session_name;
53
+		} else {
54
+		    $session_name = md5($_SERVER['DOCUMENT_ROOT'].$_SERVER['HTTP_USER_AGENT'].dirname(__FILE__));
55
+		}
56
+		session_name($session_name);
57
+		session_start();
58
+	}
59
+
60
+	if(!$keepopen)
61
+		session_write_close();
62
+
63
+}
64
+
65
+
66
+/**
67
+ * Clean (strip slashes from if applicable) $_GET and $_POST and return
68
+ * an array containing a merged array of both.
69
+ * @return array
70
+ */
71
+function clean_request() {
72
+
73
+	if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
74
+	   $json = json_decode(file_get_contents('php://input'), true);
75
+	   if(!is_array($json))
76
+	   	   $json = array();
77
+	} else {
78
+		$json = array();
79
+	}
80
+	$req = array_merge_recursive($_GET, $_POST);
81
+	return array_merge_recursive($req, $json);
82
+
83
+}
84
+
85
+if(!function_exists('hash')) {
86
+// Lower security, but better than nothing
87
+/**
88
+ * Return a hash of the passed string. Mimmics PHP's hash() params
89
+ * @param unused $type
90
+ * @param string $str string to hash
91
+ */
92
+function hash($type,$str='') {
93
+	return sha1(json_encode($str));
94
+}
95
+}

+ 16737
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxServiceWrappers.php
File diff suppressed because it is too large
View File


+ 5828
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxconnector.php
File diff suppressed because it is too large
View File


+ 58555
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxweb-5.0.wsdl
File diff suppressed because it is too large
View File


+ 14
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/lib/vboxwebService-5.0.wsdl View File

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<!--
3
+  DO NOT EDIT! This is a generated file.
4
+  Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's generic pseudo-IDL file)
5
+  Generator: src/VBox/Main/webservice/websrv-wsdl-service.xsl
6
+-->
7
+<definitions xmlns:interface="urn:vbox" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:vbox="http://www.virtualbox.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="VirtualBox" targetNamespace="http://www.virtualbox.org/Service">
8
+  <import location="vboxweb-5.0.wsdl" namespace="http://www.virtualbox.org/"/>
9
+  <service name="vboxService">
10
+    <port binding="vbox:vboxBinding" name="vboxServicePort">
11
+      <soap:address location="http://localhost:18083/"/>
12
+    </port>
13
+  </service>
14
+</definitions>

+ 32
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/rdp.php View File

@@ -0,0 +1,32 @@
1
+<?php
2
+/**
3
+ * Simple RDP connection file generator
4
+ *
5
+ * @author Ian Moore (imoore76 at yahoo dot com)
6
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
7
+ * @version $Id: rdp.php 591 2015-04-11 22:40:47Z imoore76 $
8
+ * @package phpVirtualBox
9
+ *
10
+ */
11
+
12
+# Turn off PHP notices
13
+error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
14
+
15
+require_once(dirname(__FILE__).'/lib/utils.php');
16
+$_GET = clean_request();
17
+
18
+foreach(array('port','host','vm') as $g) {
19
+	@$_GET[$g] = str_replace(array("\n","\r","\0"),'',@$_GET[$g]);
20
+}
21
+
22
+
23
+header("Content-type: application/x-rdp",true);
24
+header("Content-disposition: attachment; filename=\"". str_replace(array('"','.'),'_',$_GET['vm']) .".rdp\"",true);
25
+
26
+
27
+echo('
28
+full address:s:'.@$_GET['host'].(@$_GET['port'] ? ':'.@$_GET['port'] : '').'
29
+compression:i:1
30
+displayconnectionbar:i:1
31
+protocol:i:4
32
+');

+ 224
- 0
phpvirtualbox/phpvirtualbox-5.0-5/endpoints/screen.php View File

@@ -0,0 +1,224 @@
1
+<?php
2
+/**
3
+ * Virtual machine PNG screenshot generation
4
+ * 
5
+ * @author Ian Moore (imoore76 at yahoo dot com)
6
+ * @copyright Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
7
+ * @version $Id: screen.php 591 2015-04-11 22:40:47Z imoore76 $
8
+ * @package phpVirtualBox
9
+ * 
10
+ */
11
+
12
+# Turn off PHP notices
13
+error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
14
+
15
+require_once(dirname(__FILE__).'/lib/config.php');
16
+require_once(dirname(__FILE__).'/lib/utils.php');
17
+require_once(dirname(__FILE__).'/lib/vboxconnector.php');
18
+
19
+
20
+// Allow caching of some screenshot data
21
+@Header('ETag: "' . $_REQUEST['vm'].'_'.$_REQUEST['randid'].'"');
22
+session_cache_limiter('private_no_expire');
23
+
24
+// Check for valid session
25
+global $_SESSION;
26
+session_init();
27
+if(!@$_SESSION['valid']) {
28
+	return;	
29
+}
30
+
31
+// Clean request
32
+$_REQUEST = array_merge(@$_GET,@$_POST);
33
+
34
+$settings = new phpVBoxConfigClass();
35
+$vbox = new vboxconnector();
36
+$vbox->connect();
37
+
38
+// Set width. Else assume we want real time updates if VM is running below
39
+if($_REQUEST['width']) {
40
+	$force_width = $_REQUEST['width'];
41
+}
42
+
43
+try {
44
+
45
+	// Is VM Specified
46
+	if(!$_REQUEST['vm']) {
47
+		echo("Please specify a VM to take a screen shot of. E.g. http://webserver/phpvirtualbox/screen.php?vm=VMName");
48
+		exit;
49
+	}
50
+
51
+	$machine = $vbox->vbox->findMachine($_REQUEST['vm']);
52
+	
53
+	// Is snapshot specified?
54
+	if($_REQUEST['snapshot']) {
55
+		
56
+		$snapshot = $machine->findSnapshot($_REQUEST['snapshot']);
57
+		$machine->releaseRemote();
58
+		$machine = &$snapshot->machine;
59
+		
60
+	} else {
61
+
62
+		// Get machine state
63
+		switch($machine->state->__toString()) {
64
+			case 'Running':
65
+			case 'Saved':
66
+			case 'Restoring':
67
+				break;
68
+			default:
69
+				$machine->releaseRemote();
70
+				throw new Exception('The specified virtual machine is not in a Running state.');
71
+		}
72
+
73
+	}
74
+	
75
+	// Date last modified
76
+	$dlm = floor($machine->lastStateChange/1000);
77
+
78
+	// Set last modified header
79
+	header("Last-Modified: " . gmdate("D, d M Y H:i:s", $dlm) . " GMT");
80
+
81
+	$_REQUEST['vm'] = $machine->id;
82
+
83
+
84
+
85
+	// Take active screenshot if machine is running
86
+	if(!$_REQUEST['snapshot'] && $machine->state->__toString() == 'Running') {
87
+
88
+		// Let the browser cache images for 3 seconds
89
+		$ctime = 0;
90
+		if(strpos($_SERVER['HTTP_IF_NONE_MATCH'],'_')) {
91
+			$ctime = preg_replace("/.*_/",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH']));
92
+		} else if(strpos($_ENV['HTTP_IF_NONE_MATCH'],'_')) {
93
+			$ctime = preg_replace("/.*_/",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH']));
94
+		} else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'],'GMT')) {
95
+			$ctime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
96
+		} else if(strpos($_ENV['HTTP_IF_MODIFIED_SINCE'],'GMT')) {
97
+			$ctime = strtotime($_ENV['HTTP_IF_MODIFIED_SINCE']);
98
+		}
99
+		
100
+    	if($ctime >= (time()-3)) {
101
+			if (strpos(strtolower(php_sapi_name()),'cgi') !== false) {
102
+				Header("Status: 304 Not Modified");
103
+			} else {
104
+				Header("HTTP/1.0 304 Not Modified");
105
+			}
106
+      		exit;
107
+    	}
108
+		
109
+
110
+    	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
111
+    	
112
+		$vbox->session = $vbox->websessionManager->getSessionObject($vbox->vbox->handle);
113
+		$machine->lockMachine($vbox->session->handle,'Shared');
114
+		$machine->releaseRemote();
115
+		
116
+		
117
+		$res = $vbox->session->console->display->getScreenResolution(0);
118
+		
119
+		$screenWidth = array_shift($res);
120
+	    $screenHeight = array_shift($res);
121
+	    
122
+
123
+	    // Force screenshot width while maintaining aspect ratio
124
+	    if($force_width) {
125
+
126
+			$factor  = (float)$force_width / (float)$screenWidth;
127
+
128
+			$screenWidth = $force_width;
129
+			if($factor > 0) {
130
+				$screenHeight = $factor * $screenHeight;
131
+			} else {
132
+				$screenHeight = ($screenWidth * 9.0/16.0);
133
+			}
134
+
135
+		// If no width is set, we were reached from Open in New Window
136
+	    } else if(!$_REQUEST['width']) {
137
+
138
+			//Set no caching
139
+			header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
140
+			header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
141
+			header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
142
+			
143
+	    }
144
+
145
+	    // If we were unable to get screen dimensions, set it to something
146
+	    if(!$screenWidth || !$screenHeight) {
147
+	    	$screenWidth = 640;
148
+	    	$screenHeight = 480;
149
+	    }
150
+		// array() for compatibility with readSavedScreenshotPNGToArray return value
151
+		try {
152
+			$imageraw = array($vbox->session->console->display->takeScreenShotToArray(0, $screenWidth, $screenHeight, 'PNG'));
153
+		} catch (Exception $e) {
154
+			// For some reason this is required or you get "Could not take a screenshot (VERR_TRY_AGAIN)" in some cases.
155
+			// I think it's a bug in the Linux guest additions, but cannot prove it.
156
+			$vbox->session->console->display->invalidateAndUpdate();
157
+			$imageraw = array($vbox->session->console->display->takeScreenShotToArray(0, $screenWidth, $screenHeight, 'PNG'));
158
+		}
159
+
160
+		$vbox->session->unlockMachine();
161
+		$vbox->session->releaseRemote();
162
+		
163
+	} else {
164
+
165
+		// Let the browser cache saved state images
166
+		$ctime = 0;
167
+		if(strpos($_SERVER['HTTP_IF_NONE_MATCH'],'_')) {
168
+			$ctime = preg_replace("/.*_/",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH']));
169
+		} else if(strpos($_ENV['HTTP_IF_NONE_MATCH'],'_')) {
170
+			$ctime = preg_replace("/.*_/",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH']));
171
+		} else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'],'GMT')) {
172
+			$ctime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
173
+		} else if(strpos($_ENV['HTTP_IF_MODIFIED_SINCE'],'GMT')) {
174
+			$ctime = strtotime($_ENV['HTTP_IF_MODIFIED_SINCE']);
175
+		}
176
+		
177
+    	if($dlm <= $ctime) {
178
+			if (strpos(strtolower(php_sapi_name()),'cgi') !== false) {
179
+				Header("Status: 304 Not Modified");
180
+			} else {
181
+				Header("HTTP/1.0 304 Not Modified");
182
+			}
183
+      		exit;
184
+    	}
185
+		
186
+	
187
+    	if($_REQUEST['full']) $imageraw = $machine->readSavedScreenshotPNGToArray(0);
188
+    	else $imageraw = $machine->readSavedThumbnailToArray(0, 'PNG');
189
+			
190
+		$machine->releaseRemote();
191
+
192
+	}
193
+	$vbox->session = null;
194
+
195
+	header("Content-type: image/png",true);
196
+
197
+	foreach($imageraw as $i) {
198
+		if(is_array($i)) echo(base64_decode($i[0]));
199
+	}
200
+
201
+
202
+} catch (Exception $ex) {
203
+
204
+	// Ensure we close the VM Session if we hit a error, ensure we don't have a aborted VM
205
+	if($vbox && $vbox->session && $vbox->session->handle) {
206
+		try {
207
+			$vbox->session->unlockMachine();
208
+			unset($vbox->session);
209
+		} catch (Exception $e) {
210
+		}
211
+	}
212
+
213
+	if($_REQUEST['full'] && strpos($ex->faultstring,'VERR_NOT_SUPPORTED') > 0) {
214
+		@header("Content-type: text/html");
215
+		echo("Screen shots are not supported by your VirtualBox installation. To enable screen shots, please install a VirtualBox exteionsion pack that supports VRDE ");
216
+		echo("such as the Oracle VM VirtualBox Extension Pack found in the Downloads section of <a href='http://www.virtualbox.org'>http://www.virtualbox.org</a>.");
217
+	} else if($_REQUEST['full'] || $_REQUEST['debug']) {
218
+		header("Content-type: text/html", true);
219
+		echo("<pre>");
220
+		print_r($ex);
221
+		echo("</pre>");
222
+	}
223
+}
224
+

BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/30white.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/50px-Question_icon.svg.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/50px-Warning_icon.svg.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_dn.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_left.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_right.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_grad_up.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_dn.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_left.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_right.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/arrow_white_up.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/donate.gif View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/downArrow.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/header_grad.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_222222_256x240.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_2e83ff_256x240.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_454545_256x240.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_888888_256x240.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jquery-ui/ui-icons_cd0a0a_256x240.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/directory.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/file.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/folder_open.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/jqueryFileTree/spinner.gif View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_bl.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_bottom.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_br.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_glossy.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_left.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_right.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_tl.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_top.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/monitor_tr.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/rightArrow.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/spinner.gif View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/treeview-default-line.gif View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/treeview-default.gif View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/upArrow.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox.icns View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_16px.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_20px.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_32px.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_40px.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_48px.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_64px.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_cube_42px.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/VirtualBox_win.ico View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/about.png View File


BIN
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/OSE/about_16px.png View File


+ 0
- 0
phpvirtualbox/phpvirtualbox-5.0-5/images/vbox/acpi_16px.png View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save