示例#1
0
<?php

require_once "models/config.php";
//REDIRECT USERS THAT ARE ALREADY LOGGED IN TO THE PORTAL PAGE
if (isUserLoggedIn()) {
    $destination = isUserActive() ? $websiteUrl . "dashboard/index.php" : $websiteUrl . "consent.php";
    header("Location: " . $destination);
    exit;
}
if (isset($_GET["session_clear"])) {
    unset($_SESSION[SESSION_NAME]['login_attempts']);
    header("Location: " . $websiteUrl . "login.php");
}
$attempts_remaining = isset($_SESSION[SESSION_NAME]['login_attempts']) ? $_SESSION[SESSION_NAME]['login_attempts'] : 4;
$username_label = "";
$badlogin = "";
//--------------------------------------------------------------------
// Login Posted
if (!empty($_POST) && isset($_POST['new_login'])) {
    $errors = array();
    $username = trim($_POST["username"]);
    $password = trim($_POST["password"]);
    $badlogin = $username;
    //Perform some basic validation
    if ($username == "") {
        $errors[] = lang("ACCOUNT_SPECIFY_USERNAME");
    }
    if ($password == "") {
        $errors[] = lang("ACCOUNT_SPECIFY_PASSWORD");
    }
    //End data validation
示例#2
0
function requireActiveUserAccount()
{
    requireUserAccount();
    if (!isUserActive()) {
        $message = "Please complete your profile setup";
        redirectToProfile($message);
    }
    return;
}
示例#3
0
<?php

require_once "models/config.php";
//REDIRECT USERS THAT ARE ALREADY LOGGED IN AND CONSENTED TO THE PORTAL PAGE
if (isUserLoggedIn() && isUserActive()) {
    $destination = $websiteUrl . "dashboard/index.php";
    header("Location: " . $destination);
    exit;
}
if (!isUserLoggedIn()) {
    $destination = $websiteUrl . "login.php";
    header("Location: " . $destination);
    exit;
}
if (!empty($_POST) && isset($_POST['consented'])) {
    //REDIRECT TO SECURITY QUESTIONS
    header("Location: account_setup.php");
    exit;
}
$pg_title = "Consent | {$websiteName}";
$body_classes = "consent";
include "models/inc/gl_header.php";
?>
<div id="content" class="container" role="main" tabindex="0">
  <div class="row"> 
	<div id="main-content" class="col-md-8 col-md-offset-2 consent" role="main">
		<div class="well row">
			<div  class="consent_disclaim">
				<ul>
					<li>We need your permission before we can ask you any questions, so please read the following Informed Consent Document</li>
					<li>The initial survey will take 15 – 20 minutes to complete – but you don't need to fill it all out at one time</li>
示例#4
0
<?php

require_once "../models/config.php";
//REDIRECT USERS THAT ARE NOT LOGGED IN
if (!isUserLoggedIn()) {
    $destination = $websiteUrl . "login.php";
    header("Location: " . $destination);
    exit;
} elseif (!isUserActive()) {
    $destination = $websiteUrl . "consent.php";
    header("Location: " . $destination);
    exit;
} else {
    //if they are logged in and active
    //find survey completion and go there?
    // GET SURVEY LINKS
    include "../models/inc/surveys.php";
}
if (isset($_GET["survey_complete"])) {
    //IF NO URL PASSED IN THEN REDIRECT BACK
    $surveyid = $_GET["survey_complete"];
    foreach ($surveys as $index => $instrument_event) {
        if ($instrument_event["instrument_name"] != $surveyid) {
            continue;
        }
        if ($instrument_event["survey_complete"]) {
            $success_msg = "Thanks! You've completed the survey: <strong class='surveyname'>'" . $instrument_event["instrument_label"] . "'.</strong> You've been awarded a : <span class='fruit " . $fruits[$index] . "'></span> ";
            if (isset($surveys[$index + 1])) {
                $nextlink = "survey.php?url=" . urlencode($surveys[$index + 1]["survey_link"]);
                $success_msg .= "Get the whole fruit basket!<br> <a class='takenext' href='{$nextlink}'>Take the next '" . $surveys[$index + 1]["instrument_label"] . "' survey now!</a>";
            } else {