Handbuch:$wgAutopromote
Zugang: $wgAutopromote | |
---|---|
Bedingungen für die automatische Einordnung von Benutzern in bestimmten Benutzergruppen |
|
Eingeführt in Version: | 1.12.0 (r28797) |
Entfernt in Version: | weiterhin vorhanden |
Erlaubte Werte: | (Array) |
Standardwert: | (siehe unten) |
Andere Einstellungen: Alphabetisch | Nach Funktion |
Details
Dieses Array beinhaltet die Kriterien für eine automatische Beförderung. Die Syntax ist wie folgt:
$wgAutopromote = [
'groupname' => cond,
'group2' => cond,
];
cond
kann hier sein:
- eine einzelne Vorraussetzung
- eine Liste von Vorraussetzungen
Mögliche Bedingungen =
Mögliche Bedingungen sind (definiert in Defines.php , Erweiterungen können weitere über den AutopromoteCondition -Hook hinzugefügen):
Bedingung | Beschreibung | Argument(e) |
---|---|---|
APCOND_EDITCOUNT | eine bestimmte Anzahl von Bearbeitungen ist nötig. If null or missing $wgAutoConfirmCount will be used
|
Integer |
APCOND_AGE | eine bestimmte Anzahl von Sekunden seit der Registrierung ist nötig If null or missing $wgAutoConfirmAge will be used
|
Integer |
APCOND_EMAILCONFIRMED | Die Email-Adresse muss bestätigt sein | (Not applicable) |
APCOND_INGROUPS | Eine Liste von Gruppen in der sich der Benutzer befinden muss | z.B.:, 'sysop', 'bureaucrat', 'bot'
|
APCOND_ISIP | Der Benutzer muss eine bestimmte IP-Adresse haben | z.B.:, '1.2.3.4' or '2001:0db8:85a3::7344'
|
APCOND_IPINRANGE | Der Benutzer muss eine IP-Adresse in einem bestimmten IP-Bereich haben | Siehe Manual:IP ranges |
APCOND_AGE_FROM_EDIT | eine bestimmte Anzahl von Sekunden seit der ersten Bearbeitung ist nötig | Integer |
APCOND_BLOCKED | Account is blocked (added in v1.16: r52083) | (Not applicable) |
APCOND_ISBOT | Account is a bot | (Not applicable) |
Conditions with and without arguments
Die Bedingungen können in zwei Formen angegeben werden:
APCOND_EMAILCONFIRMED # Bedingung ohne Argumente
array( APCOND_EDITCOUNT, 100 ) # Bedingung mit einem Argument
Set of conditions
Letzteres hat folgende Syntax:
[ 'operand', cond1, cond2, ... ];
Es gibt 4 Operanden (operand):
- & (AND) — Benutzer befördern, wenn alle Bedingungen zutreffen
- | (OR) — Benutzer befördern, wenn mindestens eine Bedingung zutrifft
- ^ (XOR) — Benutzer befördern, wenn nur eine Bedingung zutrifft
- ! (NOT) — Benutzer befördern, wenn keine der Bedingungen zutrifft
The sets of conditions are evaluated recursively, so you can use nested sets of conditions linked by operands.
Einschränkungen
Autopromotion does not actually add users to a group; MediaWiki will check whether a user meets the conditions for autopromotion whenever it checks the user's rights or effective groups. This means that a user will only appear to be in a group on Special:ListUsers if they were added to it through Special:UserRights.
Since MediaWiki 1.18 you can use AutopromoteOnce instead, which adds users normally to a group, if they match the given criteria and have not been demoted before. Alternatively, $wgRevokePermissions (MW 1.16+) might be useful for you.
Temporary users cannot be autopromoted, since they cannot be assigned to user groups.
Standardwerte
MediaWiki Version: | ≥ 1.38 |
$wgAutopromote = [
'autoconfirmed' => [ '&',
[ APCOND_EDITCOUNT, null],
[ APCOND_AGE, null ],
],
];
MediaWiki Versions: | 1.13 – 1.37 |
$wgAutopromote = [
'autoconfirmed' => [ '&',
[ APCOND_EDITCOUNT, &$wgAutoConfirmCount ],
[ APCOND_AGE, &$wgAutoConfirmAge ],
],
];
MediaWiki Version: | 1.12 |
$wgAutopromote = array(
'autoconfirmed' => array( '&',
array( APCOND_EDITCOUNT, &$wgAutoConfirmCount ),
array( APCOND_AGE, &$wgAutoConfirmAge ),
),
'emailconfirmed' => APCOND_EMAILCONFIRMED,
);
Beispiel
If you wanted to autopromote each user to captain upon their having both confirmed their email address and either made at least 100 edits or registered their account at least 60 days ago, you would use:
$wgAutopromote = [
'captain' => [
'&',
APCOND_EMAILCONFIRMED,
[
'|',
[ APCOND_EDITCOUNT, 100 ],
[ APCOND_AGE, 60*86400 ],
],
],
];
Note that this would get rid of all other autopromote groups; to instead add the captain autopromote group while keeping those autopromote groups that already exist, one would use:
$wgAutopromote['captain'] = [
'&',
APCOND_EMAILCONFIRMED,
[
'|',
[ APCOND_EDITCOUNT, 100 ],
[ APCOND_AGE, 60*86400 ],
],
];