MediaWiki
1.33.0
|
This class checks if user can get extra rights because of conditions specified in $wgAutopromote. More...
Static Public Member Functions | |
static | getAutopromoteGroups (User $user) |
Get the groups for the given user based on $wgAutopromote. More... | |
static | getAutopromoteOnceGroups (User $user, $event) |
Get the groups for the given user based on the given criteria. More... | |
Static Private Member Functions | |
static | checkCondition ( $cond, User $user) |
As recCheckCondition, but not recursive. More... | |
static | recCheckCondition ( $cond, User $user) |
Recursively check a condition. More... | |
This class checks if user can get extra rights because of conditions specified in $wgAutopromote.
Definition at line 28 of file Autopromote.php.
|
staticprivate |
As recCheckCondition, but not recursive.
The only valid conditions are those whose first element is APCOND_EMAILCONFIRMED/APCOND_EDITCOUNT/ APCOND_AGE. Other types will throw an exception if no extension evaluates them.
array | $cond | A condition, which must not contain other conditions |
User | $user | The user to check the condition against |
MWException |
Definition at line 163 of file Autopromote.php.
References $user, $wgEmailAuthentication, APCOND_AGE, APCOND_AGE_FROM_EDIT, APCOND_BLOCKED, APCOND_EDITCOUNT, APCOND_EMAILCONFIRMED, APCOND_INGROUPS, APCOND_IPINRANGE, APCOND_ISBOT, APCOND_ISIP, captcha-old\count, User\getGroupPermissions(), IP\isInRange(), Hooks\run(), and wfTimestampOrNull().
Referenced by recCheckCondition().
|
static |
Get the groups for the given user based on $wgAutopromote.
User | $user | The user to get the groups for |
Definition at line 35 of file Autopromote.php.
References $user, $wgAutopromote, as, and Hooks\run().
Referenced by User\getAutomaticGroups(), UserrightsPage\showEditUserGroupsForm(), and AutopromoteTest\testEditCountLookupIsSkippedIfRequirementIsZero().
|
static |
Get the groups for the given user based on the given criteria.
Does not return groups the user already belongs to or has once belonged.
User | $user | The user to get the groups for |
string | $event | Key in $wgAutopromoteOnce (each one has groups/criteria) |
Definition at line 63 of file Autopromote.php.
References $user, $wgAutopromoteOnce, as, and captcha-old\count.
Referenced by User\addAutopromoteOnceGroups().
|
staticprivate |
Recursively check a condition.
Conditions are in the form array( '&' or '|' or '^' or '!', cond1, cond2, ... ) where cond1, cond2, ... are themselves conditions; OR APCOND_EMAILCONFIRMED, OR array( APCOND_EMAILCONFIRMED ), OR array( APCOND_EDITCOUNT, number of edits ), OR array( APCOND_AGE, seconds since registration ), OR similar constructs defined by extensions. This function evaluates the former type recursively, and passes off to self::checkCondition for evaluation of the latter type.
mixed | $cond | A condition, possibly containing other conditions |
User | $user | The user to check the conditions against |
Definition at line 106 of file Autopromote.php.
References $user, as, checkCondition(), captcha-old\count, and wfWarn().