diff options
author | Mario <mario@mariovavti.com> | 2021-05-06 13:54:02 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-05-06 13:54:02 +0000 |
commit | 43260891b77a72ab85a613efb45186b2804d7f9b (patch) | |
tree | 7c1b1fa8206deba311c4ece7092bc75934674bbb | |
parent | aef035034639211587bda9b98ba46514dac409a4 (diff) | |
download | volse-hubzilla-43260891b77a72ab85a613efb45186b2804d7f9b.tar.gz volse-hubzilla-43260891b77a72ab85a613efb45186b2804d7f9b.tar.bz2 volse-hubzilla-43260891b77a72ab85a613efb45186b2804d7f9b.zip |
register: we have already checked for existing email in check_account_email()
-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) + ); +} |