$this->mReason = $request->getText( 'wpReason' );
$this->mCookieCheck = $request->getVal( 'wpCookieCheck' );
$this->mPosted = $request->wasPosted();
- $this->mCreateaccount = $request->getCheck( 'wpCreateaccount' );
$this->mCreateaccountMail = $request->getCheck( 'wpCreateaccountMail' )
&& $wgEnableEmail;
+ $this->mCreateaccount = $request->getCheck( 'wpCreateaccount' ) && !$this->mCreateaccountMail;
$this->mLoginattempt = $request->getCheck( 'wpLoginattempt' );
$this->mAction = $request->getVal( 'action' );
$this->mRemember = $request->getCheck( 'wpRemember' );
$q = 'action=submitlogin&type=signup';
$linkq = 'type=login';
$linkmsg = 'gotaccount';
+ $this->getOutput()->addModules( 'mediawiki.special.userlogin.signup' );
} else {
$template = new UserloginTemplate();
$q = 'action=submitlogin&type=login';
$template->set( 'name', $this->mUsername );
$template->set( 'password', $this->mPassword );
$template->set( 'retype', $this->mRetype );
+ $template->set( 'createemailset', $this->mCreateaccountMail );
$template->set( 'email', $this->mEmail );
$template->set( 'realname', $this->mRealName );
$template->set( 'domain', $this->mDomain );
</td>
</tr>
<tr>
+ <td></td>
+ <td class="mw-input">
+ <?php if( $this->data['createemail'] ) {
+ echo Xml::checkLabel(
+ wfMessage( 'createaccountmail' )->text(),
+ 'wpCreateaccountMail',
+ 'wpCreateaccountMail',
+ $this->data['createemailset'],
+ array( 'tabindex' => '2' )
+ );
+ } ?>
+ </td>
+ </tr>
+ <tr class="mw-row-password">
<td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td>
<td class="mw-input">
<?php
echo Html::input( 'wpPassword', null, 'password', array(
'class' => 'loginPassword',
'id' => 'wpPassword2',
- 'tabindex' => '2',
+ 'tabindex' => '3',
'size' => '20'
) + User::passwordChangeInputAttribs() ); ?>
</td>
<td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
<td class="mw-input">
<select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
- tabindex="3">
+ tabindex="4">
<?php echo $doms ?>
</select>
</td>
</tr>
<?php } ?>
- <tr>
+ <tr class="mw-row-password">
<td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
<td class="mw-input">
<?php
echo Html::input( 'wpRetype', null, 'password', array(
'class' => 'loginPassword',
'id' => 'wpRetype',
- 'tabindex' => '4',
+ 'tabindex' => '5',
'size' => '20'
) + User::passwordChangeInputAttribs() ); ?>
</td>
echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
'class' => 'loginText',
'id' => 'wpEmail',
- 'tabindex' => '5',
+ 'tabindex' => '6',
'size' => '20'
) ); ?>
<div class="prefsectiontip">
<td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
<td class="mw-input">
<input type='text' class='loginText' name="wpRealName" id="wpRealName"
- tabindex="6"
+ tabindex="7"
value="<?php $this->text('realname') ?>" size='20' />
<div class="prefsectiontip">
<?php $this->msgWiki('prefs-help-realname'); ?>
<td class="mw-label"><label for='wpReason'><?php $this->msg('createaccountreason') ?></label></td>
<td class="mw-input">
<input type='text' class='loginText' name="wpReason" id="wpReason"
- tabindex="7"
+ tabindex="8"
value="<?php $this->text('reason') ?>" size='20' />
</td>
<?php } ?>
'wpRemember',
'wpRemember',
$this->data['remember'],
- array( 'tabindex' => '8' )
+ array( 'tabindex' => '9' )
)
?>
</td>
</tr>
<?php }
- $tabIndex = 9;
+ $tabIndex = 10;
if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
foreach ( $this->data['extraInput'] as $inputItem ) { ?>
<tr>
<input type='submit' name="wpCreateaccount" id="wpCreateaccount"
tabindex="<?php echo $tabIndex++; ?>"
value="<?php $this->msg('createaccount') ?>" />
- <?php if( $this->data['createemail'] ) { ?>
- <input type='submit' name="wpCreateaccountMail" id="wpCreateaccountMail"
- tabindex="<?php echo $tabIndex++; ?>"
- value="<?php $this->msg('createaccountmail') ?>" />
- <?php } ?>
</td>
</tr>
</table>
'gotaccount' => 'Already have an account? $1.',
'gotaccountlink' => 'Log in',
'userlogin-resetlink' => 'Forgotten your login details?',
-'createaccountmail' => 'By e-mail',
+'createaccountmail' => 'Use a temporary random password and send it to the e-mail address specified below',
'createaccountreason' => 'Reason:',
'badretype' => 'The passwords you entered do not match.',
'userexists' => 'Username entered already in use.
),
'dependencies' => array( 'mediawiki.libs.jpegmeta', 'mediawiki.util' ),
),
+ 'mediawiki.special.userlogin.signup' => array(
+ 'scripts' => 'resources/mediawiki.special/mediawiki.special.userLogin.signup.js',
+ ),
'mediawiki.special.javaScriptTest' => array(
'scripts' => 'resources/mediawiki.special/mediawiki.special.javaScriptTest.js',
'messages' => array_merge( Skin::getSkinNameMessages(), array(
--- /dev/null
+/**
+ * JavaScript for Special:UserLogin/signup
+ */
+jQuery( document ).ready( function ( $ ) {
+ $( '#wpCreateaccountMail' )
+ .on( 'change', function() {
+ $( '.mw-row-password' ).toggle( !$( this ).attr( 'checked' ) );
+ } )
+ .trigger( 'change' );
+} );