예제 #1
0
<?php

require_once "../../global.php";
if (Session::isLoggedIn()) {
    Session::signOut();
}
// get email, if exists
$email = @Filter::email($_GET['email']);
$soup = new Soup();
if (!empty($email)) {
    $soup->set('email', $email);
}
$soup->render('site/page/consent_adult');
예제 #2
0
     exit(json_encode($json));
 }
 // new passwords provided?
 if ($pw != "" || $pw2 != "") {
     // do the passwords match?
     if ($pw != $pw2) {
         $json = array('error' => 'Sorry, your new passwords do not match.');
         exit(json_encode($json));
     }
 }
 // validate email address
 if ($email == "") {
     $json = array('error' => 'You must provide a valid email address.');
     exit(json_encode($json));
 }
 if (!Filter::email($email)) {
     $json = array('error' => 'You must provide a valid email address.');
     exit(json_encode($json));
 }
 // must provide birthdate
 if ($month == "0" || $year == "0") {
     $json = array('error' => 'You must select a valid birth month and year to register.');
     exit(json_encode($json));
 }
 // convert birthdate to MySQL format
 $dob = $year . "-" . $month . "-01";
 // required fields
 $user->setEmail($email);
 if ($pw != "") {
     // convert password to MD5 hash
     $pw = sha1($pw);
예제 #3
0
파일: Vars.php 프로젝트: jbzoo/utils
 /**
  * Validate emil
  *
  * @param $email
  * @return mixed
  *
  * @deprecated See JBZoo\Utils\Email
  */
 public static function email($email)
 {
     return Filter::email($email);
 }
예제 #4
0
    $body .= '<p>Once you log in, you can change this password to something more memorable by clicking the "Edit" button on your <a href="' . Url::user($user->getID()) . '">profile</a> page.</p>';
    $body .= '<p>Note: If you did not request this password change, please contact the ' . PIPELINE_NAME . ' staff.</p>';
    $newEmail = array('to' => $user->getEmail(), 'subject' => '[' . PIPELINE_NAME . '] Password changed for ' . $user->getUsername(), 'message' => $body);
    Email::send($newEmail);
    // redirect
    Session::setMessage('Your password was reset. Please check your email for the new password.');
    $json = array('success' => '1', 'successUrl' => Url::logIn());
    exit(json_encode($json));
} elseif ($action == 'login') {
    // assign POST vars to local vars after escaping and removing unwanted spacing.
    if (!empty($_POST['username']) && !empty($_POST['password'])) {
        $username = Filter::text($_POST['username']);
        $password = sha1(Filter::text($_POST['password']));
        $referer = Filter::text($_POST['referer']);
        // figure out if user provided username or email address
        if (Filter::email($username)) {
            $user = User::loadByEmail($username);
        } else {
            $user = User::loadByUsername($username);
        }
        if ($user != null) {
            if ($password == $user->getPassword()) {
                // remember user?
                $remember = Filter::text($_POST['remember']);
                $remember = $remember == 'remember' ? true : false;
                // sign in
                Session::signIn($user->getID(), $remember);
                // send us onward
                if (!empty($referer) && $referer != Url::forgotPassword()) {
                    $json = array('success' => '1', 'successUrl' => $referer);
                } else {
예제 #5
0
<?php

require_once "../../global.php";
$email = Filter::email($_POST['email']);
$name = Filter::text($_POST['name']);
// must provide valid email
if (empty($email)) {
    $json = array('error' => 'You must provide a valid email address.');
    exit(json_encode($json));
}
// save consent
$consent = new Consent(array('email' => $email, 'name' => $name));
$consent->save();
// email confirmation
$body = '<p>You have consented to participate in a Georgia Tech research study looking at how people collaborate online.</p>';
if (!empty($name)) {
    $body .= "<p>Additionally, you have requested that we use your real name if we refer to you in our publications.</p>";
}
$body .= '<p>The consent form is available for viewing and printing at <a href="http://www.scribd.com/doc/66688220/Adult-Web-Consent-Testing?secret_password=4nzp5x09db318hcu9e2">this link</a>. Please retain a copy for your records.</p>';
$body .= '<p>If you have any questions or concerns, please contact the research team at <a href="mailto:' . CONTACT_EMAIL . '">' . CONTACT_EMAIL . '</a>. Thank you for your participation!</p>';
$body .= '<p>-- <a href="http://pipeline.cc.gatech.edu/">The Pipeline team</a> at Georgia Tech</p>';
$newEmail = array('to' => $email, 'subject' => 'Georgia Tech study consent form', 'message' => $body);
Email::send($newEmail);
// send us back
Session::setMessage("Consent form complete! Please register an account.");
$json = array('success' => '1', 'successUrl' => Url::register($email));
echo json_encode($json);