X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FRegister.php;h=1aabb843937c83fbaca3bac2bf5a567f29dfc1f5;hb=cdefa7f32a224501a14bcacbe0f0a3792631df93;hp=06b62783f6eb8a4a9929b90879eb5562d74591ef;hpb=774d04cd2fbdfaa36beb74b8a38b025c96184ff9;p=friendica.git diff --git a/src/Module/Register.php b/src/Module/Register.php index 06b62783f6..1aabb84393 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -7,10 +7,10 @@ use Friendica\Content\Text\BBCode; 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; @@ -61,13 +61,6 @@ class Register extends BaseModule } } - 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', ''); @@ -114,7 +107,7 @@ class Register extends BaseModule $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, @@ -203,7 +196,7 @@ class Register extends BaseModule $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); @@ -259,6 +252,14 @@ class Register extends BaseModule $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