use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
+use Friendica\Core\L10n\L10n as L10nClass;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
-use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model;
}
}
- 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')],
+ '$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,
$arr['blocked'] = $blocked;
$arr['verified'] = $verified;
- $arr['language'] = L10n::detectLanguage();
+ $arr['language'] = L10nClass::detectLanguage($a->getConfig()->get('system', 'language'));
try {
$result = Model\User::create($arr);
$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