aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Regate.php23
-rw-r--r--Zotlabs/Module/Register.php27
2 files changed, 36 insertions, 14 deletions
diff --git a/Zotlabs/Module/Regate.php b/Zotlabs/Module/Regate.php
index f6faff811..d51927de1 100644
--- a/Zotlabs/Module/Regate.php
+++ b/Zotlabs/Module/Regate.php
@@ -215,6 +215,27 @@ class Regate extends \Zotlabs\Web\Controller {
function get() {
+ if (argc() == 1) {
+ if(isset($_GET['reg_id'])) {
+ if ( preg_match('/^.{2,64}\@[a-z0-9.-]{4,32}\.[a-z]{2,12}$/', $_GET['reg_id'] ) ) {
+ // dId2 E email
+ goaway(z_root() . '/regate/' . bin2hex($_GET['reg_id']) . 'e' );
+ }
+ if ( preg_match('/^d{1,1}[0-9]{5,10}$/', $_GET['reg_id'] ) ) {
+ // dId2 A artifical & anonymous
+ goaway(z_root() . '/regate/' . bin2hex($_GET['reg_id']) . 'a' );
+ }
+ notice(t('Identity unknown') . EOL);
+ }
+
+ $o = replace_macros(get_markup_template('plain.tpl'), [
+ '$title' => t('Your Registration ID'),
+ '$now' => '<form action="regate" method="get"><input type="text" name="reg_id" class="form-control form-group"><button class="btn btn-primary float-right">Submit</button></form>'
+ ]);
+
+ return $o;
+ }
+
if ( argc() > 1 ) {
$did2 = hex2bin( substr( argv(1), 0, -1) );
$didx = substr( argv(1), -1 );
@@ -306,7 +327,7 @@ class Regate extends \Zotlabs\Web\Controller {
$o = replace_macros(get_markup_template('regate.tpl'), [
'$form_security_token' => get_form_security_token("regate"),
'$title' => $title,
- '$desc' => $pin ? t('Please enter your validation token') . '<code class="inline">' . $pin . '</code>' : t('You were given a validation token. Please enter that token here to verify your registration.'),
+ '$desc' => $pin ? t('Please enter your validation token') . ' <code class="inline-code">' . $pin . '</code>' : t('Please enter your validation token'),
'$did2' => bin2hex($did2) . $didx,
'$now' => $nowfmt,
'$atform' => $atform,
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php
index 73eaa5310..95d9da3b7 100644
--- a/Zotlabs/Module/Register.php
+++ b/Zotlabs/Module/Register.php
@@ -425,17 +425,19 @@ class Register extends Controller {
. $regdelay . ' - ' . $regexpire);
if($reg_delayed) {
- // notice( 'ZAR0239I,' . t( 'Your digital id is' ) . EOL . 'd' . $didnew . EOL
- $_SESSION['zar']['msg'] = ( t('Your validation token is') . ' ' . $pass2 . EOL
- . t('Please remember your token and reload this page between') . EOL
- . '<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>' . EOL
- . t('to complete registration.')
- );
+ // this could be removed to make registration harder
+ $_SESSION['zar']['pin'] = $pass2;
+
+ $_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.')
+ ;
}
else {
$_SESSION['zar']['pin'] = $pass2;
}
- $_SESSION['zar']['pin'] = $pass2;
goaway(z_root() . '/regate/' . bin2hex('d' . $didnew) . 'a' );
}
@@ -446,7 +448,6 @@ class Register extends Controller {
}
}
goaway(z_root() . '/regate/' . bin2hex($email) . $didx );
-
}
}
}
@@ -469,7 +470,7 @@ class Register extends Controller {
}
if(intval(get_config('system','register_policy')) == REGISTER_APPROVE) {
- $registration_is = t('Registration on this hub is by approval only.') . '<sup>ZAR0131I</sup>';
+ $registration_is = t('Registration on this hub is by approval only.');
$other_sites = '<a href="pubsites">' . t('Register at another affiliated hub in case when prefered') . '</a>';
}
@@ -483,7 +484,7 @@ class Register extends Controller {
$invitations = false;
if(intval(get_config('system','invitation_only'))) {
$invitations = true;
- $registration_is = t('Registration on this hub is by invitation only.') . '<sup>ZAR0132I</sup>';
+ $registration_is = t('Registration on this hub is by invitation only.');
$other_sites = '<a href="pubsites">' . t('Register at another affiliated hub') . '</a>';
} elseif (intval(get_config('system','invitation_also'))) {
$invitations = true;
@@ -565,7 +566,7 @@ class Register extends Controller {
. "tao.zar = { vsn: '2.0.0', form: {}, msg: {} };\n"
. "tao.zar.patano = /^d[0-9]{5,10}$/;\n"
. "tao.zar.patema = /^[a-z0-9.-]{2,64}@[a-z0-9.-]{4,32}\.[a-z]{2,12}$/;\n"
- . "tao.zar.msg.ZAR0239E = '" . t('email mistake') . "';\n",
+ . "tao.zar.msg.ZAR0239E = '" . t('Email address not valid') . "';\n",
'$form_security_token' => get_form_security_token("register"),
'$title' => t('Registration'),
@@ -575,7 +576,7 @@ class Register extends Controller {
'$msg' => $opal['rn'] . ',' . $opal['an'],
'$invitations' => $invitations,
'$invite_code' => $invite_code,
- '$haveivc' => t('I have an invite code') . '.<sup>ZAR0134I</sup>',
+ '$haveivc' => t('I have an invite code'),
'$now' => $duty['nowfmt'],
'$atform' => $duty['atform'],
'$auto_create' => $auto_create,
@@ -592,7 +593,7 @@ class Register extends Controller {
'$pass1' => $password,
'$pass2' => $password2,
'$submit' => t('Register'),
- '$verify_note' => (($email_verify) ? t('This site requires verification. After completing this form, please check the notice or your email for further instructions.') . '<sup>ZAR0135I</sup>' : '')
+ '$verify_note' => (($email_verify) ? t('This site requires verification. After completing this form, please check the notice or your email for further instructions.') : '')
));
return $o;