1919// Page for downloading the BOINC client, with support for autoattach:
2020// https://github.com/BOINC/boinc/wiki/SimpleAttach
2121// Note: to use autoattach:
22- // 1) You need to have the client versions file
22+ // 1) You need to have the latest client versions file
2323// run html/ops/get_versions.php
2424// 2) Put your project ID (ask DPA if you don't have one)
2525// in config.xml as <project_id>x</project_id>
2626//
2727// There's a logged-in user.
2828//
2929// Autoattach case: if project has an ID and client is Win or Mac:
30- // - find latest version for that platform (regular and vbox)
30+ // - find latest version for that platform
3131// - Create a login token.
3232// - Show download button(s)
3333// The download will be via concierge, using the login token.
3434// Otherwise:
3535// - show link to download page on BOINC web site,
3636// and instructions for what to do after that.
37- //
38- // VirtualBox:
39- // config.xml entries:
40- // <need_vbox/> This project requires VBox
41- // <recommend_vbox> This project can use VBox
42- //
43- // Windows has combined BOINC/VBox installers.
44- // For other platforms, direct user to VBox download page
45- // before installing BOINC
46- //
4737
4838// Can also be called as a web RPC;
4939// see https://github.com/BOINC/boinc/wiki/WebRpc#download
40+ // NOT USED - OK TO REMOVE
5041// rpc this says it's an RPC
5142// user_agent web browser info
5243// authenticator the account to link to
5849require_once ("../inc/util.inc " );
5950require_once ("../inc/account.inc " );
6051
61- define ("VBOX_DOWNLOAD_URL " , "https://www.virtualbox.org/wiki/Downloads " );
62-
6352// take the user agent string reported by web browser,
6453// and return best guess for platform
6554//
@@ -129,93 +118,30 @@ function get_version($user_agent, $dev) {
129118 return null ;
130119}
131120
132- function download_button ($ v , $ project_id , $ token , $ user, $ green ) {
121+ function download_button ($ v , $ project_id , $ token , $ user ) {
133122 return sprintf (
134123 '<form action="https://boinc.berkeley.edu/concierge.php" method="post">
135124 <input type=hidden name=project_id value="%d">
136125 <input type=hidden name=token value="%s">
137126 <input type=hidden name=user_id value="%d">
138127 <input type=hidden name=filename value="%s">
139- <button class="btn %s" >
140- <font size=2 ><u>Download BOINC</u></font>
128+ <button class="btn" %s>
129+ <font size=+1 ><u>Download BOINC</u></font>
141130 <br>for %s (%s MB)
142- <br><small> BOINC %s</small> </button>
131+ <br>BOINC %s</button>
143132 </form>
144133 ' ,
145134 $ project_id ,
146135 $ token ,
147136 $ user ->id ,
148137 (string )$ v ->filename ,
149- $ green? " btn-success " : " btn-info " ,
138+ button_style ( ' green ' , 14 ) ,
150139 (string )$ v ->platform ,
151140 (string )$ v ->size_mb ,
152141 (string )$ v ->version_num
153142 );
154143}
155144
156- function download_button_vbox ($ v , $ project_id , $ token , $ user ) {
157- // if no vbox version exists for platform, don't show vbox button
158- if (!$ v ->vbox_filename ) {
159- return ;
160- }
161- return sprintf (
162- '<form action="https://boinc.berkeley.edu/concierge.php" method="post">
163- <input type=hidden name=project_id value="%d">
164- <input type=hidden name=token value="%s">
165- <input type=hidden name=user_id value="%d">
166- <input type=hidden name=filename value="%s">
167- <button class="btn btn-success">
168- <font size=+1><u>Download BOINC + VirtualBox</u></font>
169- <br>for %s (%s MB)
170- <br><small>BOINC %s, VirtualBox %s</small></a>
171- </form>
172- ' ,
173- $ project_id ,
174- $ token ,
175- $ user ->id ,
176- (string )$ v ->vbox_filename ,
177- (string )$ v ->platform ,
178- (string )$ v ->vbox_size_mb ,
179- (string )$ v ->version_num ,
180- (string )$ v ->vbox_version
181- );
182- }
183-
184- function show_vbox_info ($ where ) {
185- global $ need_vbox , $ recommend_vbox ;
186-
187- if ($ need_vbox || $ recommend_vbox ) {
188- echo "<p> " ;
189- if ($ need_vbox ) {
190- echo tra ("This project requires VirtualBox. " );
191- } else if ($ recommend_vbox ) {
192- echo tra ("This project recommends VirtualBox. " );
193- }
194- echo " " ;
195- switch ($ where ) {
196- case "installed " :
197- echo tra (
198- "If it is not installed on this computer, get it %1here%2, then restart BOINC. " ,
199- "<a href= " .VBOX_DOWNLOAD_URL ."> " ,
200- "</a> "
201- );
202- break ;
203- case "direct " :
204- case "main " :
205- if (is_windows ()) {
206- echo tra ("Use the BOINC+VirtualBox installer. " );
207- } else {
208- echo tra (
209- "If it is not installed on this computer, get it %1here%2. " ,
210- "<a href= " .VBOX_DOWNLOAD_URL ."> " ,
211- "</a> "
212- );
213- }
214- }
215- echo "<p> " ;
216- }
217- }
218-
219145// We can't use auto-attach; direct user to the BOINC download page
220146//
221147function direct_to_boinc () {
@@ -231,7 +157,6 @@ function direct_to_boinc() {
231157 tra ("Go to the BOINC download page. " ),
232158 null , null , 'target=_new '
233159 );
234- show_vbox_info ("direct " );
235160
236161 if (parse_bool (get_config (), 'account_manager ' )) {
237162 echo sprintf (
@@ -261,7 +186,7 @@ function direct_to_boinc() {
261186}
262187
263188function show_download_page ($ user , $ user_agent , $ dev ) {
264- global $ need_vbox , $ project_id ;
189+ global $ project_id ;
265190
266191 // If no project ID, we can't use simplified install
267192 //
@@ -282,15 +207,9 @@ function show_download_page($user, $user_agent, $dev) {
282207 page_head ("Download software " );
283208
284209 $ phrase = "" ;
285- if ($ need_vbox ) {
286- $ dlv = tra ("the current versions of BOINC and VirtualBox " );
287- $ phrase = tra ("these versions are " );
288- $ dl = tra ("BOINC and VirtualBox " );
289- } else {
290- $ dlv = tra ("the current version of BOINC " );
291- $ phrase = tra ("this version is " );
292- $ dl = "BOINC " ;
293- }
210+ $ dlv = tra ("the current version of BOINC " );
211+ $ phrase = tra ("this version is " );
212+ $ dl = "BOINC " ;
294213 echo tra ("To participate in %1, %2 must be installed on your computer. " , PROJECT , $ dlv );
295214 echo "
296215 <p>
@@ -304,21 +223,9 @@ function show_download_page($user, $user_agent, $dev) {
304223 <p>
305224 " ;
306225
307- show_vbox_info ("main " );
308-
309226 $ token = make_login_token ($ user );
310227 echo "<table border=0 cellpadding=20> \n" ;
311- if ($ v ->vbox_filename ) {
312- table_row (
313- "" ,
314- download_button_vbox ($ v , $ project_id , $ token , $ user ),
315- " " ,
316- download_button ($ v , $ project_id , $ token , $ user , false ),
317- ""
318- );
319- } else {
320- table_row ("" , download_button ($ v , $ project_id , $ token , $ user , true ), "" );
321- }
228+ table_row ("" , download_button ($ v , $ project_id , $ token , $ user ), "" );
322229 echo "</table> \n" ;
323230 echo "<p><p> " ;
324231 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) {
330237// if user already has BOINC installed, tell them how to attach.
331238//
332239function installed () {
333- global $ need_vbox , $ recommend_vbox ;
334240 $ config = get_config ();
335241 $ am = parse_bool ($ config , "account_manager " );
336242 if ($ am ) {
@@ -351,7 +257,6 @@ function installed() {
351257 );
352258 } else {
353259 page_head (tra ("Add %1 " , PROJECT ));
354- show_vbox_info ("installed " );
355260 echo sprintf ("%s
356261 <ul>
357262 <li> %s
@@ -376,6 +281,7 @@ function installed() {
376281}
377282
378283// RPC handler
284+ // NOT USED - OK TO REMOVE
379285//
380286function handle_get_info () {
381287 require_once ("../inc/xml.inc " );
@@ -400,10 +306,6 @@ function handle_get_info() {
400306 xml_error (-1 , "no version for platform " );
401307 }
402308
403- $ want_vbox = parse_bool ($ config , 'need_vbox ' )
404- || parse_bool ($ config , 'recommend_vbox ' )
405- ;
406-
407309 $ token = make_login_token ($ user );
408310 echo sprintf (
409311'<download_info>
@@ -425,30 +327,13 @@ function handle_get_info() {
425327 (string )$ v ->size_mb ,
426328 (string )$ v ->version_num
427329 );
428- if ($ v ->vbox_filename && $ want_vbox ) {
429- echo sprintf (
430- ' <boinc_vbox>
431- <filename>%s</filename>
432- <size_mb>%s</size_mb>
433- <boinc_version>%s</boinc_version>
434- <vbox_version>%s</vbox_version>
435- </boinc_vbox>
436- ' ,
437- (string )$ v ->vbox_filename ,
438- (string )$ v ->vbox_size_mb ,
439- (string )$ v ->version_num ,
440- (string )$ v ->vbox_version
441- );
442- }
443330 echo '</download_info>
444331 ' ;
445332}
446333
447334// get config.xml items
448335//
449336$ config = get_config ();
450- $ need_vbox = parse_bool ($ config , "need_vbox " );
451- $ recommend_vbox = parse_bool ($ config , "recommend_vbox " );
452337$ project_id = parse_config ($ config , "<project_id> " );
453338
454339$ action = get_str ("action " , true );
0 commit comments