-
Notifications
You must be signed in to change notification settings - Fork 7
/
su_join.inc
120 lines (106 loc) · 3.52 KB
/
su_join.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2017 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once("../inc/util.inc");
require_once("../inc/account.inc");
require_once("../inc/keywords.inc");
require_once("../inc/recaptchalib.php");
function su_join_form($next_url) {
global $recaptcha_public_key;
form_input_hidden('next_url', $next_url);
// Using invitation codes to restrict access?
//
if (defined('INVITE_CODES')) {
form_input_text(
sprintf('<span title="%s">%s</span>',
tra("An invitation code is required to create an account."),
tra("Invitation code")
),
"invite_code"
);
}
form_input_text(
sprintf('<span title="%s">%s</span>',
tra("Identifies you on this web site. Use your real name or a nickname."),
tra("Choose screen name")
),
"new_name"
);
form_input_text(
sprintf('<span title="%s">%s</span>',
tra("An address where you can receive emails."),
tra("Your email address")
),
"new_email_addr"
);
$min_passwd_length = parse_element(get_config(), "<min_passwd_length>");
if (!$min_passwd_length) {
$min_passwd_length = 6;
}
form_input_text(
sprintf('<span title="%s">%s</span>',
tra("Must be at least %1 characters", $min_passwd_length),
tra("Choose password")
),
"passwd", "", "password", 'id="passwd"',
passwd_visible_checkbox("passwd")
);
}
function keyword_prefs_form() {
global $job_keywords;
$items = array();
foreach ($job_keywords as $id=>$k) {
if ($k->category != KW_CATEGORY_SCIENCE) continue;
if ($k->level > 0) continue;
$items[] = array("keywd_".$id, $k->name, false);
}
form_checkboxes(
"Science areas you most want to support
<br><small>You can refine your preferences later</small>
",
$items
);
}
function global_prefs_form() {
form_radio_buttons(
"Use of your computer",
"preset",
array(
array('low_power', "Low power"),
array('standard', "Standard"),
array('max', "Maximum computing"),
),
'standard'
);
}
function show_join_form() {
global $recaptcha_public_key;
form_start("su_join.php", "post");
form_input_hidden("action", "join");
form_general("", "Already using BOINC? <a href=su_boinc_users.php>Read this first.</a>");
form_general("", "Read our <a href=su_privacy.php>privacy policy.</a>");
su_join_form(0, "download.php?dev=1");
if (PROJECT == 'Science United') {
keyword_prefs_form();
}
global_prefs_form();
if ($recaptcha_public_key) {
form_general("", boinc_recaptcha_get_html($recaptcha_public_key));
}
form_submit("Join");
form_end();
}