mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
(bug 30444) Add variables user_name and user_groups for action createaccount. Patch by Beau
This commit is contained in:
parent
e6e286ba31
commit
0f274e5b32
Notes:
Raimond Spekking
2012-03-12 20:46:25 +00:00
|
@ -1523,7 +1523,12 @@ class AbuseFilter {
|
|||
$vars->setVar( 'ACTION', 'createaccount' );
|
||||
|
||||
$name = Title::makeTitle( $row->rc_namespace, $row->rc_title )->getText();
|
||||
$vars->setVar( 'user_name', $name );
|
||||
// Add user data if the account was created by a registered user
|
||||
if ( $row->rc_user && $name != $row->rc_user_text ) {
|
||||
$user = User::newFromName( $row->rc_user_text );
|
||||
$vars->addHolder( self::generateUserVars( $user ) );
|
||||
}
|
||||
|
||||
$vars->setVar( 'accountname', $name );
|
||||
return $vars;
|
||||
}
|
||||
|
|
|
@ -105,6 +105,12 @@ class AbuseFilterHooks {
|
|||
return false;
|
||||
}
|
||||
$vars = new AbuseFilterVariableHolder;
|
||||
// Add variables only for a registered user, so IP addresses of
|
||||
// new users won't be exposed
|
||||
global $wgUser;
|
||||
if ( $wgUser->getId() ) {
|
||||
$vars->addHolder( AbuseFilter::generateUserVars( $wgUser ) );
|
||||
}
|
||||
|
||||
$vars->setVar( 'ACTION', 'createaccount' );
|
||||
$vars->setVar( 'ACCOUNTNAME', $user->getName() );
|
||||
|
|
Loading…
Reference in a new issue