aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-05-06 19:06:53 +0000
committerMario <mario@mariovavti.com>2021-05-06 19:06:53 +0000
commit1fd5f5c893d224a523ecf279ec65c1cf933b2065 (patch)
treec331e87d4f65fcdb6d7dbd3c9b9030e6911602cf
parent43260891b77a72ab85a613efb45186b2804d7f9b (diff)
downloadvolse-hubzilla-1fd5f5c893d224a523ecf279ec65c1cf933b2065.tar.gz
volse-hubzilla-1fd5f5c893d224a523ecf279ec65c1cf933b2065.tar.bz2
volse-hubzilla-1fd5f5c893d224a523ecf279ec65c1cf933b2065.zip
register: redirect unverified registration emails to the verification form
-rw-r--r--Zotlabs/Module/Register.php7
-rw-r--r--include/account.php26
2 files changed, 21 insertions, 12 deletions
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php
index 33a49c7d7..ecdcd90dd 100644
--- a/Zotlabs/Module/Register.php
+++ b/Zotlabs/Module/Register.php
@@ -116,9 +116,12 @@ class Register extends Controller {
if ($email) {
$email_result = check_account_email($email);
if ($email_result['error']) {
- notice($email_result['message'] . EOL);
+ if ($email_result['email_unverified']) {
+ goaway(z_root() . '/regate/' . bin2hex($email) . 'e');
+ }
return;
}
+
}
// case when an invited prepares the own account by supply own pw, accept tos, prepage channel (if auto)
@@ -282,7 +285,7 @@ class Register extends Controller {
}
else {
- if (!$invonly ) {
+ if (!$invonly) {
$well = true;
}
else {
diff --git a/include/account.php b/include/account.php
index 399756ed1..86132b411 100644
--- a/include/account.php
+++ b/include/account.php
@@ -34,23 +34,29 @@ function check_account_email($email) {
if(! strlen($email))
return $result;
- if(! validate_email($email))
- $result['message'] = t('The provided email address is not valid') . EOL;
- elseif(! allowed_email($email))
+ if(! validate_email($email)) {
+ $result['message'] = t('The provided email address is not valid');
+ }
+ elseif(! allowed_email($email)) {
$result['message'] = t('The provided email domain is not among those allowed on this site');
+ }
else {
- $r = q("select account_email from account where account_email = '%s' limit 1",
+ $account = q("select account_email from account where account_email = '%s' limit 1",
dbesc($email)
);
- if (!$r) {
- $r = q("select reg_did2 from register where reg_did2 = '%s' limit 1",
- dbesc($email)
- );
- }
- if($r) {
+ if ($account) {
$result['message'] = t('The provided email address is already registered at this site');
}
+
+ $register = q("select reg_did2 from register where reg_vital = 1 and reg_did2 = '%s' limit 1",
+ dbesc($email)
+ );
+ if ($register) {
+ $result['message'] = t('There is a pending registration for this address - click "Register" to continue verification');
+ $result['email_unverified'] = true;
+ }
}
+
if($result['message'])
$result['error'] = true;