aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-07 19:12:35 -0700
committerFriendika <info@friendika.com>2011-07-07 19:12:35 -0700
commit2d2b5006397bb6ac90f7e33e6022000ec836e86e (patch)
tree9a22d508d848ab02bff88fd24a592f686ea75ac1 /mod/register.php
parentd99dfbe4ef50c2928cd2a45bf0b2cf62bba5b1e9 (diff)
downloadvolse-hubzilla-2d2b5006397bb6ac90f7e33e6022000ec836e86e.tar.gz
volse-hubzilla-2d2b5006397bb6ac90f7e33e6022000ec836e86e.tar.bz2
volse-hubzilla-2d2b5006397bb6ac90f7e33e6022000ec836e86e.zip
input the admin email address during install/setup.
Diffstat (limited to 'mod/register.php')
-rw-r--r--mod/register.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/mod/register.php b/mod/register.php
index 7aaf74792..5fac9d79c 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -103,10 +103,15 @@ function register_post(&$a) {
$err .= t('Not a valid email address.') . EOL;
// Disallow somebody creating an account using openid that uses the admin email address,
- // since openid bypasses email verification.
+ // since openid bypasses email verification. We'll allow it if there is not yet an admin account.
- if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0) && strlen($openid_url))
- $err .= t('Cannot use that email.') . EOL;
+ if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0) && strlen($openid_url)) {
+ $r = q("SELECT * FROM `user` WHERE `email` = '%s' LIMIT 1",
+ dbesc($email)
+ );
+ if(count($r))
+ $err .= t('Cannot use that email.') . EOL;
+ }
$nickname = $_POST['nickname'] = strtolower($nickname);