From b9b85843572bf283f48285001e276ba7e61b63f6 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Feb 2009 13:37:51 +0100 Subject: updated to MediaWiki 1.14.0 --- includes/Autopromote.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'includes/Autopromote.php') 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 ) ); -- cgit v1.2.2