summaryrefslogtreecommitdiff
path: root/includes/Autopromote.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
committerPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
commitb9b85843572bf283f48285001e276ba7e61b63f6 (patch)
tree4c6f4571552ada9ccfb4030481dcf77308f8b254 /includes/Autopromote.php
parentd9a20acc4e789cca747ad360d87ee3f3e7aa58c1 (diff)
updated to MediaWiki 1.14.0
Diffstat (limited to 'includes/Autopromote.php')
-rw-r--r--includes/Autopromote.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/Autopromote.php b/includes/Autopromote.php
index 68fe6636..c8a4c03b 100644
--- a/includes/Autopromote.php
+++ b/includes/Autopromote.php
@@ -19,7 +19,7 @@ class Autopromote {
$promote[] = $group;
}
- wfRunHooks( 'GetAutoPromoteGroups', array($user, &$promote) );
+ wfRunHooks( 'GetAutoPromoteGroups', array( $user, &$promote ) );
return $promote;
}
@@ -106,9 +106,16 @@ class Autopromote {
case APCOND_AGE:
$age = time() - wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
return $age >= $cond[1];
+ case APCOND_AGE_FROM_EDIT:
+ $age = time() - wfTimestampOrNull( TS_UNIX, $user->getFirstEditTimestamp() );
+ return $age >= $cond[1];
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 ) );