* Non-file pages can no longer be moved to the file namespace, nor vice versa.
* (bug 671) The <dfn> element has been whitelisted in user input.
* (bug 24563) Entries on Special:WhatLinksHere now have a link to their history
+* (bug 21503) There's now a "reason" field when creating account for other users
=== Bug fixes in 1.17 ===
* (bug 17560) Half-broken deletion moved image files to deletion archive
/**
* Add a newuser log entry for this user
+ *
* @param $byEmail Boolean: account made by email?
+ * @param $reason String: user supplied reason
*/
- public function addNewUserLogEntry( $byEmail = false ) {
- global $wgUser, $wgNewUserLog;
+ public function addNewUserLogEntry( $byEmail = false, $reason = '' ) {
+ global $wgUser, $wgContLang, $wgNewUserLog;
if( empty( $wgNewUserLog ) ) {
return true; // disabled
}
if( $this->getName() == $wgUser->getName() ) {
$action = 'create';
- $message = '';
} else {
$action = 'create2';
- $message = $byEmail
- ? wfMsgForContent( 'newuserlog-byemail' )
- : '';
+ if ( $byEmail ) {
+ if ( $reason === '' ) {
+ $reason = wfMsgForContent( 'newuserlog-byemail' );
+ } else {
+ $reason = $wgContLang->commaList( array(
+ $reason, wfMsgForContent( 'newuserlog-byemail' ) ) );
+ }
+ }
}
$log = new LogPage( 'newusers' );
$log->addEntry(
$action,
$this->getUserPage(),
- $message,
+ $reason,
array( $this->getId() )
);
return true;
$this->mPassword = $request->getText( 'wpPassword' );
$this->mRetype = $request->getText( 'wpRetype' );
$this->mDomain = $request->getText( 'wpDomain' );
+ $this->mReason = $request->getText( 'wpReason' );
$this->mReturnTo = $request->getVal( 'returnto' );
$this->mReturnToQuery = $request->getVal( 'returntoquery' );
$this->mCookieCheck = $request->getVal( 'wpCookieCheck' );
$result = $this->mailPasswordInternal( $u, false, 'createaccount-title', 'createaccount-text' );
wfRunHooks( 'AddNewAccount', array( $u, true ) );
- $u->addNewUserLogEntry();
+ $u->addNewUserLogEntry( true, $this->mReason );
$wgOut->setPageTitle( wfMsg( 'accmailtitle' ) );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->addHTML( wfMsgWikiHtml( 'accountcreatedtext', $u->getName() ) );
$wgOut->returnToMain( false, $self );
wfRunHooks( 'AddNewAccount', array( $u, false ) );
- $u->addNewUserLogEntry();
+ $u->addNewUserLogEntry( false, $this->mReason );
return true;
}
}
$template->set( 'email', $this->mEmail );
$template->set( 'realname', $this->mRealName );
$template->set( 'domain', $this->mDomain );
+ $template->set( 'reason', $this->mReason );
$template->set( 'action', $titleObj->getLocalUrl( $q ) );
$template->set( 'message', $msg );
$template->set( 'emailrequired', $wgEmailConfirmToEdit );
$template->set( 'canreset', $wgAuth->allowPasswordChange() );
$template->set( 'canremember', ( $wgCookieExpiration > 0 ) );
+ $template->set( 'usereason', $wgUser->isLoggedIn() );
$template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember );
if ( $this->mType == 'signup' ) {
</div>
</td>
<?php } ?>
+ <?php if( $this->data['usereason'] ) { ?>
+ </tr>
+ <tr>
+ <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"
+ value="<?php $this->text('reason') ?>" size='20' />
+ </td>
+ <?php } ?>
</tr>
<?php if( $this->data['canremember'] ) { ?>
<tr>
'wpRemember',
'wpRemember',
$this->data['remember'],
- array( 'tabindex' => '7' )
+ array( 'tabindex' => '8' )
)
?>
</td>
</tr>
<?php }
- $tabIndex = 8;
+ $tabIndex = 9;
if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
foreach ( $this->data['extraInput'] as $inputItem ) { ?>
<tr>
'gotaccount' => 'Already have an account? $1.',
'gotaccountlink' => 'Log in',
'createaccountmail' => 'By e-mail',
+'createaccountreason' => 'Reason:',
'badretype' => 'The passwords you entered do not match.',
'userexists' => 'Username entered already in use.
Please choose a different name.',