From 91ee73ac0a896723849f73b69ae2339cfce380bc Mon Sep 17 00:00:00 2001 From: jrobson Date: Thu, 6 Mar 2014 09:48:13 -0800 Subject: [PATCH] Revert "Warn on account creation when username is adjusted" This reverts commit a0c72523c7a2c9ca16329f903ca6b269ccccb787. which has terrible effects on mobile. Most browser inputs on a mobile phone default to lowercase meaning a username with a lowercase starting character will always trigger the warning. This means the user will have to re-enter their passwords, fill out the captcha again and their email again (as all these are sensitive and not retained when reloading the form with the warning) If this is truly wanted on desktop, more thought it needed for the mobile use case. Bug: 61416 Change-Id: I8b93e5a4ca687f87305ced4343dcb28ca2909939 --- RELEASE-NOTES-1.23 | 4 - includes/specials/SpecialUserlogin.php | 21 +--- includes/templates/Usercreate.php | 12 +- languages/messages/MessagesEn.php | 1 - languages/messages/MessagesQqq.php | 3 - maintenance/language/messages.inc | 1 - resources/Resources.php | 10 +- .../mediawiki.special.userlogin.signup.js | 119 +----------------- 8 files changed, 9 insertions(+), 162 deletions(-) diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index 798d59c607..2b91f88f88 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -116,10 +116,6 @@ production. creations, similar to the topOnly option. * Add mediawiki.ui.button styling to all pages so wiki content can use styled buttons. -* Special:UserLogin/signup now does AJAX checks for invalid and taken usernames, - displaying the error live. -* Special:UserLogin/signup now warns the user if their chosen username has to be - normalized. === Bug fixes in 1.23 === * (bug 41759) The "updated since last visit" markers (on history pages, recent diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 67e33b30b6..bbe56ecca3 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -223,7 +223,7 @@ class LoginForm extends SpecialPage { $status = $this->addNewAccountInternal(); if ( !$status->isGood() ) { $error = $status->getMessage(); - $this->mainLoginForm( $error->toString(), $status->isOK() ? 'warning' : 'error' ); + $this->mainLoginForm( $error->toString() ); return; } @@ -259,7 +259,7 @@ class LoginForm extends SpecialPage { $status = $this->addNewAccountInternal(); if ( !$status->isGood() ) { $error = $status->getMessage(); - $this->mainLoginForm( $error->toString(), $status->isOK() ? 'warning' : 'error' ); + $this->mainLoginForm( $error->toString() ); return false; } @@ -401,10 +401,6 @@ class LoginForm extends SpecialPage { return Status::newFatal( 'sorbs_create_account_reason' ); } - // Leading/trailing/multiple whitespace characters are never accepted in usernames and users - // know that, don't warn if someone accidentally types it. We do warn about underscores. - $name = trim( preg_replace( '/\s+/', ' ', $this->mUsername ) ); - // Normalize the name so that silly things don't cause "invalid username" errors. // User::newFromName does some rather strict checking, rejecting e.g. leading/trailing/multiple spaces. $title = Title::makeTitleSafe( NS_USER, $this->mUsername ); @@ -412,23 +408,12 @@ class LoginForm extends SpecialPage { return Status::newFatal( 'noname' ); } - // Now create a dummy user ($u) and check if it is valid. + # Now create a dummy user ($u) and check if it is valid $u = User::newFromName( $title->getText(), 'creatable' ); - if ( !is_object( $u ) ) { return Status::newFatal( 'noname' ); } elseif ( 0 != $u->idForName() ) { return Status::newFatal( 'userexists' ); - } elseif ( $name !== $u->getName() ) { - // User name was adjusted due to technical restrictions (e.g. first letter capitalized). - // This is normally handled by a client-side check, but users with JavaScript disabled get here. - $status = Status::newGood(); - $status->warning( 'createacct-normalization', $name, $u->getName() ); - - // Set the form field to the correct name, so the user can just hit the button again. - $this->mUsername = $u->getName(); - - return $status; } if ( $this->mCreateaccountMail ) { diff --git a/includes/templates/Usercreate.php b/includes/templates/Usercreate.php index aba0d2767c..0cb83d555e 100644 --- a/includes/templates/Usercreate.php +++ b/includes/templates/Usercreate.php @@ -58,23 +58,15 @@ class UsercreateTemplate extends BaseTemplate {
html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?>
- -
data['message'] ) { ?> - class="data['messagetype']; ?>box" - - style="display: none;" - - > data['message'] ) { ?> +
data['messagetype'] == 'error' ) { ?> msg( 'createacct-error' ); ?>
html( 'message' ); ?> +
-