diff options
-rw-r--r-- | Zotlabs/Module/Regate.php | 23 | ||||
-rw-r--r-- | Zotlabs/Module/Register.php | 26 | ||||
-rw-r--r-- | view/en/register_verify_member.tpl | 11 | ||||
-rw-r--r-- | view/tpl/admin_site.tpl | 2 |
4 files changed, 29 insertions, 33 deletions
diff --git a/Zotlabs/Module/Regate.php b/Zotlabs/Module/Regate.php index 6d9d5dc28..24139ed06 100644 --- a/Zotlabs/Module/Regate.php +++ b/Zotlabs/Module/Regate.php @@ -68,20 +68,19 @@ class Regate extends \Zotlabs\Web\Controller { if ($r && count($r)) { $r = $r[0]; // check timeframe - if ( $r['reg_startup'] <= $now && $r['reg_expires'] >= $now ) { - if ( isset($_POST['resend']) && $didx == 'e' ) { + if ($r['reg_startup'] <= $now && $r['reg_expires'] >= $now) { + if (isset($_POST['resend']) && $didx == 'e') { $re = q("SELECT * FROM register WHERE reg_vital = 1 AND reg_didx = 'e' AND reg_did2 = '%s' ORDER BY reg_created DESC ", dbesc($r['reg_did2']) ); - if ( $re ) { + if ($re) { $re = $re[0]; - $reonar = json_decode($re['reg_stuff'],true); - $reonar['subject'] = 'Re,Fwd,' . $reonar['subject']; + $reonar = json_decode($re['reg_stuff'], true); if ($reonar) { + $reonar['subject'] = 'Re,Fwd,' . $reonar['subject']; $zm = zar_reg_mail($reonar); - $msg = ($zm) ? 'ZAR1238I ' . t('Email resent') - : 'ZAR1238E ' . t('Resent failed'); - zar_log($msg . ' ' . $r['reg_did2']); + $msg = (($zm) ? t('Email resent') : t('Email resend failed')); + zar_log((($zm) ? 'ZAR1238I' : 'ZAR1238E') . ' ' . $msg . ' ' . $r['reg_did2']); info($msg); - goaway(z_root() . '/' . $nextpage); + return; } } } @@ -352,15 +351,15 @@ class Regate extends \Zotlabs\Web\Controller { '$title' => $title, '$now' => $nowf, '$countdown' => datetime_convert('UTC', 'UTC', $r['reg_startup'], 'c'), - '$infos' => 'ZAR1132W' . ' ' . t('Request not inside time frame') . EOL, + '$infos' => t('Hold on, you can start verification in') . EOL, ]); } } } } else { - $msg = 'ZAR1132E' . ' ' . t('Identity unknown'); - zar_log($msg . ':' . $did2 . ',' . $didx); + $msg = t('Identity unknown'); + zar_log('ZAR1132E ' . $msg . ':' . $did2 . ',' . $didx); $o = replace_macros(get_markup_template('plain.tpl'), [ '$title' => $title, '$now' => $nowf, diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index 4ed3fd5fe..f4aa921c1 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -127,12 +127,13 @@ class Register extends Controller { return; } - if ($sameip && !$is247) { + if ($sameip) { $f = q("SELECT COUNT(reg_atip) AS atip FROM register WHERE reg_vital = 1 AND reg_atip = '%s' ", dbesc($ip) ); - if ($f && $f[0]['atip'] > $sameip) { + if ($f && $f[0]['atip'] >= $sameip) { $logmsg = 'ZAR0239S Exceeding same ip register request of ' . $sameip; + notice('Registrations from same IP exceeded.'); zar_log($logmsg); return; } @@ -350,16 +351,15 @@ class Register extends Controller { $reonar['from'] = get_config('system', 'from_email'); $reonar['to'] = $email; $reonar['subject'] = sprintf( t('Registration confirmation for %s'), get_config('system','sitename')); - $reonar['txtpersonal']= t('Valid from') . ' ' . $regdelay . ' UTC' . t('and expire') . ' ' . $regexpire . ' UTC'; $reonar['txttemplate']= replace_macros(get_intltext_template('register_verify_member.tpl'), [ - '$sitename' => get_config('system','sitename'), - '$siteurl' => z_root(), - '$email' => $email, - '$due' => $reonar['txtpersonal'], - '$mail' => bin2hex($email) . 'e', - '$ko' => bin2hex(substr($empin,0,4)), - '$hash' => $empin + '$sitename' => get_config('system','sitename'), + '$siteurl' => z_root(), + '$email' => $email, + '$timeframe' => [$regdelay, $regexpire], + '$mail' => bin2hex($email) . 'e', + '$ko' => bin2hex(substr($empin,0,4)), + '$hash' => $empin ] ); pop_lang(); @@ -429,10 +429,8 @@ class Register extends Controller { $_SESSION['zar']['msg'] = t('Your validation token is') . EOL . '<h3>' . $pass2 . '</h3>' . EOL - . t('Hold on, you can continue verification in') - . '<div class="d-none"><code class="inline-code"><span id="register_start" data-utc="' . datetime_convert('UTC', 'UTC', $regdelay, 'c') . '" class="register_date">' . datetime_convert('UTC', 'UTC', $regdelay, 'c') . '</span></code> ' . t('and') . ' <code class="inline-code"><span data-utc="' . datetime_convert('UTC', 'UTC', $regexpire, 'c') . '" class="register_date">' . datetime_convert('UTC', 'UTC', $regexpire, 'c') . '</span></code></div>' - //. t('Please come back to this page in the requested timeframe or wait for the countdown to complete.') - ; + . t('Hold on, you can start verification in') + . '<div class="d-none"><code class="inline-code"><span id="register_start" data-utc="' . datetime_convert('UTC', 'UTC', $regdelay, 'c') . '" class="register_date">' . datetime_convert('UTC', 'UTC', $regdelay, 'c') . '</span></code> ' . t('and') . ' <code class="inline-code"><span data-utc="' . datetime_convert('UTC', 'UTC', $regexpire, 'c') . '" class="register_date">' . datetime_convert('UTC', 'UTC', $regexpire, 'c') . '</span></code></div>'; } else { $_SESSION['zar']['pin'] = $pass2; diff --git a/view/en/register_verify_member.tpl b/view/en/register_verify_member.tpl index 5db51a2e2..926efbd11 100644 --- a/view/en/register_verify_member.tpl +++ b/view/en/register_verify_member.tpl @@ -10,15 +10,15 @@ Login with the password you chose at registration. We need to verify your email address in order to give you full access. -Your validation code is +Your validation token is {{$hash}} - -{{if $due}}{{$due}}{{/if}} - +{{if $timeframe}} +This token is valid from {{$timeframe.0}} UTC until {{$timeframe.1}} UTC +{{/if}} If you registered this account, please enter the validation code when requested or visit the following link: {{$siteurl}}/regate/{{$mail}} @@ -26,11 +26,10 @@ If you registered this account, please enter the validation code when requested To deny the request and remove the account, please visit: - {{$siteurl}}/regate/{{$mail}}{{if $ko}}/{{$ko}}{{/if}} -Thank you. +Thank you! -- diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index b6fd2348d..5d51932eb 100644 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -36,7 +36,7 @@ {{** include file="field_checkbox.tpl" field=$register_wo_email **}} {{include file="register_duty.tpl" field=$register_duty}} {{include file="field_input.tpl" field=$register_perday}} - {{** include file="field_input.tpl" field=$register_sameip **}} + {{include file="field_input.tpl" field=$register_sameip}} {{$reg_delay}} {{$reg_expire}} {{include file="field_checkbox.tpl" field=$reg_autochannel}} |