r44592 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44591‎ | r44592 | r44593 >
Date:20:49, 14 December 2008
Author:demon
Status:ok (Comments)
Tags:
Comment:
(bug 7492) Allow assignment of rights to specific IPs/ranges
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Autopromote.php (modified) (history)
  • /trunk/phase3/includes/Defines.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Defines.php
@@ -224,3 +224,5 @@
225225 define( 'APCOND_AGE', 2 );
226226 define( 'APCOND_EMAILCONFIRMED', 3 );
227227 define( 'APCOND_INGROUPS', 4 );
 228+define( 'APCOND_ISIP', 5 );
 229+define( 'APCOND_IPINRANGE', 6 );
Index: trunk/phase3/includes/Autopromote.php
@@ -109,6 +109,10 @@
110110 case APCOND_INGROUPS:
111111 $groups = array_slice( $cond, 1 );
112112 return count( array_intersect( $groups, $user->getGroups() ) ) == count( $groups );
 113+ case APCOND_ISIP:
 114+ return $cond[1] == wfGetIP();
 115+ case APCOND_IPINRANGE:
 116+ return IP::isInRange( wfGetIP(), $cond[1] );
113117 default:
114118 $result = null;
115119 wfRunHooks( 'AutopromoteCondition', array( $cond[0], array_slice( $cond, 1 ), $user, &$result ) );
Index: trunk/phase3/RELEASE-NOTES
@@ -230,6 +230,8 @@
231231 * (bug 16635) The "view and edit watchlist" page (Special:Watchlist/edit) now
232232 includes a table of contents
233233 * File objects returned by wfFindFile() are now cached by default
 234+* (bug 7492) Rights can now be assigned to specific IP addresses and ranges by
 235+ using $wgAutopromote (new defines: APCOND_ISIP and APCOND_IPINRANGE)
234236
235237 === Bug fixes in 1.14 ===
236238

Follow-up revisions

RevisionCommit summaryAuthorDate
r44696Reverting r44681 "Throw in quick hack $wgRateLimitsExcludedIPs so we don't ha...brion00:05, 17 December 2008

Comments

#Comment by Simetrical (talk | contribs)   23:28, 19 February 2009

This didn't update the DefaultSettings.php documentation for $wgAutopromote.

Status & tagging log