]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/register.php
utility for getting avatar or default avatar
[quix0rs-gnu-social.git] / actions / register.php
index 0ee332f0f24489ec9e9d98b6f75abd2608f78188..b49b77f204133f366d0f1c74004851962a78deed 100644 (file)
@@ -56,19 +56,18 @@ class RegisterAction extends Action {
                                                                                                          'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
                        $this->show_form(_('Nickname must have only lowercase letters and numbers and no spaces.'));
                } else if ($this->nickname_exists($nickname)) {
-                       $this->show_form(_('Nickname already exists.'));
+                       $this->show_form(_('Nickname already in use. Try another one.'));
                } else if (!User::allowed_nickname($nickname)) {
                        $this->show_form(_('Not a valid nickname.'));
                } else if ($this->email_exists($email)) {
                        $this->show_form(_('Email address already exists.'));
                } else if ($password != $confirm) {
                        $this->show_form(_('Passwords don\'t match.'));
-               } else {
-                       $user = $this->register_user($nickname, $password, $email);
+               } else if ($user = $this->register_user($nickname, $password, $email)) {
                        if (!$user) {
-                               $this->show_form(_t('Invalid username or password.'));
+                               $this->show_form(_('Invalid username or password.'));
                                return;
-                       }                               
+                       }
                        # success!
                        if (!common_set_user($user)) {
                                common_server_error(_('Error setting user.'));
@@ -82,7 +81,7 @@ class RegisterAction extends Action {
                        }
                        common_redirect(common_local_url('profilesettings'));
                } else {
-                       $this->show_form(_t('Invalid username or password.'));
+                       $this->show_form(_('Invalid username or password.'));
                }
        }
 
@@ -182,8 +181,7 @@ class RegisterAction extends Action {
                common_input('email', _('Email'), NULL,
                                         _('Used only for updates, announcements, and password recovery'));
                common_checkbox('rememberme', _('Remember me'), false,
-                               _('Automatically login in the future; ' .
-                                  'not for shared computers!'));
+                               _('Automatically login in the future; not for shared computers!'));
                common_element_start('p');
                common_element('input', array('type' => 'checkbox',
                                                                          'id' => 'license',