]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/register.php
make init of lang environment happen earlier, or when user language may have changed
[quix0rs-gnu-social.git] / actions / register.php
index 6ac28305953fc7b1644c48bdcb297ea984cf1fff..c539108420095f81da74412f26df49c2fccaf628 100644 (file)
@@ -24,7 +24,9 @@ class RegisterAction extends Action {
        function handle($args) {
                parent::handle($args);
 
-               if (common_logged_in()) {
+               if (common_config('site', 'closed')) {
+                       common_user_error(_('Registration not allowed.'));
+               } else if (common_logged_in()) {
                        common_user_error(_('Already logged in.'));
                } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                        $this->try_register();
@@ -96,6 +98,8 @@ class RegisterAction extends Action {
                                common_debug('Adding rememberme cookie for ' . $nickname);
                                common_rememberme($user);
                        }
+                       # Re-init language env in case it changed (not yet, but soon)
+                       common_init_language();
                        $this->show_success();
                } else {
                        $this->show_form(_('Invalid username or password.'));