/**  
 * @see  verifyAll() Verification of First Name
 * @return boolean TRUE == OK, FALSE == empty
 */
function verifyAll()
{
    if (verifyCaptcha() && verifyUsername() && verifyEmail() && verifyFisrtName() && verifyLastName() && verifyPassword1() && verifyPassword2() && verifyTelephoneNumber()) {
        if (verifyCorrespond()) {
            //echo ' Passwords OK <br />';
            //echo '<br />Communication with the database<br />';
            include "PhpmyadminCommunication.php";
        }
        //echo 'Any field are filled <br />';
    }
}
Beispiel #2
0
 // not what we expect. You will need an IF block for each element you will
 // check (see above section 1c and 1d). The if blocks should also be in the
 // order that the elements appear on your form so that the error messages
 // will be in the order they appear. errorMsg will be displayed on the form
 // see section 3b. The error flag ($emailERROR) will be used in section 3c.
 if ($firstName == "") {
     $errorMsg[] = "Please enter your first name";
     $firstNameERROR = true;
 } elseif (!verifyAlphaNum($firstName)) {
     $errorMsg[] = "Your first name appears to have extra character.";
     $firstNameERROR = true;
 }
 if ($email == "") {
     $errorMsg[] = "Please enter your email address";
     $emailERROR = true;
 } elseif (!verifyEmail($email)) {
     $errorMsg[] = "Your email address appears to be incorrect.";
     $emailERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2d Process Form - Passed Validation
 //
 // Process for when the form passes validation (the errorMsg array is empty)
 //
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     //
Beispiel #3
0
$t = new Template('contact', intval($cgi['t']));

$filter = array(
	'contact-email'  => FILTER_VALIDATE_EMAIL,
	'contact-text'   => FILTER_UNSAFE_RAW,
	'contact-submit' => FILTER_SANITIZE_STRING,
	'e'              => FILTER_VALIDATE_INT
);

$filtered  = filter_input_array(INPUT_POST, $filter);
$filteredG = filter_input_array(INPUT_GET, $filter);

try {
	if ($filtered['contact-submit']) {
		if ($filtered['contact-email'] and verifyEmail($filtered['contact-email'])) {
			$c        = new Contact();
			$c->email = $filtered['contact-email'];
			$c->type  = CONTACT_TYPE_CONTACT_PAGE;
			$c->text  = base64_encode($filtered['contact-text']);
			$c->date  = time();
			$c->done  = 0;
			$id = $c->create();
			
			if (!$id) {
				throw new Exception('Error processing, please submit again');
			}
			else {
				header('Location: contact.php?e=1');
				exit;
			}
Beispiel #4
0
		$t->nation     = $nation    = max(0, min($filtered['register-nation'], 4));
		$t->rules      = $rules     = $filtered['register-rules'   ];
		$t->referrerId = $filtered['register-referrer'];
		$captcha       = $filtered['register-captcha' ];
		
		$uLength = strlen($username);
		
		if (!User::validateUsername($username)) {
			throw new Exception('Invalid Username');
		}
		
		if ($email != $emailv) {
			throw new Exception('The Email addresses do not match'); 
		}
	
		if (!$email or !verifyEmail($email)) {
			throw new Exception('Invalid Email address');
		}

		if (stripos($email, "ww2game.net") !== false) {
			throw new Exception('Invalid Email address');
		}
	
		if (!$rules) {
			throw new Exception('You must read, and agree to, the Rules and Terms of Service');
		}
		
		if ($captcha != $_SESSION['number']) {
			throw new Exception('You failed to match the captcha to the correct number');
		}
		
Beispiel #5
0
<?php

// include SMTP Email Validation Class
require_once 'verify_mail.class.php';
// the email to validate
$email = '*****@*****.**';
// an optional sender
$sender = '*****@*****.**';
print_r(verifyEmail($email, $sender, true));
     returnAjax(removeTOTP($_REQUEST));
     break;
 case 'sendtotptext':
     returnAjax(sendTOTPText($_REQUEST));
     break;
 case 'totpstatus':
     returnAjax(hasTOTP($_REQUEST));
     break;
 case 'cansms':
     returnAjax(canSMS($_REQUEST));
     break;
 case 'verifyphone':
     returnAjax(verifyPhone($_REQUEST));
     break;
 case 'verifyemail':
     returnAjax(verifyEmail($_REQUEST));
     break;
 case 'addalternateemail':
     returnAjax(addAlternateEmail($_REQUEST));
     break;
 case 'removeaccount':
     returnAjax(removeAccount($_REQUEST));
     break;
 case 'verifynewuser':
     returnAjax(verifyUserAuth($_REQUEST));
     break;
 case 'startpasswordreset':
     returnAjax(doStartResetPassword($_REQUEST));
     break;
 case 'finishpasswordreset':
     returnAjax(finishResetPassword($_REQUEST));
Beispiel #7
0
 if(empty($lastName)){
    $errorMsg[]="Please enter your Last Name";
    $lastNameERROR = true;
 } else {
    $valid = verifyText ($lastName); /* test for non-valid  data */
    if (!$valid){ 
        $errorMsg[]="Last Name must be letters and numbers, spaces, dashes and single quotes only.";
        $lastNameERROR = true;
    }
 }
 
     if(empty($email)){
    $errorMsg[]="Please enter your Email";
    $emailERROR = true;
 } else {
    $valid = verifyEmail ($email); /* test for non-valid  email */
    if (!$valid){ 
        $errorMsg[]="Email must be valid";
        $emailERROR = true;
    }
 }
 
         if(empty($credit)){
    $errorMsg[]="Please enter your credit card";
    $creditERROR = true;
 } else {
    $valid = verifyAlphaNum ($credit); /* test for non-valid  email */
    if (!$valid){ 
        $errorMsg[]="Credit card must be valid";
        $creditERROR = true;
    }
Beispiel #8
0
 // not what we expect. You will need an IF block for each element you will
 // check (see above section 1c and 1d). The if blocks should also be in the
 // order that the elements appear on your form so that the error messages
 // will be in the order they appear. errorMsg will be displayed on the form
 // see section 3b. The error flag ($emailERROR) will be used in section 3c.
 if ($userID == "") {
     $errorMsg[] = "Please enter a User ID";
     $firstNameERROR = true;
 } elseif (!verifyAlphaNum($userID)) {
     $errorMsg[] = "Your User ID appears to contain a non-alphanumerical character.";
     $firstNameERROR = true;
 }
 if ($fldEmail == "") {
     $errorMsg[] = "Please enter your email";
     $emailERROR = true;
 } elseif (!verifyEmail($fldEmail)) {
     $errorMsg[] = "Incorrect email address";
     $emailERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2d Process Form - Passed Validation
 //
 // Process for when the form passes validation (the errorMsg array is empty)
 //
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     //
{
    $query = "select * from algorea_registration where mailValidationHash= ?;";
    $sth = $db->prepare($query);
    $sth->execute(array($hash));
    $res = $sth->fetch();
    if (!$res) {
        echo json_encode(array('success' => false, 'message' => 'Impossible de vérifier l\'email'));
        return;
    }
    if ($res['mailValidated'] == 1) {
        echo json_encode(array('success' => false, 'message' => 'Email déjà vérifié !'));
        return;
    }
    $query = "update algorea_registration set mailValidated = 1 where mailValidationHash = ?;";
    $sth = $db->prepare($query);
    $sth->execute(array($hash));
    echo json_encode(array('success' => true));
}
if ($action === 'getInfos') {
    getInfos($_POST['code'], $db);
} else {
    if ($action === 'registerInfos') {
        registerInfos($_POST['infos'], $db);
    } else {
        if ($action === 'verifyEmail') {
            verifyEmail($_POST['hash'], $db);
        } else {
            echo json_encode(array('success' => false, 'message' => 'Action inconnue'));
        }
    }
}
Beispiel #10
0
 /**
  * [optOut used to remove the input email from the promo email table]
  * @return [bool] [true if the email was found and removed, false if the email was not found]
  */
 public function optOut()
 {
     # return data
     $data = array();
     # was an email input?
     $email = $this->input->post('email');
     $data['email'] = $email;
     if (verifyEmail($email)) {
         # we received a valid input, try to remove it and return the result to the UI
         $email_removed = $this->store_m->removePromoEmail($email);
         $data['email_removed'] = $email_removed;
     } elseif (!empty($email)) {
         # an invalid email was entered
         $data['invalid'] = true;
     } else {
         # nothing was entered
     }
     $this->renderUI("optout", $data);
 }
Beispiel #11
0
 $email = @$_POST['email'];
 $message = @$_POST['message'];
 // if magic quotes on, remove Magic Quotes effect
 if (get_magic_quotes_gpc()) {
     $name = stripslashes($name);
     $email = stripslashes($email);
     $message = stripslashes($message);
 }
 //Validate user input. Create error array to store errors
 $error_msg = array();
 $valid = verifyAlphaNum($name, 'Write your name here.');
 if (!$valid) {
     $error_msg[] = 'Please provide a valid name.';
     $name_error = '<span class="error">Name must be letters, numbers, spaces, and dashes only.</span>';
 }
 $valid = verifyEmail($email, 'Write your email address');
 if (!$valid) {
     $error_msg[] = 'Please provide a valid email address.';
     $email_error = '<span class="error">Email must be a valid format (e.g. john@yahoo.com).</span>';
 }
 $message = cleanText($message);
 if ($message == 'Write your message here.') {
     $error_msg[] = 'Please provide a valid message.';
     $message_error = "<span class=\"error\">Message can only contain letters, numbers and basic punctuation \" ' - ? ! </span>";
 }
 // if no errors, send email
 if (count($error_msg) === 0) {
     $headers = "MIME-Version: 1.0" . "\r\n";
     $headers .= "Content-type: text/html; charset=utf-8" . "\r\n";
     /* additional headers */
     $headers .= 'From:' . FROM_ADDRESS . "\r\n";
Beispiel #12
0
                                        <li class="active"><a href="#home" data-toggle="tab">Account Information</a>
                                        </li>
                                        <li><a href="#password" data-toggle="tab">Password</a>
                                        </li>
                                    </ul>

                                    <!-- Tab panes -->
                                    <div class="tab-content">
                                        <div class="tab-pane fade in active" id="home">
                                            <h4>Account Information</h4>
                                            <?php 
include './account_information.php';
if (!isset($_POST["accountInfoSubmit"])) {
    displayAccountInformation($_SESSION["admin_username"], "");
} else {
    if (verifyEmail($_POST["email"])) {
        if (submitAccountInformation($_SESSION["admin_username"], trim($_POST["firstName"]), trim($_POST["lastName"]), trim($_POST["email"]))) {
            $_SESSION['admin_username'] = $_POST["email"];
            displayAccountInformation($_SESSION["admin_username"], "success");
        } else {
            displayAccountInformation($_SESSION["admin_username"], "fail");
        }
    } else {
        displayAccountInformation($_SESSION["admin_username"], "fail_email");
    }
}
?>
                                        </div>    
                                        <div class="tab-pane fade" id="password">
                                            <h4>Password</h4>
                                            <?php 
Beispiel #13
0
 // not what we expect. You will need an IF block for each element you will
 // check (see above section 1c and 1d). The if blocks should also be in the
 // order that the elements appear on your form so that the error messages
 // will be in the order they appear. errorMsg will be displayed on the form
 // see section 3b. The error flag ($emailERROR) will be used in section 3c.
 if ($studentNetId == "") {
     $errorMsg[] = "Please enter your net ID";
     $studentNetIdError = true;
 } elseif (!verifyAlphaNum($studentNetId)) {
     $errorMsg[] = "Your net ID appears to have extra character.";
     $studentNetIdError = true;
 }
 if ($studentEmail == "") {
     $errorMsg[] = "Please enter your email address";
     $emailERROR = true;
 } elseif (!verifyEmail($studentEmail)) {
     $errorMsg[] = "Your email address appears to be incorrect.";
     $emailERROR = true;
 }
 if ($advisorNetId == "") {
     $errorMsg[] = "Please enter your advisor's net ID";
     $advisorNetIdError = true;
 } elseif (!verifyAlphaNum($advisorNetId)) {
     $errorMsg[] = "Their net ID appears to have extra character.";
     $advisorNetIdError = true;
 }
 if ($catalogYear == "select") {
     $errorMsg[] = "Please choose the catalog year";
     $catalogYearError = true;
 }
 if ($major == "select") {
include "../utils/functions.php";
include "../utils/admin_functions.php";
if (!isset($_SESSION['adminsession'])) {
    header("location: ./login.php");
}
if (isset($_POST['adminsettings'])) {
    if ($_POST['adminuser'] == "") {
        $error = "You did not enter an admin username";
    } else {
        if ($_POST['adminpass'] == "") {
            $error = "You did not enter an admin password";
        } else {
            if ($_POST['adminemail'] == "") {
                $error = "You did not enter an admin email";
            } else {
                if (!verifyEmail($_POST['adminemail'])) {
                    $error = "You did not enter a valid admin email";
                } else {
                    mysql_query("UPDATE `" . $table_prefix . "settings` SET `value` = '" . mysql_real_escape_string($_POST['adminemail']) . "' WHERE `setting` = 'admin_email';");
                    mysql_query("UPDATE `" . $table_prefix . "settings` SET `value` = '" . mysql_real_escape_string($_POST['adminuser']) . "' WHERE `setting` = 'admin_username';");
                    mysql_query("UPDATE `" . $table_prefix . "settings` SET `value` = '" . mysql_real_escape_string($_POST['adminpass']) . "' WHERE `setting` = 'admin_password';");
                    $success = "The admin settings have been successfully updated.";
                }
            }
        }
    }
}
$pagename = "Admin Profile Settings";
include "./admin_header.php";
?>
  <div id="content">
Beispiel #15
0
require_once '../dirHandler.php';
$f3 = (require $GLOBALS['dirLibs'] . '/external/fatfree/lib/base.php');
require_once $GLOBALS['dirLibs'] . '/external/meekrodb.2.2.class.php';
require_once $GLOBALS['dirCore'] . '/dbConfig.inc.php';
require_once $GLOBALS['dirCore'] . '/config.inc.php';
require_once $GLOBALS['dirCore'] . '/common.inc.php';
#echo $GLOBALS['dirRoot'];
$uid = "";
$email = $_POST['email'];
$rememberMe = $_POST['rememberMe'] == 1;
$emailHash = sha1($email);
$hash = $_POST['hash'];
$account = DB::queryFirstRow("SELECT * FROM CWM_User WHERE Email=%?", $email);
$isNewuser = true;
$isVerified = false;
$isEmailValid = verifyEmail($email);
$isPasswordValid = $hash != sha1("");
$isFirstTime = 1;
if ($isEmailValid && $isPasswordValid) {
    // No user found
    if (is_null($account)) {
        DB::insert('CWM_User', array('Id' => 0, 'Email' => $email, 'EmailHash' => $emailHash, 'Password' => $hash, 'Status' => 0, 'IsFirstTime' => $isFirstTime));
        $uid = DB::insertId();
        $subject = "Welcome to CodeWithMe";
        $message = "\n\t\t<html>\n\t\t<head>\n\t\t  <title>Welcome to CodeWithMe</title>\n\t\t</head>\n\t\t<body>\n\t\t  Thank you for signing up on CodeWithMe!\n\t\t  <br />\n\t\t  Please <a href='http://localhost/CodeWithMe/core/controller/activate.php?id=" . $emailHash . "'>activate your account</a>\n\t\t</body>\n\t\t</html>\n\t\t";
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=utf-8' . '\\r\\n';
        sendEmail($email, $subject, $message, $headers);
    } else {
        $account = DB::queryFirstRow("SELECT * FROM CWM_User WHERE Email=%? AND Password=%?", $email, $hash);
        $uid = $account['Id'];
Beispiel #16
0
         }
     } else {
         displayAccountForm("fail", $us_state_abbrevs, $relationships);
     }
     if (verifyPassword($_POST["newPassword1"], $_POST["newPassword2"])) {
         if (submitPassword($_POST["newPassword1"])) {
             displayPasswordForm("manual");
         } else {
             displayPasswordForm("tech_diff");
         }
     } else {
         displayPasswordForm("fail");
     }
 } elseif (!empty($_POST["fname"]) && !empty($_POST["lname"]) && !empty($_POST["duedate"]) && !empty($_POST["status"]) && !empty($_POST["address"]) && !empty($_POST["city"]) && !empty($_POST["state"]) && !empty($_POST["zip"]) && !empty($_POST["phone"]) && !empty($_POST["email"]) && !empty($_POST["emergency_fname"]) && !empty($_POST["emergency_lname"]) && !empty($_POST["emergency_phone"]) && !empty($_POST["emergency_relationship"]) && $_POST["automatedPasswordReset"] == TRUE) {
     $accountInfoStatus = FALSE;
     if (verifyEmail(trim($_POST["email"]))) {
         if (submitAccountInformation($_POST["fname"], $_POST["lname"], $_POST["duedate"], $_POST["status"], $_POST["address"], $_POST["city"], $_POST["state"], $_POST["zip"], preg_replace("/[^0-9]/", "", $_POST["phone"]), $_POST["email"], $_POST["notes"], $_POST["adminnotes"], $_POST["buttonMemberID"]) && submitEmergencyContactInformation($_POST["emergency_fname"], $_POST["emergency_lname"], preg_replace("/[^0-9]/", "", $_POST["emergency_phone"]), $_POST["emergency_relationship"], $_POST["buttonMemberID"])) {
             displayAccountForm("success", $us_state_abbrevs, $relationships);
             $accountInfoStatus = TRUE;
         } else {
             displayAccountForm("tech_diff", $us_state_abbrevs, $relationships);
         }
         if ($accountInfoStatus) {
             if (automatedPasswordReset()) {
                 displayPasswordForm("success_automated");
             } else {
                 displayPasswordForm("tech_diff_automated");
             }
         } else {
             displayPasswordForm("verify_account_info");
         }
Beispiel #17
0
<?php

include 'verify.php';
//This email ID doesn't exist
echo 'Find below test for <b>jkdihenkar2@gmail.com</b> : <br>';
print_r(verifyEmail('*****@*****.**', '*****@*****.**', true));
echo '<br><br>';
//This email ID exist
echo 'Find below test for <b>jaydihenkar@gmail.com</b> : <br>';
print_r(verifyEmail('*****@*****.**', '*****@*****.**', true));
echo '<br><br>';