Manual:$wgAutopromote/ru

From mediawiki.org
This page is a translated version of the page Manual:$wgAutopromote and the translation is 42% complete.
Outdated translations are marked like this.
Доступ: $wgAutopromote
Условия автоматического присвоения специальных прав участникам
Введено в версии:1.12.0 (r28797)
Удалено в версии:всё ещё используется
Допустимые значения:(массив)
Значение по умолчанию:(see below)

Подробнее

Этот массив включает в себя список условий, которые определяют автоматическое присвоение определенных прав участникам. Синтаксис переменной:

$wgAutopromote = [
    'groupname' => cond,
    'group2' => cond,
];

cond может быть:

Possible conditions

Возможные для добавления условия:

Condition Description Argument(s)
APCOND_EDITCOUNT минимальное число правок
If null or missing $wgAutoConfirmCount will be used
Integer
APCOND_AGE минимальное число секунд после регистрации If null or missing $wgAutoConfirmAge will be used Integer
APCOND_EMAILCONFIRMED подтверждение адреса электронной почты (Not applicable)
APCOND_INGROUPS список групп, в которых находится участник E.g., 'sysop', 'bureaucrat', 'bot'
APCOND_ISIP специальный IP-адрес участника E.g., '1.2.3.4' or '2001:0db8:85a3::7344'
APCOND_IPINRANGE специальный IP-диапазон участника See Manual:IP ranges
APCOND_AGE_FROM_EDIT минимальное число секунд с момента первой правки. 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

Условия, которые пишутся в виде двойного слова, примеры:

APCOND_EMAILCONFIRMED   # условия без аргумента
array( APCOND_EDITCOUNT, 100 )   # условие с аргументом

Set of conditions

Второй вариант имеет подобный синтаксис:

[ 'operand', cond1, cond2, ... ];

Имеются 4 доступных операнда:

  • & (AND) — включается, если участник соответствует всем условиям.
  • | (OR) — включается, если участник соответствует хотя бы одному условию.
  • ^ (XOR) — если участник соответствует только одному из двух условий.
  • ! (NOT) — если участник не соответствует никакому условию.

The sets of conditions are evaluated recursively, so you can use nested sets of conditions linked by operands.

Caveats

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.


Default values

Версия MediaWiki:
1.38
$wgAutopromote = [
	'autoconfirmed' => [ '&',
		[ APCOND_EDITCOUNT, null],
		[ APCOND_AGE, null ],
	],
];
Версии MediaWiki:
1.13 – 1.37
$wgAutopromote = [
	'autoconfirmed' => [ '&',
		[ APCOND_EDITCOUNT, &$wgAutoConfirmCount ],
		[ APCOND_AGE, &$wgAutoConfirmAge ],
	],
];
Версия MediaWiki:
1.12
$wgAutopromote = array(
	'autoconfirmed' => array( '&',
		array( APCOND_EDITCOUNT, &$wgAutoConfirmCount ),
		array( APCOND_AGE, &$wgAutoConfirmAge ),
	),
	'emailconfirmed' => APCOND_EMAILCONFIRMED,
);

Example

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 ],
	],
];

См. также