Page MenuHomePhabricator

autopromote.patch

Authored By
bzimport
Nov 21 2014, 9:27 PM
Size
1009 B
Referenced Files
None
Subscribers
None

autopromote.patch

Index: includes/Autopromote.php
===================================================================
--- includes/Autopromote.php (revision 44543)
+++ includes/Autopromote.php (working copy)
@@ -109,6 +109,10 @@
case APCOND_INGROUPS:
$groups = array_slice( $cond, 1 );
return count( array_intersect( $groups, $user->getGroups() ) ) == count( $groups );
+ case APCOND_ISIP:
+ return $cond[1] == wfGetIP();
+ case APCOND_IPINRANGE:
+ return IP::isInRange( wfGetIP(), $cond[1] );
default:
$result = null;
wfRunHooks( 'AutopromoteCondition', array( $cond[0], array_slice( $cond, 1 ), $user, &$result ) );
Index: includes/Defines.php
===================================================================
--- includes/Defines.php (revision 44543)
+++ includes/Defines.php (working copy)
@@ -224,3 +224,5 @@
define( 'APCOND_AGE', 2 );
define( 'APCOND_EMAILCONFIRMED', 3 );
define( 'APCOND_INGROUPS', 4 );
+define( 'APCOND_ISIP', 5 );
+define( 'APCOND_IPINRANGE', 6 );

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2898
Default Alt Text
autopromote.patch (1009 B)

Event Timeline