This project can use VBox
-//
-// Windows has combined BOINC/VBox installers.
-// For other platforms, direct user to VBox download page
-// before installing BOINC
-//
// Can also be called as a web RPC;
// see https://github.com/BOINC/boinc/wiki/WebRpc#download
+// NOT USED - OK TO REMOVE
// rpc this says it's an RPC
// user_agent web browser info
// authenticator the account to link to
@@ -58,8 +49,6 @@
require_once("../inc/util.inc");
require_once("../inc/account.inc");
-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
//
@@ -129,93 +118,30 @@ function get_version($user_agent, $dev) {
return null;
}
-function download_button($v, $project_id, $token, $user, $green) {
+function download_button($v, $project_id, $token, $user) {
return sprintf(
'
',
$project_id,
$token,
$user->id,
(string)$v->filename,
- $green?"btn-success":"btn-info",
+ button_style('green', 14),
(string)$v->platform,
(string)$v->size_mb,
(string)$v->version_num
);
}
-function download_button_vbox($v, $project_id, $token, $user) {
- // if no vbox version exists for platform, don't show vbox button
- if(!$v->vbox_filename) {
- return;
- }
- return sprintf(
- '
- ',
- $project_id,
- $token,
- $user->id,
- (string)$v->vbox_filename,
- (string)$v->platform,
- (string)$v->vbox_size_mb,
- (string)$v->version_num,
- (string)$v->vbox_version
- );
-}
-
-function show_vbox_info($where) {
- global $need_vbox, $recommend_vbox;
-
- if ($need_vbox || $recommend_vbox) {
- echo "";
- if ($need_vbox) {
- echo tra("This project requires VirtualBox.");
- } else if ($recommend_vbox) {
- echo tra("This project recommends VirtualBox.");
- }
- echo " ";
- switch ($where) {
- case "installed":
- echo tra(
- "If it is not installed on this computer, get it %1here%2, then restart BOINC.",
- "",
- ""
- );
- break;
- case "direct":
- case "main":
- if (is_windows()) {
- echo tra("Use the BOINC+VirtualBox installer.");
- } else {
- echo tra(
- "If it is not installed on this computer, get it %1here%2.",
- "",
- ""
- );
- }
- }
- echo "
";
- }
-}
-
// We can't use auto-attach; direct user to the BOINC download page
//
function direct_to_boinc() {
@@ -231,7 +157,6 @@ function direct_to_boinc() {
tra("Go to the BOINC download page."),
null, null, 'target=_new'
);
- show_vbox_info("direct");
if (parse_bool(get_config(), 'account_manager')) {
echo sprintf(
@@ -261,7 +186,7 @@ function direct_to_boinc() {
}
function show_download_page($user, $user_agent, $dev) {
- global $need_vbox, $project_id;
+ global $project_id;
// If no project ID, we can't use simplified install
//
@@ -282,15 +207,9 @@ function show_download_page($user, $user_agent, $dev) {
page_head("Download software");
$phrase = "";
- if ($need_vbox) {
- $dlv = tra("the current versions of BOINC and VirtualBox");
- $phrase = tra("these versions are");
- $dl = tra("BOINC and VirtualBox");
- } else {
- $dlv = tra("the current version of BOINC");
- $phrase = tra("this version is");
- $dl = "BOINC";
- }
+ $dlv = tra("the current version of BOINC");
+ $phrase = tra("this version is");
+ $dl = "BOINC";
echo tra("To participate in %1, %2 must be installed on your computer.", PROJECT, $dlv);
echo"
@@ -304,21 +223,9 @@ function show_download_page($user, $user_agent, $dev) {
";
- show_vbox_info("main");
-
$token = make_login_token($user);
echo "
\n";
- if ($v->vbox_filename) {
- table_row(
- "",
- download_button_vbox($v, $project_id, $token, $user),
- " ",
- download_button($v, $project_id, $token, $user, false),
- ""
- );
- } else {
- table_row("", download_button($v, $project_id, $token, $user, true), "");
- }
+ table_row("", download_button($v, $project_id, $token, $user), "");
echo "
\n";
echo "";
echo tra("When the download is finished, open the downloaded file to install %1.", $dl);
@@ -330,7 +237,6 @@ function show_download_page($user, $user_agent, $dev) {
// if user already has BOINC installed, tell them how to attach.
//
function installed() {
- global $need_vbox, $recommend_vbox;
$config = get_config();
$am = parse_bool($config, "account_manager");
if ($am) {
@@ -351,7 +257,6 @@ function installed() {
);
} else {
page_head(tra("Add %1", PROJECT));
- show_vbox_info("installed");
echo sprintf("%s
- %s
@@ -376,6 +281,7 @@ function installed() {
}
// RPC handler
+// NOT USED - OK TO REMOVE
//
function handle_get_info() {
require_once("../inc/xml.inc");
@@ -400,10 +306,6 @@ function handle_get_info() {
xml_error(-1, "no version for platform");
}
- $want_vbox = parse_bool($config, 'need_vbox')
- || parse_bool($config, 'recommend_vbox')
- ;
-
$token = make_login_token($user);
echo sprintf(
'
@@ -425,21 +327,6 @@ function handle_get_info() {
(string)$v->size_mb,
(string)$v->version_num
);
- if ($v->vbox_filename && $want_vbox) {
- echo sprintf(
-'
- %s
- %s
- %s
- %s
-
-',
- (string)$v->vbox_filename,
- (string)$v->vbox_size_mb,
- (string)$v->version_num,
- (string)$v->vbox_version
- );
- }
echo '
';
}
@@ -447,8 +334,6 @@ function handle_get_info() {
// get config.xml items
//
$config = get_config();
-$need_vbox = parse_bool($config, "need_vbox");
-$recommend_vbox = parse_bool($config, "recommend_vbox");
$project_id = parse_config($config, "");
$action = get_str("action", true);