account creation via RPC with invitation code

svn path=/trunk/boinc/; revision=11314
This commit is contained in:
Rytis Slatkevičius 2006-10-19 18:09:02 +00:00
parent 2ab25bdfd2
commit 22798e94af
3 changed files with 19 additions and 1 deletions

View File

@ -11216,3 +11216,13 @@ David 19 Oct 2006
cs_statefile.C
html/inc/
cert.inc
Rytis 19 Oct 2006
- user web: allow account creation via an RPC when invitation code is
required.
html/
user/
create_account.php
inc/
xml.inc

View File

@ -31,6 +31,7 @@ function xml_error($num, $msg=null) {
case -206: $msg = "Invalid password"; break;
case -207: $msg = "Email address is not unique"; break;
case -208: $msg = "Account creation is disabled"; break;
case -209: $msg = "Invalid invitation code"; break;
default: "Unknown error"; break;
}
}

View File

@ -13,10 +13,17 @@ $retval = db_init_xml();
if ($retval) xml_error($retval);
$config = get_config();
if (parse_bool($config, "disable_account_creation") || defined('INVITE_CODES')) {
if (parse_bool($config, "disable_account_creation")) {
xml_error(-208);
}
if(defined('INVITE_CODES')) {
$invite_code = process_user_text(get_str("invite_code"));
if (!preg_match(INVITE_CODES, $invite_code)) {
xml_error(-209);
}
}
$email_addr = get_str("email_addr");
$email_addr = process_user_text(strtolower($email_addr));
$passwd_hash = process_user_text(get_str("passwd_hash"));