function __construct($user_id)
 {
     if (empty($user_id)) {
         logIt("REDCap user created with missing user_id!", "ERROR");
         addSessionAlert("Error accessing user information.  Please try again later.");
         logout();
         die;
     }
     $this->user_id = $user_id;
     // Load the user attributes from API
     self::loadUser();
 }
Esempio n. 2
0
            header("Location: {$destination}");
        } else {
            // Invalid credentials
            //IF NOT A REGISTERED USER - KEEP EMAIL AND PREFILL ON REGISTER FORM
            $attempts_remaining--;
            $_SESSION[SESSION_NAME]['login_attempts'] = $attempts_remaining;
            if ($attempts_remaining < 1) {
                $errors[] = lang("FORGOTPASS_SUGGEST");
            } else {
                $errors[] = lang("ACCOUNT_USER_OR_PASS_INVALID") . "<br> Try again... " . $attempts_remaining . " attempts remaining.";
            }
        }
    }
    // Add errors messages to session
    foreach ($errors as $error) {
        addSessionAlert($error);
    }
}
$disabled = $attempts_remaining < 1 ? "disabled=disabled" : null;
$username_validation = $portal_config['useEmailAsUsername'] ? "required: true, email: true" : "required: true";
$pg_title = "Login : {$websiteName}";
$body_classes = "login";
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 logpass" role="main">
		<div class="well row">
			<form id="loginForm" name="loginForm" class="form-horizontal loginForm col-md-6 " action="login.php" method="post" novalidate="novalidate">
				<h2>Please Login to continue</h2>
				<div class="form-group">
Esempio n. 3
0
         addSessionMessage("Password Updated", "success");
     }
 } else {
     logIt("Change Password: Invalid Request", "INFO");
 }
 //PASSWORD SECURITY QUESTIONS
 $password_reset_data = array();
 $all_valid = true;
 foreach ($password_reset_pairs as $i => $pair) {
     $q = isset($_POST[$pair['question']]) ? $_POST[$pair['question']] : null;
     $a = isset($_POST[$pair['answer']]) ? $_POST[$pair['answer']] : null;
     $password_reset_data[$i]['question'] = $q;
     $password_reset_data[$i]['answer'] = $a;
     if (empty($q) || empty($a)) {
         // Invalid responses
         addSessionAlert("Invalid password reset values for question {$i}");
         $all_valid = false;
     } else {
         $a = hashSecurityAnswer($a);
         $loggedInUser->updatePasswordReset($pair['question'], $pair['answer'], $q, $a);
     }
 }
 if ($all_valid) {
     addSessionMessage("Password recovery questions updated!", 'success');
 }
 if ($valid && $all_valid) {
     //THEY ARE CONSENTED, SET ACCOUNT ACTIVE
     $loggedInUser->setActive();
     //REDIRECT TO THE DASHBOARD
     include "models/inc/surveys.php";
     header("Location: dashboard/survey.php?url=" . urlencode($surveys[0]["survey_link"]));
Esempio n. 4
0
    $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";
$pg_title = "Register | {$websiteName}";
$body_classes = "login register";
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 registerAccount" role="main">
		<div class="well row">
		  <?php 
include "models/inc/form_register.php";
?>
	  	</div>