* (bug 4469) Namespace-specific notice to be displayed below site-notice
Edit messages like "MediaWiki:Namespacenotice-" plus namespace name
which is blank for main namespace, or like e.g. "User_talk"
+* Adjust user login/creation form hooks to work with a captcha plugin
+
=== Caveats ===
'AbortNewAccount': Return false to cancel account creation.
$user: the User object about to be created (read-only, incomplete)
+$message: out parameter: error message to display on abort
'AddNewAccount': after a user account is created
null: This hook passes null as an argument
string $tempName: filesystem path to the temporary file for checks
string &$error: output: HTML error to show if upload canceled by returning false
+'UserCreateForm': change to manipulate the login form
+$template: SimpleTemplate instance for the form
+
'UserLoginComplete': after a user has logged in
$user: the user object that was created on login
+'UserLoginForm': change to manipulate the login form
+$template: SimpleTemplate instance for the form
+
'UserLogout': before a user logs out
$user: the user object that is about to be logged out
}
}
- if( !wfRunHooks( 'AbortNewAccount', array( $u ) ) ) {
+ $abortError = '';
+ if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
// Hook point to add extra creation throttles and blocks
wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
+ $this->mainLoginForm( $abortError );
return false;
}
$link .= '</a>';
$template->set( 'link', wfMsgHtml( $linkmsg, $link ) );
+ $template->set( 'header', '' );
$template->set( 'name', $this->mName );
$template->set( 'password', $this->mPassword );
$template->set( 'userealname', $wgAllowRealName );
$template->set( 'useemail', $wgEnableEmail );
$template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember );
+
+ // Give authentication and captcha plugins a chance to modify the form
$wgAuth->modifyUITemplate( $template );
+ if ( $this->mType == 'signup' ) {
+ wfRunHooks( 'UserCreateForm', array( &$template ) );
+ } else {
+ wfRunHooks( 'UserLoginForm', array( &$template ) );
+ }
$wgOut->setPageTitle( wfMsg( 'userlogin' ) );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
<form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>">
<h2><?php $this->msg('createaccount') ?></h2>
<p id="userloginlink"><?php $this->html('link') ?></p>
+ <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
<table>
<tr>
<td align='right'><label for='wpName2'><?php $this->msg('yourname') ?>:</label></td>
padding-top: 0;
}
+div#userlogin .captcha {
+ border: 1px solid #bbb;
+ padding: 1.5em 2em;
+ width: 400px;
+ background-color: white;
+}
#userloginprompt {