diff options
-rw-r--r-- | Zotlabs/Module/Register.php | 39 | ||||
-rw-r--r-- | include/account.php | 8 |
2 files changed, 14 insertions, 33 deletions
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index 17280c474..33a49c7d7 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -280,44 +280,17 @@ class Register extends Controller { return; } - } else { - - // no ivc entered - if (!$invonly) { - // possibly the email is just in use ? - $reg = q("SELECT * from register WHERE reg_vital = 1 AND reg_email = '%s'", - dbesc($email) - ); - - if (!$reg) { - $act = q("SELECT * from account WHERE account_email = '%s'", - dbesc($email) - ); - } - - // in case an invitation was made but the invitecode was not entered, better ignore. - // goaway(z_root() . '/regate/' . bin2hex($reg['email'])); - - if (! $reg && !$act) { - // email useable - $well = true; - } else { - $msg = t('Email address already in use') . EOL; - notice($msg); - // problem, the msg tells to anonymous about existant email addrs - // use another msg instead ? TODO ? - // on the other hand can play the fail2ban game - zar_log('ZAR0237E ' . $msg . ' (' . $email . ')'); - return; - } - - } else { + } + else { + if (!$invonly ) { + $well = true; + } + else { $msg = t('Registration on this hub is by invitation only') . EOL; notice($msg); zar_log('ZAR0233E ' . $msg); return; } - } // check max daily registrations after we have dealt with the invitecode diff --git a/include/account.php b/include/account.php index 4c5437594..399756ed1 100644 --- a/include/account.php +++ b/include/account.php @@ -1295,3 +1295,11 @@ function get_pending_accounts($get_all = false) { return $r; } + +function remove_expired_registrations() { + q("DELETE FROM register WHERE reg_expire < '%s' OR reg_expire = '%s' AND (reg_flags & %d) > 0", + dbesc(datetime_convert()), + dbesc(NULL_DATE), + dbesc(ACCOUNT_UNVERIFIED) + ); +} |