From be1119a7a1366884af676cf644c0c172bd7df7fd Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 10 Jun 2024 07:01:40 +1000 Subject: [PATCH] make reason conditional on 'requires approval' --- src/Module/Register.php | 2 +- view/tpl/register.tpl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Module/Register.php b/src/Module/Register.php index c549c724f..fd76c1d58 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -290,7 +290,7 @@ class Register extends Controller $invite_code = ['invite_code', t('Please enter your invitation code'), ((x($_REQUEST, 'invite_code')) ? strip_tags(trim($_REQUEST['invite_code'])) : "")]; $name = ['name', t('Your Name'), ((x($_REQUEST, 'name')) ? $_REQUEST['name'] : ''), t('Real names are preferred.')]; $nickhub = '@' . str_replace(['http://', 'https://', '/'], '', get_config('system', 'baseurl')); - $reason = ['reason', t('Please tell us briefly why you are requesting this account'), '', '']; + $reason = ($policy === REGISTER_APPROVE) ? ['reason', t('Please tell us briefly why you are requesting this account'), '', ''] : null; $nickname = ['nickname', t('Choose a short nickname'), ((x($_REQUEST, 'nickname')) ? $_REQUEST['nickname'] : ''), sprintf(t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub)]; $role = ['permissions_role', t('Channel role and privacy'), ($privacy_role) ?: 'social', t('Select a channel permission role for your usage needs and privacy requirements.'), $perm_roles]; $tos = ['tos', $label_tos, '', '', [t('no'), t('yes')], ' required ']; diff --git a/view/tpl/register.tpl b/view/tpl/register.tpl index 9e60f8414..25b6f5f91 100755 --- a/view/tpl/register.tpl +++ b/view/tpl/register.tpl @@ -28,8 +28,10 @@ {{include file="field_password.tpl" field=$pass2}} + {{if $reason}} {{include file="field_textarea.tpl" field=$reason}} - + {{/if}} + {{if $auto_create}} {{if $default_role}}