[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/ -> Autopromote.php (summary)

Automatic user rights promotion based on conditions specified in $wgAutopromote. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 209 lines (7 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

Autopromote:: (4 methods):
  getAutopromoteGroups()
  getAutopromoteOnceGroups()
  recCheckCondition()
  checkCondition()


Class: Autopromote  - X-Ref

This class checks if user can get extra rights
because of conditions specified in $wgAutopromote

getAutopromoteGroups( User $user )   X-Ref
Get the groups for the given user based on $wgAutopromote.

param: User $user The user to get the groups for
return: array Array of groups to promote to.

getAutopromoteOnceGroups( User $user, $event )   X-Ref
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.

param: User $user The user to get the groups for
param: string $event Key in $wgAutopromoteOnce (each one has groups/criteria)
return: array Groups the user should be promoted to.

recCheckCondition( $cond, User $user )   X-Ref
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.

param: mixed $cond A condition, possibly containing other conditions
param: User $user The user to check the conditions against
return: bool Whether the condition is true

checkCondition( $cond, User $user )   X-Ref
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.

param: array $cond A condition, which must not contain other conditions
param: User $user The user to check the condition against
return: bool Whether the condition is true for the user



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1