2015-01-09 18:54:05 +00:00
|
|
|
<?php
|
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2015 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/>.
|
|
|
|
|
2015-01-14 17:19:11 +00:00
|
|
|
// forms for account creation and login
|
|
|
|
|
2015-01-09 18:54:05 +00:00
|
|
|
function create_account_form($teamid, $next_url) {
|
2017-02-02 06:13:21 +00:00
|
|
|
global $recaptcha_public_key;
|
2015-01-09 18:54:05 +00:00
|
|
|
echo "
|
|
|
|
<form action=\"create_account_action.php\" method=\"post\">
|
|
|
|
<input type=hidden name=next_url value=\"$next_url\">
|
|
|
|
";
|
|
|
|
|
|
|
|
if ($teamid) {
|
|
|
|
echo "
|
|
|
|
<input type=\"hidden\" name=\"teamid\" value=\"$teamid\">
|
|
|
|
";
|
|
|
|
}
|
|
|
|
start_table();
|
|
|
|
|
|
|
|
// Using invitation codes to restrict access?
|
|
|
|
//
|
|
|
|
if (defined('INVITE_CODES')) {
|
|
|
|
row2(
|
2016-11-29 08:34:26 +00:00
|
|
|
tra("Invitation Code")."<br><small>".tra("A valid invitation code is required to create an account.")."</small>",
|
2016-12-05 05:04:23 +00:00
|
|
|
'<input class="form-control" type="text" name="invite_code" size="30" >'
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
row2(
|
2016-11-29 08:34:26 +00:00
|
|
|
tra("Name")."<br><small>".tra("Identifies you on our web site. Use your real name or a nickname.")."</small>",
|
2016-12-05 05:04:23 +00:00
|
|
|
'<input class="form-control" type="text" name="new_name" width="10">'
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
|
|
|
row2(
|
2016-11-29 08:34:26 +00:00
|
|
|
tra("Email Address")."<br><small>".tra("Must be a valid address of the form 'name@domain'.")."</small>",
|
2016-12-05 05:04:23 +00:00
|
|
|
'<input class="form-control" type="text" name="new_email_addr" size="50">'
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
|
|
|
$min_passwd_length = parse_element(get_config(), "<min_passwd_length>");
|
|
|
|
if (!$min_passwd_length) {
|
|
|
|
$min_passwd_length = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
row2(
|
|
|
|
tra("Password")
|
2016-11-29 08:34:26 +00:00
|
|
|
."<br><small>".tra("Must be at least %1 characters", $min_passwd_length)."</small>",
|
2016-12-05 05:04:23 +00:00
|
|
|
'<input class="form-control" type="password" name="passwd">'
|
|
|
|
);
|
|
|
|
row2(
|
|
|
|
tra("Confirm password"),
|
|
|
|
'<input class="form-control" type="password" name="passwd2">'
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
|
|
|
row2_init(
|
2016-11-29 08:34:26 +00:00
|
|
|
tra("Country")."<br><small>".tra("Select the country you want to represent, if any.")."</small>",
|
2016-11-25 02:01:41 +00:00
|
|
|
'<select class="form-control" style="width:240px;" name="country">'
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
2017-02-16 18:59:56 +00:00
|
|
|
echo country_select_options();
|
2015-01-09 18:54:05 +00:00
|
|
|
echo "</select></td></tr>\n";
|
2015-01-14 17:19:11 +00:00
|
|
|
if (0) {
|
|
|
|
row2(
|
2016-11-29 08:34:26 +00:00
|
|
|
tra("Postal or ZIP Code")."<br><small>".tra("Optional")."</small>",
|
2015-01-14 17:19:11 +00:00
|
|
|
"<input type=\"text\" name=\"postal_code\" size=\"20\">"
|
|
|
|
);
|
|
|
|
}
|
2015-01-09 18:54:05 +00:00
|
|
|
|
2017-02-02 06:13:21 +00:00
|
|
|
// Check if we're using reCaptcha to prevent spam accounts
|
2015-01-09 18:54:05 +00:00
|
|
|
//
|
2017-02-02 06:13:21 +00:00
|
|
|
if ($recaptcha_public_key) {
|
2015-01-09 18:54:05 +00:00
|
|
|
row2(
|
2015-01-17 03:18:44 +00:00
|
|
|
"",
|
2017-02-02 06:13:21 +00:00
|
|
|
boinc_recaptcha_get_html($recaptcha_public_key)
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
row2("",
|
|
|
|
"<input class=\"btn btn-primary\" type=\"submit\" value=\"".tra("Create account")."\">"
|
|
|
|
);
|
|
|
|
end_table();
|
|
|
|
echo "</form>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
function login_form($next_url) {
|
|
|
|
echo "
|
|
|
|
<form name=\"f\" method=\"post\" action=\"".secure_url_base()."/login_action.php\">
|
|
|
|
<input type=\"hidden\" name=\"next_url\" value=\"$next_url\">
|
|
|
|
";
|
|
|
|
start_table();
|
|
|
|
if (LDAP_HOST) {
|
|
|
|
$x = "Email address or LDAP user name:";
|
|
|
|
} else {
|
|
|
|
$x = tra("Email address:");
|
|
|
|
}
|
2015-11-04 19:54:38 +00:00
|
|
|
if (!parse_bool(get_config(), "no_computing")) {
|
2016-12-05 05:04:23 +00:00
|
|
|
$x .= '<br><small><a href="get_passwd.php">'.tra("forgot email address?")."</a></small>";
|
2015-11-04 19:54:38 +00:00
|
|
|
}
|
2016-12-05 05:04:23 +00:00
|
|
|
row2($x, '<input class="form-control" name=email_addr type="text" size=40 tabindex=1>');
|
|
|
|
row2(tra("Password:") . '<br><small><a href="get_passwd.php">' . tra("forgot password?") . "</a></small>",
|
|
|
|
'<input class="form-control" type="password" name="passwd" size="40" tabindex="2">'
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
|
|
|
row2(tra("Stay logged in"),
|
|
|
|
'<input type="checkbox" name="stay_logged_in" checked>'
|
|
|
|
);
|
|
|
|
|
|
|
|
row2("",
|
2015-01-14 17:19:11 +00:00
|
|
|
"<input class=\"btn btn-default\" type=\"submit\" name=\"mode\" value=\"".tra("Log in")."\" tabindex=\"3\"><br><br>"
|
2015-01-09 18:54:05 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
end_table();
|
|
|
|
echo "</form>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|