Ejemplo n.º 1
0
                }
                addSessionMessage(lang("ACCOUNT_NOT_YET_ELIGIBLE", array("")), "notice");
            }
            //CLEAN UP
            unset($fname, $lname, $email, $zip, $city);
        }
    }
    // Add alerts to session for display
    foreach ($errors as $error) {
        addSessionAlert($error);
    }
} elseif (!empty($_GET['activation']) && !empty($_GET['uid'])) {
    $uid = $_GET['uid'];
    $activation = $_GET['activation'];
    $newuser = new RedcapPortalUser($uid);
    if ($newuser->isEmailTokenValid($activation)) {
        //SET EMAIL = VERIFIED
        $newuser->setEmailVerified();
        //SET USER IN SESSION
        $loggedInUser = new RedcapPortalUser($uid);
        setSessionUser($loggedInUser);
        //REDIRECT TO CONSENT
        header("Location: consent.php");
        exit;
    } else {
        // Invalid token match
        $errors[] = "The supplied email activation token is invalid or expired.  This can happen if you regenerated a new token but followed the link from an older request.";
        addSessionAlert("Invalid email activation token");
    }
}
$username_validation = $portal_config['useEmailAsUsername'] ? "required: true, email: true" : "required: true";