diff options
author | Mario <mario@mariovavti.com> | 2021-04-28 14:23:53 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-04-28 14:23:53 +0200 |
commit | 36f041a1ffaf7e7eaf32d0dce2dc1a5169544df0 (patch) | |
tree | 8c72105ba0530c5eb9dd1d8b99a4719c6f49e3ce | |
parent | 0dd2e9004d0bd2d21a97244cfb37b65d1e2bad41 (diff) | |
download | volse-hubzilla-36f041a1ffaf7e7eaf32d0dce2dc1a5169544df0.tar.gz volse-hubzilla-36f041a1ffaf7e7eaf32d0dce2dc1a5169544df0.tar.bz2 volse-hubzilla-36f041a1ffaf7e7eaf32d0dce2dc1a5169544df0.zip |
cleanup
-rw-r--r-- | Zotlabs/Module/Register.php | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index cafddc175..2aa66b02c 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -66,8 +66,6 @@ class Register extends Controller { $sameip = intval(get_config('system','register_sameip', 3)); $arr = $_POST; $invite_code = ((x($arr,'invite_code')) ? notags(trim($arr['invite_code'])) : ''); - $invite_code = ((x($arr,'invite_code')) ? notags(trim($arr['invite_code'])) : ''); - $invite_code = ((x($arr,'invite_code')) ? notags(trim($arr['invite_code'])) : ''); $name = ''; $nick = ''; $email = ((x($arr,'email')) ? notags(punify(trim($arr['email']))) : ''); @@ -118,7 +116,6 @@ class Register extends Controller { if ($email) { $email_result = check_account_email($email); if ($email_result['error']) { - // msg! notice($email_result['message'] . EOL); return; } @@ -152,19 +149,12 @@ class Register extends Controller { } } - // s2 max daily - // msg? - if (!$is247 && self::check_reg_limits()['is']) return; - if (!$password) { - // msg! notice(t('No password provided') . EOL); return; } - // pw1 == pw2 if ($password !== $password2) { - // msg! notice(t('Passwords do not match') . EOL); return; } @@ -211,7 +201,7 @@ class Register extends Controller { break; } - if($email_verify && ($policy == REGISTER_OPEN || $policy == REGISTER_APPROVE) ) + if($email_verify && ($policy == REGISTER_OPEN || $policy == REGISTER_APPROVE)) $flags = ($flags | ACCOUNT_UNVERIFIED); // $arr has $_POST; @@ -295,23 +285,24 @@ class Register extends Controller { $icdone = false; // no ivc entered - if ( ! $invonly) { + if (!$invonly) { // possibly the email is just in use ? $reg = q("SELECT * from register WHERE reg_vital = 1 AND reg_email = '%s'", - dbesc('e' . $email)); + dbesc('e' . $email) + ); - if ( ! $reg) - $act = q("SELECT * from account WHERE account_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) { + if (! $reg && !$act) { // email useable - $well = true; - - } else { $msg = t('Email address already in use') . EOL; notice($msg); @@ -331,6 +322,12 @@ class Register extends Controller { } + // check max daily registrations after we have dealt with the invitecode + if (self::check_reg_limits()['is']) { + notice('Max registrations per day exceeded.'); + return; + } + if ($well) { if($policy == REGISTER_OPEN || $policy == REGISTER_APPROVE ) { @@ -454,7 +451,6 @@ class Register extends Controller { } - function get() { $registration_is = ''; |