Issues (1963)

html/user/join.php (2 issues)

1
<?php
2
3
// This file is part of BOINC.
4
// http://boinc.berkeley.edu
5
// Copyright (C) 2016 University of California
6
//
7
// BOINC is free software; you can redistribute it and/or modify it
8
// under the terms of the GNU Lesser General Public License
9
// as published by the Free Software Foundation,
10
// either version 3 of the License, or (at your option) any later version.
11
//
12
// BOINC is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
// See the GNU Lesser General Public License for more details.
16
//
17
// You should have received a copy of the GNU Lesser General Public License
18
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
19
20
// This page implements the old model where the user downloads BOINC
21
// from the BOINC web site,
22
// and creates an account using the Manager.
23
//
24
// Link to here (e.g. from front-page Join button
25
// if you're not a vetted project.
26
// If you are, link to signup.php instead
27
//
28
// This page routes people to the right place depending on whether
29
// they already have BOINC installed on this device.
30
31
// DEPRECATED.  Use signup.php instead
32
33
require_once("../inc/util.inc");
34
35
// "old" (misnomer) means BOINC is already installed on this device
36
37
function show_choose($is_old) {
38
    panel(null,
39
        function() use($is_old) {
0 ignored issues
show
Expected 1 space after USE keyword; found 0
Loading history...
40
            echo tra("Is BOINC installed on this device?");
41
            $y = tra("Yes");
42
            $n = tra("No");
43
            if ($is_old) {
44
                echo sprintf(
45
                    ' <b>%s</b> &nbsp; |&nbsp; <a href="join.php">%s</a>',
46
                    $y, $n
47
                );
48
            } else {
49
                echo sprintf(
50
                    ' <a href="join.php?old=1">%s</a> &nbsp; |&nbsp; <b>%s</b>',
51
                    $y, $n
52
                );
53
            }
54
        }
55
    );
56
}
57
58
function show_new() {
59
    $master_url = master_url();
60
    panel(null,
61
        function() use ($master_url) {
62
            echo '
63
                <ol>
64
                <li> '
65
                .tra('Read our %1 Rules and Policies %2.', '<a href="info.php">', '</a>')
66
                .'<li> <p>'
67
                .tra('Download and install BOINC.')
68
                    .'</p><p>
69
                    <a href="http://boinc.berkeley.edu/download.php" class="btn btn-success">'.tra('Download').'</a>
70
                    </p><p>'
71
                    .tra('For Android devices, download BOINC from the Google Play Store or Amazon App Store.')
72
                    .'</p>
73
                <li> '
74
                .tra('Run BOINC.').'
75
                <li> '.tra("Choose %1 from the list, or enter %2", "<strong>".PROJECT."</strong>", "<strong>$master_url</strong>").'
76
                </ol>
77
            ';
78
        }
79
    );
80
}
81
82
function show_old() {
83
    $master_url = master_url();
84
    panel(null,
85
        function() use($master_url) {
0 ignored issues
show
Expected 1 space after USE keyword; found 0
Loading history...
86
            echo '
87
                <ul>
88
                <li> '
89
                .tra('Read our %1 Rules and Policies %2.', '<a href="info.php">', '</a>')
90
                .'<p><li> '
91
                .tra('In the BOINC Manager, select Tools / Add Project.')
92
                .'<p><li> '
93
                .tra('Choose %1 from the list, or enter %2', "<strong>".PROJECT."</strong>", "<strong>$master_url</strong>")
94
                .'</ul>
95
            ';
96
        }
97
    );
98
}
99
100
$old = get_int('old', true);
101
102
page_head(tra("Join %1", PROJECT));
103
show_choose($old);
104
if ($old) {
105
    show_old();
106
} else {
107
    show_new();
108
}
109
page_tail();
110