aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/zregister.php22
1 files changed, 1 insertions, 21 deletions
diff --git a/mod/zregister.php b/mod/zregister.php
index fbdc4e260..2cde25469 100644
--- a/mod/zregister.php
+++ b/mod/zregister.php
@@ -7,27 +7,7 @@ function zregister_init(&$a) {
$cmd = ((argc() > 1) ? argv(1) : '');
if($cmd === 'email_check.json') {
- $result = array('error' => false, 'message' => '');
- $email = $_REQUEST['email'];
- if(! strlen($email))
- json_return_and_die($result);
-
- if((! valid_email($email)) || (! validate_email($email)))
- $result['message'] .= t('Not a valid email address') . EOL;
- elseif(! allowed_email($email))
- $result['message'] = t('Your email domain is not among those allowed on this site');
- else {
- $r = q("select account_email from account where account_email = '%s' limit 1",
- dbesc($email)
- );
- if(count($r)) {
- $result['message'] .= t('Your email address is already registered at this site.');
- }
- }
- if($result['message'])
- $result['error'] = true;
-
-
+ $result = check_account_email($_REQUEST['email']);
json_return_and_die($result);
}