|
MediaWiki master
|
Public Member Functions | |
| __construct (private readonly ServiceOptions $options, private readonly GroupPermissionsLookup $groupPermissionsLookup, HookContainer $hookContainer, private readonly LoggerInterface $logger, private readonly UserEditTracker $userEditTracker, private readonly UserRegistrationLookup $userRegistrationLookup, private readonly UserFactory $userFactory, private readonly IContextSource $context, private readonly UserGroupManager $userGroupManager, private readonly string|false $wikiId=UserIdentity::LOCAL,) | |
| extractPrivateConditions ( $cond) | |
| Goes through a condition passed as the input and extracts all private conditions that are used within it. | |
| recursivelyCheckCondition ( $cond, UserIdentity $user, bool $usePrivateConditions=true) | |
| Recursively check a condition. | |
Public Attributes | |
| const | CONSTRUCTOR_OPTIONS |
| const | VALID_OPS = [ '&', '|', '^', '!' ] |
| Logical operators recognized in $wgAutopromote. | |
Protected Member Functions | |
| checkCondition (array $cond, UserIdentity $user) | |
| As recursivelyCheckCondition, but not recursive. | |
Definition at line 29 of file UserRequirementsConditionChecker.php.
| MediaWiki\User\UserRequirementsConditionChecker::__construct | ( | private readonly ServiceOptions | $options, |
| private readonly GroupPermissionsLookup | $groupPermissionsLookup, | ||
| HookContainer | $hookContainer, | ||
| private readonly LoggerInterface | $logger, | ||
| private readonly UserEditTracker | $userEditTracker, | ||
| private readonly UserRegistrationLookup | $userRegistrationLookup, | ||
| private readonly UserFactory | $userFactory, | ||
| private readonly IContextSource | $context, | ||
| private readonly UserGroupManager | $userGroupManager, | ||
| private readonly string|false | $wikiId = UserIdentity::LOCAL ) |
Definition at line 55 of file UserRequirementsConditionChecker.php.
|
protected |
As recursivelyCheckCondition, but not recursive.
The only valid conditions are those whose first element is one of APCOND_* defined in Defines.php. Other types will throw an exception if no extension evaluates them.
| array | $cond | A condition, which must not contain other conditions. This array must contain at least one item, which is the condition type. |
| UserIdentity | $user | The user to check the condition against |
| InvalidArgumentException | if autopromote condition was not recognized. |
| LogicException | if APCOND_BLOCKED is checked again before returning a result. |
Definition at line 85 of file UserRequirementsConditionChecker.php.
References APCOND_AGE, APCOND_AGE_FROM_EDIT, APCOND_BLOCKED, APCOND_EDITCOUNT, APCOND_EMAILCONFIRMED, APCOND_INGROUPS, APCOND_IPINRANGE, APCOND_ISBOT, APCOND_ISIP, MediaWiki\MainConfigNames\AutoConfirmAge, MediaWiki\MainConfigNames\AutoConfirmCount, MediaWiki\MainConfigNames\EmailAuthentication, and wfTimestampOrNull().
| MediaWiki\User\UserRequirementsConditionChecker::extractPrivateConditions | ( | $cond | ) |
Goes through a condition passed as the input and extracts all private conditions that are used within it.
| mixed | $cond | A condition, possibly containing other conditions. |
Definition at line 323 of file UserRequirementsConditionChecker.php.
| MediaWiki\User\UserRequirementsConditionChecker::recursivelyCheckCondition | ( | $cond, | |
| UserIdentity | $user, | ||
| bool | $usePrivateConditions = true ) |
Recursively check a condition.
Conditions are in the form [ '&' or '|' or '^' or '!', cond1, cond2, ... ] where cond1, cond2, ... are themselves conditions; OR APCOND_EMAILCONFIRMED, OR [ APCOND_EMAILCONFIRMED ], OR [ APCOND_EDITCOUNT, number of edits ], OR [ APCOND_AGE, seconds since registration ], OR similar constructs defined by extensions. This function evaluates the former type recursively, and passes off to checkCondition for evaluation of the latter type.
If you change the logic of this method, please update ApiQuerySiteinfo::appendAutoPromote(), as it depends on this method.
| mixed | $cond | A condition, possibly containing other conditions |
| UserIdentity | $user | The user to check the conditions against |
| bool | $usePrivateConditions | Whether to evaluate private conditions |
Definition at line 217 of file UserRequirementsConditionChecker.php.
References MediaWiki\MainConfigNames\UserRequirementsPrivateConditions.
| const MediaWiki\User\UserRequirementsConditionChecker::CONSTRUCTOR_OPTIONS |
Definition at line 39 of file UserRequirementsConditionChecker.php.
| const MediaWiki\User\UserRequirementsConditionChecker::VALID_OPS = [ '&', '|', '^', '!' ] |
Logical operators recognized in $wgAutopromote.
Definition at line 36 of file UserRequirementsConditionChecker.php.