Example #1
0
function get_form_data()
{
    $vol->name = stripslashes($_GET['volname']);
    if (!$vol->name) {
        boinc_error_page("Name must not be blank");
    }
    if (strstr($vol->name, "<")) {
        boinc_error_page("No &lt; allowed");
    }
    $vol->password = stripslashes($_GET['password']);
    if (!$vol->password) {
        boinc_error_page("Password must not be blank");
    }
    $vol->email_addr = stripslashes($_GET['email_addr']);
    if (!$vol->email_addr) {
        boinc_error_page("Email address must not be blank");
    }
    $vol->skypeid = stripslashes($_GET['skypeid']);
    if (!$vol->skypeid) {
        boinc_error_page("Skype ID must not be blank");
    }
    $vol->lang1 = stripslashes($_GET['lang1']);
    if (!$vol->lang1) {
        boinc_error_page("Primary language must not be blank");
    }
    if (!is_spoken_language($vol->lang1)) {
        boinc_error_page("Not a language");
    }
    $vol->lang2 = stripslashes($_GET['lang2']);
    if (!is_spoken_language($vol->lang2)) {
        boinc_error_page("Not a language");
    }
    $vol->country = stripslashes($_GET['country']);
    if (!is_valid_country($vol->country)) {
        boinc_error_page("Bad country");
    }
    $vol->specialties = stripslashes($_GET['specialties']);
    if (strstr($vol->specialties, "<")) {
        boinc_error_page("No &lt; allowed");
    }
    $vol->projects = stripslashes($_GET['projects']);
    if (strstr($vol->projects, "<")) {
        boinc_error_page("No &lt; allowed");
    }
    $vol->availability = stripslashes($_GET['availability']);
    if (strstr($vol->availability, "<")) {
        boinc_error_page("No &lt; allowed");
    }
    $vol->voice_ok = $_GET['voice_ok'] ? 1 : 0;
    $vol->text_ok = $_GET['text_ok'] ? 1 : 0;
    $vol->hide = $_GET['hide'] ? 1 : 0;
    return $vol;
}
Example #2
0
 if (!is_valid_user_name($new_name, $reason)) {
     show_error($reason);
 }
 $new_email_addr = $data['contact/email'];
 $new_email_addr = strtolower($new_email_addr);
 if (!is_valid_email_addr($new_email_addr)) {
     show_error("Invalid email address:\n                you must enter a valid address of the form\n                name@domain");
 }
 $user = lookup_user_email_addr($new_email_addr);
 if (!$user) {
     $passwd_hash = random_string();
     $country = $data['contact/country/home'];
     if ($country == "") {
         $country = "International";
     }
     if (!is_valid_country($country)) {
         echo "bad country";
         exit;
     }
     $postal_code = '';
     $user = make_user($new_email_addr, $new_name, $passwd_hash, $country, $postal_code, $project_prefs = "", $teamid = 0);
     if (!$user) {
         show_error("Couldn't create account");
     }
     if (defined('INVITE_CODES')) {
         error_log("Account '{$new_email_addr}' created using invitation code '{$invite_code}'");
     }
 }
 // Log-in user in the web
 // In success case, redirect to a fixed page so that user can
 // return to it without getting "Repost form data" stuff
Example #3
0
    $global_prefs = get_str("global_prefs", true);
    $project_prefs = get_str("project_prefs", true);
    $url = get_str("url", true);
    $send_email = get_str("send_email", true);
    $show_hosts = get_str("show_hosts", true);
    $teamid = get_int("teamid", true);
    $venue = get_str("venue", true);
    $email_addr = get_str("email_addr", true);
    $password_hash = get_str("password_hash", true);
}
$user = lookup_user_auth($auth);
if (!$user) {
    xml_error(-136);
}
$name = BoincDb::escape_string($name);
if ($country && !is_valid_country($country)) {
    xml_error(-1, "invalid country");
}
$country = BoincDb::escape_string($country);
$postal_code = BoincDb::escape_string($postal_code);
$global_prefs = BoincDb::escape_string($global_prefs);
$project_prefs = BoincDb::escape_string($project_prefs);
// Do processing on project prefs so that we don't overwrite project-specific
// settings if AMS has no idea about them
if (stripos($project_prefs, "<project_specific>") === false) {
    // AMS request does not contain project specific prefs, preserve original
    $orig_project_specific = stristr($user->project_prefs, "<project_specific>");
    $orig_project_specific = substr($orig_project_specific, 0, stripos($orig_project_specific, "</project_specific>") + 19) . "\n";
    $project_prefs = str_ireplace("<project_preferences>", "<project_preferences>\n" . $orig_project_specific, $project_prefs);
}
$url = BoincDb::escape_string($url);