0e9b3cf4 by Jeff Balicki

recaptcha

1 parent b91a8ab1
......@@ -196,11 +196,7 @@ function activate($key, $password_validation = null) {
// Do I need to re-sanatize this?
$meta = unserialize($signup->meta);
if (!is_null($password_validation)) {
if ($meta['password'] != $password_validation) {
throw new Exception('Bad password match');
}
}
$id = _create_user($signup->user_login, $meta['password'], $signup->user_email);
unset($meta['password']);
......@@ -240,18 +236,18 @@ class Validation extends Common\Validation {
*/
protected function username($val) {
if (empty($val)) {
throw new Exception('<li>'.__('Username is blank', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Username is blank', 'cicbv-front-end').'</li>');
}
require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'registration.php');
if (!validate_username($val)) {
throw new Exception(
'<li>'.__('Username must be at least 4 characters, letters and numbers only', CBV_DOMAIN).'</li>'
'<li>'.__('Username must be at least 4 characters, letters and numbers only', 'cicbv-front-end').'</li>'
);
}
if (username_exists($val)) {
throw new Exception('<li>'.__('Username already exists', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Username already exists', 'cicbv-front-end').'</li>');
}
}
......@@ -262,18 +258,18 @@ class Validation extends Common\Validation {
*/
protected function password($val) {
if (empty($val)) {
throw new Exception('<li>'.__('Password can not be blank', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Password can not be blank', 'cicbv-front-end').'</li>');
}
if (isset($val[PASS_MAX_LEN])) {
throw new Exception(
'<li>'.sprintf(__('Password can not be longer than %d characters.', CBV_DOMAIN), PASS_MAX_LEN).'</li>'
'<li>'.sprintf(__('Password can not be longer than %d characters.', 'cicbv-front-end'), PASS_MAX_LEN).'</li>'
);
}
if (preg_match('/(\\\\|\\\'|"| )+/i', $val)) {
throw new Exception(
'<li>'.__('Password can not contain spaces, backslashes (\) or quotes', CBV_DOMAIN).'</li>'
'<li>'.__('Password can not contain spaces, backslashes (\) or quotes', 'cicbv-front-end').'</li>'
);
}
}
......@@ -284,11 +280,11 @@ class Validation extends Common\Validation {
*/
protected function email($val) {
if (!(boolean)filter_var($val, FILTER_VALIDATE_EMAIL)) {
throw new Exception('<li>'.__('Invalid email address', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Invalid email address', 'cicbv-front-end').'</li>');
}
if (false !== email_exists($val)) {
throw new Exception('<li>'.__('Email address already registered', CBV_DOMAIN).' </li > ');
throw new Exception('<li>'.__('Email address already registered', 'cicbv-front-end').' </li > ');
}
}
}
......