示例#1
0
            $participant['participant_id'] = $new_id['participant_id'];
            $participant['participant_id_crypt'] = $new_id['participant_id_crypt'];
            if ($settings['subject_authentication'] != 'token') {
                $participant['password_crypted'] = unix_crypt($participant['password']);
            }
            $participant['confirmation_token'] = create_random_token(get_entropy($participant));
            $participant['creation_time'] = time();
            $participant['last_profile_update'] = $participant['creation_time'];
            $participant['status_id'] = 0;
            $participant['subpool_id'] = $_SESSION['subpool_id'];
            if (!isset($participant['language']) || !$participant['language']) {
                $participant['language'] = $settings['public_standard_language'];
            }
            $done = orsee_db_save_array($participant, "participants", $participant['participant_id'], "participant_id");
            if ($done) {
                log__participant("subscribe", $participant['lname'] . ', ' . $participant['fname']);
                $proceed = false;
                $done = experimentmail__confirmation_mail($participant);
                message(lang('successfully_registered'));
                redirect("public/");
            } else {
                message(lang('database_error'));
            }
        }
    }
}
if ($proceed) {
    echo '<CENTER>
			<TABLE class="or_formtable" style="width: auto;"><TR><TD>';
    show_message();
    $_REQUEST['subpool_id'] = $_SESSION['subpool_id'];
示例#2
0
    $participant_id = participant__participant_get_if_not_confirmed($c);
    if (!$participant_id) {
        message(lang('already_confirmed_error'));
        redirect("public/");
    } else {
        // change status to active
        $default_active_status = participant_status__get("is_default_active");
        $pars = array(':participant_id' => $participant_id, ':default_active_status' => $default_active_status);
        if ($settings['allow_permanent_queries'] == 'y') {
            $qadd = ', apply_permanent_queries = 1 ';
        } else {
            $qadd = '';
        }
        $query = "UPDATE " . table('participants') . "\n                SET status_id= :default_active_status,\n                 confirmation_token = ''\n                " . $qadd . "\n                WHERE participant_id= :participant_id ";
        $done = or_query($query, $pars);
        echo '<center>';
        if (!$done) {
            message(lang('database_error'));
            redirect("public/");
        } else {
            log__participant("confirm", $participant_id);
            // load participant package
            $mess = lang('registration_confirmed') . '<BR><BR>';
            $mess .= lang('thanks_for_registration');
            message($mess);
            show_message();
        }
        echo '</center>';
    }
}
include "footer.php";
示例#3
0
<?php

// part of orsee. see orsee.org
ob_start();
$suppress_html_header = true;
include "header.php";
if ($proceed) {
    log__participant("logout", $participant['participant_id']);
    participant__logout();
    if (isset($_REQUEST['mobile']) && $_REQUEST['mobile']) {
        redirect("public/participant_login_mob.php?logout=true");
    } else {
        redirect("public/participant_login.php?logout=true");
    }
}
include "footer.php";
示例#4
0
            }
        }
        if ($proceed) {
            $cancellation_deadline = sessions__get_cancellation_deadline($session);
            $now = time();
            if ($cancellation_deadline < $now) {
                $continue = false;
                message(lang('error_enrolment_cancellation_deadline_expired'));
                redirect("public/participant_show_mob.php" . $token_string);
            }
        }
        // if all checks are done, cancel ...
        if ($continue) {
            $done = expregister__cancel($participant, $session);
            $done = participant__update_last_enrolment_time($participant_id);
            $done = log__participant("cancel_session_enrolment", $participant['participant_id'], "experiment_id:" . $session['experiment_id'] . "\nsession_id:" . $session_id);
            message(lang('successfully_canceled_enrolment_xxx') . " " . experiment__get_public_name($session['experiment_id']) . ", " . session__build_name($session_id) . ". " . lang('this_will_be_confirmed_by_an_email'));
            redirect("public/participant_show_mob.php" . $token_string);
        }
    }
}
if ($proceed) {
    $labs = laboratories__get_laboratories();
    // load the data
    // invitations
    $invdata = expregister__get_invitations($participant_id);
    $invited = $invdata['invited'];
    $inv_experiments = $invdata['inv_experiments'];
    // registrations
    $registered = expregister__get_registrations($participant_id);
    // history
示例#5
0
$menu__area = "my_data";
$title = "delete_participant";
include "header.php";
if ($proceed) {
    if (isset($_REQUEST['betternot'])) {
        redirect("public/participant_edit.php?p=" . urlencode($participant['participant_id_crypt']));
    }
}
if ($proceed) {
    $form = true;
    if (isset($_REQUEST['reallydelete']) && $_REQUEST['reallydelete'] == "12345" && isset($_REQUEST['doit'])) {
        $default_inactive_status = participant_status__get("is_default_inactive");
        $pars = array(':participant_id' => $participant_id, ':default_inactive_status' => $default_inactive_status);
        $query = "UPDATE " . table('participants') . "\n                SET status_id= :default_inactive_status,\n                deletion_time='" . time() . "'\n                WHERE participant_id= :participant_id";
        $done = or_query($query, $pars);
        log__participant("delete", $participant_id);
        $form = false;
        message(lang('removed_from_invitation_list'));
        redirect("public/");
    }
}
if ($proceed) {
    if ($form) {
        echo '<center>

            <FORM action="participant_delete.php">
            <INPUT type=hidden name="p" value="' . $participant['participant_id_crypt'] . '">
            <TABLE class="or_formtable">
            <TR>
            <TD colspan=2><INPUT name=reallydelete type=hidden value="12345">
            ' . lang('do_you_really_want_to_unsubscribe') . '<BR></TD>
示例#6
0
        $response = participantform__check_unique($_REQUEST, "edit", $_REQUEST['participant_id']);
        if ($response['problem']) {
            $continue = false;
        }
        if ($continue) {
            if (isset($participant['pending_profile_update_request']) && $participant['pending_profile_update_request'] == 'y') {
                $_REQUEST['pending_profile_update_request'] = 'n';
                $_REQUEST['profile_update_request_new_pool'] = NULL;
                message(lang('profile_confirmed') . '<BR>');
            }
            $participant = $_REQUEST;
            $participant['last_profile_update'] = time();
            $done = orsee_db_save_array($participant, "participants", $participant['participant_id'], "participant_id");
            if ($done) {
                message(lang('changes_saved'));
                log__participant("edit", $participant['participant_id']);
                redirect("public/participant_edit.php" . $token_string);
            } else {
                message(lang('database_error'));
                redirect("public/participant_edit.php" . $token_string);
            }
        }
    } else {
        $_REQUEST = $participant;
    }
}
if ($proceed) {
    if (isset($participant['pending_profile_update_request']) && $participant['pending_profile_update_request'] == 'y') {
        message(lang('profile_update_request_message') . '<BR>');
        if (isset($participant['profile_update_request_new_pool']) && $participant['profile_update_request_new_pool']) {
            $_REQUEST['subpool_id'] = $participant['profile_update_request_new_pool'];
示例#7
0
function participant__track_successful_login($participant)
{
    $pars = array(':participant_id' => $participant['participant_id'], ':last_login_attempt' => time(), ':failed_login_attempts' => 0, ':locked' => 0);
    $query = "UPDATE " . table('participants') . "\n            SET last_login_attempt = :last_login_attempt,\n            failed_login_attempts = :failed_login_attempts,\n            locked = :locked\n            WHERE participant_id= :participant_id";
    $done = or_query($query, $pars);
    log__participant('login_participant_success', $participant['participant_id']);
    return $done;
}