Ejemplo n.º 1
0
                    }
                } else {
                    // and if we only allow username/passsword, send to login page
                    if (isset($mobile) && $mobile) {
                        redirect("public/participant_login_mob.php");
                    } else {
                        redirect("public/participant_login.php");
                    }
                }
            } else {
            }
        }
        if ($proceed) {
            // do some other checks when we are logged in
            $statuses = participant_status__get_statuses();
            $statuses_profile = participant_status__get("access_to_profile");
            if (isset($participant) && !in_array($participant['status_id'], $statuses_profile)) {
                message($statuses[$participant['status_id']]['error'] . " " . lang('if_you_have_questions_write_to') . " " . support_mail_link());
                redirect("public/");
            }
        }
    }
}
if ($proceed) {
    $pagetitle = $settings['default_area'];
    if (!isset($title)) {
        $title = "";
    }
    if ($title) {
        $title = lang($title);
    }
Ejemplo n.º 2
0
    } else {
        $c = '';
    }
    if (!$c) {
        message(lang('confirmation_error'));
        redirect("public/");
    }
}
if ($proceed) {
    $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
Ejemplo n.º 3
0
function participant_status__get_pquery_snippet($what = "eligible_for_experiments")
{
    // what can be access_to_profile, eligible_for_experiments, is_default_active or is_default_inactive
    $check_statuses = participant_status__get($what);
    if (count($check_statuses) > 0) {
        if ($what == 'is_default_active' || $what == 'is_default_inactive') {
            return " status_id='" . $check_statuses . "' ";
        } else {
            $snippet = " status_id IN (" . implode(", ", $check_statuses) . ") ";
            return $snippet;
        }
    } else {
        return '';
    }
}