}
}
- if (!empty($_SESSION['theme'])) {
- unset($_SESSION['theme']);
- }
- if (!empty($_SESSION['mobile-theme'])) {
- unset($_SESSION['mobile-theme']);
- }
-
$username = defaults($_REQUEST, 'username' , '');
$email = defaults($_REQUEST, 'email' , '');
$openid_url = defaults($_REQUEST, 'openid_url', '');
$o = Renderer::replaceMacros($tpl, [
'$invitations' => Config::get('system', 'invitation_only'),
'$permonly' => intval(Config::get('config', 'register_policy')) === self::APPROVE,
- '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), "required"],
+ '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), 'required'],
'$invite_desc' => L10n::t('Membership on this site is by invitation only.'),
'$invite_label' => L10n::t('Your invitation code: '),
'$invite_id' => $invite_id,
$a->internalRedirect();
}
+ // Check if the note to the admin is actually filled out
+ if (empty($_POST['permonlybox'])) {
+ \notice(L10n::t('You have to leave a request note for the admin.')
+ . L10n::t('Your registration can not be processed.') . EOL);
+
+ $a->internalRedirect('register/');
+ }
+
Model\Register::createForApproval($user['uid'], Config::get('system', 'language'), $_POST['permonlybox']);
// invite system