', url_base(), url_base()
);
diff --git a/html/user/download.php b/html/user/download_software.php
similarity index 69%
rename from html/user/download.php
rename to html/user/download_software.php
index cfeb7c67990..692705ea48d 100644
--- a/html/user/download.php
+++ b/html/user/download_software.php
@@ -19,7 +19,7 @@
// Show a page with download links and instructions.
// There's a logged-in user.
//
-// If no project ID, redirect to BOINC web site
+// If no project ID, direct user to BOINC web site
// otherwise...
//
// - get platform from user agent string
@@ -28,9 +28,15 @@
// - Show download button(s)
// The download will be via concierge, using the login token.
//
-// By default both regular and vbox buttons will be shown, if available.
-// You can suppress one or the other by setting
-// or .
+// VirtualBox
+//
+// config.xml entries:
+// This project requires VBox
+// This project can use VBox
+//
+// Windows has combined BOINC/VBox installers.
+// For other platforms, direct user to VBox download page
+// before installing BOINC
//
// Notes:
// 1) You need to have the client versions file
@@ -41,30 +47,33 @@
require_once("../inc/util.inc");
require_once("../inc/account.inc");
-// take the client info string reported by web browser,
+define("VBOX_DOWNLOAD_URL", "https://www.virtualbox.org/wiki/Downloads");
+
+// take the user agent string reported by web browser,
// and return best guess for platform
//
-function client_info_to_platform($client_info) {
- if (strstr($client_info, 'Windows')) {
- if (strstr($client_info, 'Win64')||strstr($client_info, 'WOW64')) {
+function get_platform() {
+ global $user_agent;
+ if (strstr($user_agent, 'Windows')) {
+ if (strstr($user_agent, 'Win64')||strstr($user_agent, 'WOW64')) {
return 'windows_x86_64';
} else {
return 'windows_intelx86';
}
- } else if (strstr($client_info, 'Mac')) {
- if (strstr($client_info, 'PPC Mac OS X')) {
+ } else if (strstr($user_agent, 'Mac')) {
+ if (strstr($user_agent, 'PPC Mac OS X')) {
return 'powerpc-apple-darwin';
} else {
return 'x86_64-apple-darwin';
}
- } else if (strstr($client_info, 'Android')) {
+ } else if (strstr($user_agent, 'Android')) {
// Check for Android before Linux,
// since Android contains the Linux kernel and the
// web browser user agent string lists Linux too.
//
return 'arm-android-linux-gnu';
- } else if (strstr($client_info, 'Linux')) {
- if (strstr($client_info, 'x86_64')) {
+ } else if (strstr($user_agent, 'Linux')) {
+ if (strstr($user_agent, 'x86_64')) {
return 'x86_64-pc-linux-gnu';
} else {
return 'i686-pc-linux-gnu';
@@ -74,12 +83,20 @@ function client_info_to_platform($client_info) {
}
}
+function is_windows() {
+ global $user_agent;
+ if (strstr($user_agent, 'Windows')) {
+ return true;
+ }
+ return false;
+}
+
// find release version for user's platform
//
function get_version($dev) {
+ global $user_agent;
$v = simplexml_load_file("versions.xml");
- $client_info = $_SERVER['HTTP_USER_AGENT'];
- $p = client_info_to_platform($client_info);
+ $p = get_platform();
foreach ($v->version as $i=>$v) {
if ((string)$v->dbplatform != $p) {
continue;
@@ -96,14 +113,14 @@ function get_version($dev) {
return null;
}
-function download_button($v, $project_id, $token, $user) {
+function download_button($v, $project_id, $token, $user, $green) {
return sprintf(
'