Manual:$wgAutopromote

From MediaWiki.org

Jump to: navigation, search
Access: $wgAutopromote
Conditions of automatic promotion of user to specific groups
Introduced in version: 1.12.0 (r28797)
Removed in version: still in use
Allowed values: array
Default value:
$wgAutopromote = array(
    'autoconfirmed' => array( '&',
        array( APCOND_EDITCOUNT, &$wgAutoConfirmCount ),
        array( APCOND_AGE, &$wgAutoConfirmAge ),
    ),
    'emailconfirmed' => APCOND_EMAILCONFIRMED,
);

1.14+

$wgAutopromote = array(
	'autoconfirmed' => array( '&',
		array( APCOND_EDITCOUNT, &$wgAutoConfirmCount ),
		array( APCOND_AGE, &$wgAutoConfirmAge ),
	),
);

Other settings: Alphabetical | By Function


[edit] Details

This array contains criteria of automatic promotion. The syntax is:

$wgAutopromote = array(
    'groupname' => cond,
    'group2' => cond,
);

cond here may be:

  • A single condition
  • A set of conditions

The latter has following syntax:

array( 'operand', cond1, cond2, ... );

There are 4 operands available:

  • & (AND) — promote if user matches all conditions
  • | (OR) — promote if user matches any condition
  • ^ (XOR) — promote if user matches only one of two conditions
  • ! (NOT) — promote if user matches no conditions.

Condition can be written in two forms:

APCOND_EMAILCONFIRMED   # condition with no arguments
array( APCOND_EDITCOUNT, 100 )   # condition with arguments

Possible conditions (extensions may add more through the AutopromoteCondition hook):

  • APCOND_EDITCOUNT: minimum number of edits necessary
  • APCOND_AGE: minimum number of seconds since registration
  • APCOND_EMAILCONFIRMED: email address has been confirmed
  • APCOND_INGROUPS: list of groups the user must be in
  • APCOND_ISIP: user has a specific IP address
  • APCOND_IPINRANGE: user is in a specific IP range
  • APCOND_AGE_FROM_EDIT: minimum number of seconds since first edit