$messages[] = '<pre>$email_to_check: ' . print_r( $email_to_check, true ) . '</pre>';
$verify_email = filter_var( $_REQUEST['email_verify'], FILTER_VALIDATE_EMAIL );
$messages[] = '<pre>$verify_email: ' . print_r( $verify_email, true ) . '</pre>';
- if ( $email_to_check !== $verify_email ) {
+ if ( !$email_to_check ) {
+ $error = true;
+ $messages[] = $errors['email'] = "<span style='color: red;'>Not a valid Email!</span>";
+ }
+ if ( $email_to_check != $verify_email ) {
// Emails don't match give error message
$error = true;
$messages[] = $errors['email'] = "<span style='color: red;'>Emails don't match!</span>";
}
+ // Check for wordpress user with same email address
+ $wpUser = get_user_by( 'email', $email_to_check );
+ if ( is_object( $wpUser ) && $wpUser->ID ) {
+ $error = true;
+ $messages[] = $errors['email'] = "<span style='color: red;'>There's a user with that email already!</span>";
+ }
+ $passwd = filter_var( $_REQUEST['password'], FILTER_SANITIZE_STRING );
+ $confirm_passwd = filter_var( $_REQUEST['confirm_password'], FILTER_SANITIZE_STRING );
+ if ( $passwd != $confirm_passwd ) {
+ $error = true;
+ $messages[] = $errors['password'] = "<span style='color: red;'>Passwords don't match!</span>";
+ }
+ // if ( isset( $passwd ) && preg_match()
+ // $messages[] = '<pre>$wpUser: ' . print_r( $wpUser, true ) . '</pre>';
+ // Password test.
+ // Verify they match and they aren't weak passwords.
// Process the main form
name="email"
{if isset($smarty.request.email) && $smarty.request.email}value="{$smarty.request.email}"{/if}
required />
- {if $errors.email}{$errors.email}{/if}
</div>
</div>
<div class="glm-billing-field glm-billing-right-half">
required />
</div>
</div>
+ {if $errors.email}<div>{$errors.email}</div>{/if}
{* START - Custom Fields part for MiGCSA *}
<div class="glm-billing-field">
<div class="glm-billing-label">
required />
</div>
</div>
+ <div>
+ The password must be at least 8 characters and include at least one number, one letter, and at least one special character. (# . - _ , $ % & !)
+ </div>
<div class="glm-billing-field glm-billing-left-half">
<div class="glm-billing-label glm-required">
Password
</div>
<div class="glm-billing-input">
<input
- type="text"
+ type="password"
name="password"
+ {literal}pattern="(?=.*\d)(?=.*[a-z]).{6,}"{/literal}
{if isset($smarty.request.password) && $smarty.request.password}value="{$smarty.request.password}"{/if}
required />
</div>
</div>
<div class="glm-billing-input">
<input
- type="text"
+ type="password"
name="confirm_password"
+ {literal}pattern="(?=.*\d)(?=.*[a-z]).{6,}"{/literal}
{if isset($smarty.request.confirm_password) && $smarty.request.confirm_password}value="{$smarty.request.confirm_password}"{/if}
required />
</div>
</div>
+ {if $errors.password}<div>{$errors.password}</div>{/if}
</fieldset>