r95041 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95040‎ | r95041 | r95042 >
Date:20:57, 19 August 2011
Author:raymond
Status:reverted (Comments)
Tags:
Comment:
New hook point to change $wgAccountCreationThrottle
Needed for a new extension to make (mass) account creation easier for schools/colleges etc
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -643,6 +643,10 @@
644644 'CategoryPageView': before viewing a categorypage in CategoryPage::view
645645 $catpage: CategoryPage instance
646646
 647+'ChangeAccountCreationThrottle': Called to change $wgAccountCreationThrottle
 648+$ip: The ip address of the user
 649+&$wgAccountCreationThrottle: The global variable $wgAccountCreationThrottle to be changed
 650+
647651 'ChangesListInsertArticleLink': Override or augment link to article in RC list.
648652 &$changesList: ChangesList instance.
649653 &$articlelink: HTML of link to article (already filled-in).
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -377,6 +377,9 @@
378378 return false;
379379 }
380380
 381+ // Hook point to change $wgAccountCreationThrottle
 382+ wfRunHooks( 'ChangeAccountCreationThrottle', array( $ip, &$wgAccountCreationThrottle ) );
 383+
381384 if ( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) {
382385 $key = wfMemcKey( 'acctcreate', 'ip', $ip );
383386 $value = $wgMemc->get( $key );

Follow-up revisions

RevisionCommit summaryAuthorDate
r95101Self revert r95041 per CR. I will commit a cleaner patch.raymond18:07, 20 August 2011
r95152New hook point to exempt an IP address from the account creation throttle. Re...raymond16:38, 21 August 2011

Comments

#Comment by Nikerabbit (talk | contribs)   13:22, 20 August 2011

This hook looks overtly specific and changing the global variable like that feels icky .

#Comment by Raymond (talk | contribs)   13:45, 20 August 2011

Do have a better idea instead to change the throttle (IP specific) with an extension?

#Comment by Nikerabbit (talk | contribs)   14:01, 20 August 2011

Is it possible to let the hook directly determine whether the ip is should be throttled or not?

Status & tagging log