From: Tom Gilder Date: Fri, 2 Dec 2005 00:14:58 +0000 (+0000) Subject: Major overhaul of Special:Userlogin X-Git-Tag: 1.6.0~1080 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=c6c1faae422f6fc6621c2242e1016b550a30b98b;p=lhc%2Fweb%2Fwiklou.git Major overhaul of Special:Userlogin * Split up login and create user forms * New design for forms * Many usability improvements * Better error messages --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c6e72261e5..763a587f18 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -272,7 +272,7 @@ fully support the editing toolbar, but was found to be too confusing. * Include oldid for the second revision on edit link on diff view * (bug 4035) Fix prev/next revision links on edit page * Fix custom namespaces on wikis set for Portuguese - +* Major overhaul of Special:Userlogin === Caveats === diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index e9224260c7..416703e5f2 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -37,6 +37,7 @@ class LoginForm { global $wgLang, $wgAllowRealName, $wgEnableEmail; global $wgAuth; + $this->mType = $request->getText( 'type' ); $this->mName = $request->getText( 'wpName' ); $this->mPassword = $request->getText( 'wpPassword' ); $this->mRetype = $request->getText( 'wpRetype' ); @@ -311,7 +312,7 @@ class LoginForm { } if (!$u->checkPassword( $this->mPassword )) { - $this->mainLoginForm( wfMsg( 'wrongpassword' ) ); + $this->mainLoginForm( wfMsg( $this->mPassword == '' ? 'wrongpasswordempty' : 'wrongpassword' ) ); return; } @@ -447,14 +448,33 @@ class LoginForm { } } - $q = 'action=submitlogin'; - if ( !empty( $this->mReturnto ) ) { - $q .= '&returnto=' . wfUrlencode( $this->mReturnto ); - } $titleObj = Title::makeTitle( NS_SPECIAL, 'Userlogin' ); require_once( 'templates/Userlogin.php' ); - $template =& new UserloginTemplate(); + + if ( $this->mType == 'signup' ) { + $template =& new UsercreateTemplate(); + $q = 'action=submitlogin&type=signup'; + $linkq = 'type=login'; + $msg = 'gotaccount'; + } else { + $template =& new UserloginTemplate(); + $q = 'action=submitlogin&type=login'; + $linkq = 'type=signup'; + $msg = 'nologin'; + } + + if ( !empty( $this->mReturnto ) ) { + $returnto = '&returnto=' . wfUrlencode( $this->mReturnto ); + $q .= $returnto; + $linkq .= $returnto; + } + + $link = ''; + $link .= wfMsgHtml( $msg . 'link' ); + $link .= ''; + + $template->set( 'link', wfMsgHtml( $msg, $link ) ); $template->set( 'name', $this->mName ); $template->set( 'password', $this->mPassword ); diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index 5fcd9154eb..7a6f03a12c 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -17,36 +17,103 @@ class UserloginTemplate extends QuickTemplate { function execute() { if( $this->data['error'] ) { ?> -

msg('loginerror') ?>:

-

html('error') ?>

- -

msg('login' ) ?>:

- msgWiki('loginprompt') ?> +
+

msg('loginerror') ?>:

+ html('error') ?> +
+
-
- + +
+ +

msg('login') ?>

+ +
msgWiki('loginprompt') ?>
+
- + + + + + + + data['usedomain'] ) { + $doms = ""; + foreach( $this->data['domainnames'] as $dom ) { + $doms .= ""; + } + ?> + + + + + + + - + + + +
-
+ +
msg( 'yourdomainname' ) ?>: + +
- data['remember'] ) { ?>checked="checked" - /> + />
+  data['useemail'] ) { ?> + +
+
+ +
msgWiki( 'loginend' ); ?>
+data['error'] ) { +?> +
+

msg('loginerror') ?>:

+ html('error') ?> +
+
+ +
+ +data['create'] ) { ?> +
+

msg('createaccount') ?>

+ + + + + + + data['usedomain'] ) { @@ -58,30 +125,25 @@ class UserloginTemplate extends QuickTemplate { - data['create'] ) { ?> - - - - data['useemail'] ) { ?> @@ -90,38 +152,47 @@ class UserloginTemplate extends QuickTemplate { + + + + + + + - data['useemail'] ) { ?> - - - - - - -
- +
- +
msg( 'yourdomainname' ) ?>: -
 
- msg('newusersonly') ?>
-
-
- data['remember'] ) { ?>checked="checked" + /> +
+ data['createemail'] ) { ?> -
 
-

- msgHtml( 'emailforlost' ) ?>
- -

-
+ data['useemail'] ) { + echo '
'; + $this->msgHtml( 'emailforlost' ); + echo '
'; + } + + ?>
+
+
msgWiki( 'signupend' ); ?>
msgWiki( 'loginend' ); + } } diff --git a/languages/Language.php b/languages/Language.php index d9c9ee3c5a..09ea330536 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -590,7 +590,7 @@ You can view and copy the source of this page:', # Login and logout pages # 'logouttitle' => 'User logout', -'logouttext' => "You are now logged out.
+'logouttext' => "You are now logged out.
You can continue to use {{SITENAME}} anonymously, or you can log in again as the same or as a different user. Note that some pages may continue to be displayed as if you were still logged in, until you clear @@ -613,14 +613,18 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen 'login' => 'Log in', 'loginprompt' => 'You must have cookies enabled to log in to {{SITENAME}}.', -'userlogin' => 'Create an account or log in', +'userlogin' => 'Log in / create account', 'logout' => 'Log out', 'userlogout' => 'Log out', 'notloggedin' => 'Not logged in', -'createaccount' => 'Create new account', +'nologin' => 'Don\'t have a login? $1.', +'nologinlink' => 'Create an account', +'createaccount' => 'Create account', +'gotaccount' => 'Already got an account? $1.', +'gotaccountlink' => 'Log in', 'createaccountmail' => 'by email', 'badretype' => 'The passwords you entered do not match.', -'userexists' => 'The user name you entered is already in use. Please choose a different name.', +'userexists' => 'Username entered already in use. Please choose a different name.', 'youremail' => 'Email *', 'username' => 'Username: ', 'uid' => 'User ID: ', @@ -630,8 +634,7 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen 'yournick' => 'Nickname:', 'badsig' => 'Invalid raw signature; check HTML tags.', 'email' => 'Email', -'emailforlost' => "Fields marked with superscripts are optional. Storing an email address enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it.

Your real name, if you choose to provide it, will be used for giving you attribution for your work.", +'emailforlost' => "
* Optional. An email lets others contact you on this site without revealing your address, and lets us send you a new password if you forget it.

Your real name will be used to give you attribution for your work.
", 'prefs-help-email-enotif' => 'This address is also used to send you email notifications if you enabled the options.', 'prefs-help-realname' => '* Real name (optional): if you choose to provide it this will be used for giving you attribution for your work.', 'loginerror' => 'Login error', @@ -640,12 +643,12 @@ email address to them, and it can be used to send you a new password if you forg 'nocookieslogin' => "{{SITENAME}} uses cookies to log in users. You have cookies disabled. Please enable them and try again.", 'noname' => 'You have not specified a valid user name.', 'loginsuccesstitle' => 'Login successful', -'loginsuccess' => "You are now logged in to {{SITENAME}} as \"$1\".", -'nosuchuser' => "There is no user by the name \"$1\". -Check your spelling, or use the form below to create a new user account.", +'loginsuccess' => "'''You are now logged in to {{SITENAME}} as \"$1\".'''", +'nosuchuser' => "There is no user by the name \"$1\". Check your spelling, or create a new account.", 'nosuchusershort' => "There is no user by the name \"$1\". Check your spelling.", -'wrongpassword' => 'The password you entered is incorrect (or missing). Please try again.', -'mailmypassword' => 'Mail me a new password', +'wrongpassword' => 'Incorrect password entered. Please try again.', +'wrongpasswordempty' => 'Password entered was blank. Please try again.', +'mailmypassword' => 'Email password', 'passwordremindertitle' => "Password reminder from {{SITENAME}}", 'passwordremindertext' => "Someone (probably you, from IP address $1) requested that we send you a new {{SITENAME}} login password for {{SERVERNAME}}. @@ -662,7 +665,8 @@ Please log in again after you receive it.", 'eauthentsent' => "A confirmation email has been sent to the nominated email address. Before any other mail is sent to the account, you will have to follow the instructions in the email, to confirm that the account is actually yours.", -'loginend' => ' ', +'loginend' => '', +'signupend' => '{{int:loginend}}', 'mailerror' => "Error sending mail: $1", 'acct_creation_throttle_hit' => 'Sorry, you have already created $1 accounts. You can\'t make any more.', 'emailauthenticated' => 'Your email address was authenticated on $1.', diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 4ca592abe9..9a132a2578 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -271,6 +271,21 @@ span.subpages { color: red; font-size: larger; } +.errorbox { + font-size: larger; + border: 2px solid red; + padding: .5em 1em; + float: left; + margin-bottom: 2em; + background-color: #fff2f2; +} +.errorbox h2 { + font-size: 1em; + font-weight: bold; + display: inline; + margin: 0 .5em 0 0; + border: none; +} #catlinks { border: 1px solid #aaa; background-color: #f9f9f9; @@ -1050,6 +1065,41 @@ div.prefsectiontip { margin-top: 2em; } +#userlogin { + margin: 0 3em 1em 0; + border: 1px solid #aaa; + clear: both; + padding: 1.5em 2em; + background-color: #f9f9f9; + float: left; +} + +#userlogin table { + background-color: #f9f9f9; +} + +#userlogin h2 { + padding-top: 0; +} + +#userloginprompt { + font-size: 85%; +} + +#login-emailforlost { + font-size: 85%; + line-height: 1.2; + padding-top: 2em; +} + +#userlogin .loginText, #userlogin .loginPassword { + width: 12em; +} + +#userloginlink a, #wpLoginattempt, #wpCreateaccount { + font-weight: bold; +} + /* ** IE/Mac fixes, hope to find a validating way to move this ** to a separate stylesheet. This would work but doesn't validate: diff --git a/skins/monobook/rtl.css b/skins/monobook/rtl.css index 92bbf3e60e..6050514449 100644 --- a/skins/monobook/rtl.css +++ b/skins/monobook/rtl.css @@ -218,3 +218,7 @@ input#wpSave, input#wpDiff { margin-left: 0.33em; } +#userlogin { + float: right; + margin: 0 0 1em 3em; +} \ No newline at end of file