$template->set( 'remember', $user->getOption( 'rememberpassword' ) || $this->mRemember );
$template->set( 'cansecurelogin', ( $wgSecureLogin === true ) );
$template->set( 'stickhttps', (int)$this->mStickHTTPS );
-
- if ( $this->mType === 'signup' && $user->isLoggedIn() ) {
- $template->set( 'createAnother', true );
- } else {
- $template->set( 'createAnother', false );
- }
+ $template->set( 'loggedin', $user->isLoggedIn() );
+ $template->set( 'loggedinuser', $user->getName() );
if ( $this->mType == 'signup' ) {
if ( !self::getCreateaccountToken() ) {
* @return bool
*/
private function showCreateOrLoginLink( &$user ) {
- if ( $user->isLoggedIn() ) {
- return false;
- } elseif ( $this->mType == 'signup' ) {
+ if ( $this->mType == 'signup' ) {
return true;
} elseif ( $user->isAllowed( 'createaccount' ) ) {
return true;
<div id="userloginForm">
<h2 class="createaccount-join">
<?php
- $this->msg( $this->data['createAnother'] ?
+ $this->msg( $this->data['loggedin'] ?
'createacct-another-join' : 'createacct-join' );
?>
</h2>
'tabindex' => '1',
'size' => '20',
'required',
- 'placeholder' => $this->getMsg( $this->data['createAnother'] ?
+ 'placeholder' => $this->getMsg( $this->data['loggedin'] ?
'createacct-another-username-ph' : 'userlogin-yourname-ph' )->text(),
) );
?>
'id' => 'wpEmail',
'tabindex' => '6',
'size' => '20',
- 'placeholder' => $this->getMsg( $this->data['createAnother'] ?
+ 'placeholder' => $this->getMsg( $this->data['loggedin'] ?
'createacct-another-email-ph' : 'createacct-email-ph' )->text()
) + ( $this->data['emailrequired'] ? array() : array( 'required' => '' ) ) );
?>
tabindex="7"
value="<?php $this->text( 'realname' ); ?>" size='20' />
<div class="prefsectiontip">
- <?php $this->msgWiki( $this->data['createAnother'] ? 'createacct-another-realname-tip' : 'prefs-help-realname' ); ?>
+ <?php $this->msgWiki( $this->data['loggedin'] ? 'createacct-another-realname-tip' : 'prefs-help-realname' ); ?>
</div>
</div>
<?php }
<div class="mw-submit">
<?php
echo Html::input( 'wpCreateaccount',
- $this->getMsg( $this->data['createAnother'] ?
+ $this->getMsg( $this->data['loggedin'] ?
'createacct-another-submit' : 'createacct-submit' ),
'submit',
array(
?>
<div id="userloginForm">
<form name="userlogin" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>">
+ <?php if ( $this->data['loggedin'] ) { ?>
+ <div class="warningbox">
+ <?php echo $this->getMsg( 'userlogin-loggedin' )->params( $this->data['loggedinuser'] )->parse(); ?>
+ </div>
+ <?php } ?>
<section class="mw-form-header">
<?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?>
</section>
<?php echo $this->getMsg( 'userlogin-helplink' )->parse(); ?>
</div>
<?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?>
- <div id="mw-createaccount-cta">
- <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ); ?></a></h3>
- </div>
+ <?php if ( $this->data['loggedin'] ) { ?>
+ <div id="mw-createaccount-another">
+ <h3 id="mw-userloginlink"><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button"><?php $this->msg( 'userlogin-createanother' ); ?></a></h3>
+ </div>
+ <?php } else { ?>
+ <div id="mw-createaccount-cta">
+ <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ); ?></a></h3>
+ </div>
+ <?php } ?>
<?php } ?>
<?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
<?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
'userlogin-resetpassword-link' => 'Reset your password',
'helplogin-url' => 'Help:Logging in',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Help with logging in]]',
+'userlogin-loggedin' => 'You are already logged in as {{GENDER:$1|$1}}.
+Use the form below to log in as another user.',
+'userlogin-createanother' => 'Create another account',
'createacct-join' => 'Enter your information below.',
'createacct-another-join' => "Enter the new account's information below.",
'createacct-emailrequired' => 'Email address',
See also:
* {{msg-mw|Helplogin-url}}',
+'userlogin-loggedin' => 'Used instead of the form on [[Special:UserLogin]] when the current user is already logged in.
+
+Parameters:
+* $1 - user name (used for display and for gender support)',
+'userlogin-createanother' => 'Button on [[Special:UserLogin]] shown when the current user is already logged in.',
'createacct-join' => 'Subheading of vertical-layout create account form encouraging user to join the wiki.
See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]',
'userlogin-resetpassword-link',
'helplogin-url',
'userlogin-helplink',
+ 'userlogin-loggedin',
+ 'userlogin-createanother',
'createacct-join',
'createacct-another-join',
'createacct-emailrequired',
#mw-createaccount-cta {
width: 20em;
height: 10em;
- text-align: center;
/* @embed */
background: url(images/glyph-people-large.png) no-repeat 50%;
margin: 0 auto;
}
-#mw-createaccount-cta h3 {
+#mw-createaccount-cta h3,
+#mw-createaccount-another h3 {
font-size: 0.9em;
font-weight: normal;
text-align: center;
+}
+
+#mw-createaccount-cta h3 {
padding-top: 4em;
}