aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Register.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-04-14 19:40:51 +0000
committerMario <mario@mariovavti.com>2021-04-14 19:40:51 +0000
commite35ab97b7ecbd96e11883bc194bfe9fb5a72e7f2 (patch)
tree08e00e224e345feee95bb0a3f668aa5a4d1ef580 /Zotlabs/Module/Register.php
parentf9793e870f5c3c531fe48a2294782de0643a6c9b (diff)
downloadvolse-hubzilla-e35ab97b7ecbd96e11883bc194bfe9fb5a72e7f2.tar.gz
volse-hubzilla-e35ab97b7ecbd96e11883bc194bfe9fb5a72e7f2.tar.bz2
volse-hubzilla-e35ab97b7ecbd96e11883bc194bfe9fb5a72e7f2.zip
register: provide a possibility to leave a message id registration is by approval
Diffstat (limited to 'Zotlabs/Module/Register.php')
-rw-r--r--Zotlabs/Module/Register.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php
index 2c73f3d6d..1cbea663a 100644
--- a/Zotlabs/Module/Register.php
+++ b/Zotlabs/Module/Register.php
@@ -75,6 +75,8 @@ class Register extends Controller {
$email = ((x($arr,'email')) ? notags(punify(trim($arr['email']))) : '');
$password = ((x($arr,'password')) ? trim($arr['password']) : '');
$password2 = ((x($arr,'password2')) ? trim($arr['password2']) : '');
+ $register_msg = ((x($arr,'register_msg')) ? notags(trim($arr['register_msg'])) : '');
+
$reonar = [];
$auto_create = get_config('system','auto_channel_create', 1);
@@ -182,7 +184,6 @@ class Register extends Controller {
return;
}
-
$policy = get_config('system','register_policy');
$invonly = get_config('system','invitation_only');
$invalso = get_config('system','invitation_also');
@@ -378,11 +379,15 @@ class Register extends Controller {
}
}
- if ( $auto_create ) {
+ if ($auto_create) {
$reonar['chan.name'] = $name;
$reonar['chan.did1'] = $nick;
}
+ if ($policy == REGISTER_APPROVE) {
+ $reonar['msg'] = $register_msg;
+ }
+
$reg = q("INSERT INTO register ("
. "reg_flags,reg_didx,reg_did2,reg_hash,reg_created,reg_startup,reg_expires,"
. "reg_email,reg_pass,reg_lang,reg_atip,reg_stuff)"
@@ -398,7 +403,7 @@ class Register extends Controller {
dbesc($password),
dbesc(substr(get_best_language(),0,2)),
dbesc($ip),
- dbesc(json_encode( $reonar ))
+ dbesc(json_encode($reonar))
);
if ($didx == 'a') {
@@ -537,12 +542,15 @@ class Register extends Controller {
$tos = array('tos', $label_tos, '', '', array(t('no'),t('yes')));
+ $register_msg = ['register_msg', t('Why do you want to join this hub?')];
+
require_once('include/bbcode.php');
$o = replace_macros(get_markup_template('register.tpl'), array(
'$form_security_token' => get_form_security_token("register"),
'$title' => t('Registration'),
'$reg_is' => $registration_is,
+ '$register_msg' => $register_msg,
'$registertext' => bbcode(get_config('system','register_text')),
'$other_sites' => $other_sites,
'$msg' => $opal['msg'],
@@ -563,6 +571,7 @@ class Register extends Controller {
'$pass1' => $password,
'$pass2' => $password2,
'$submit' => t('Register'),
+
));
return $o;