$wgLogHeaders = array(
'' => 'alllogstext',
'block' => 'blocklogtext',
- 'protect' => 'protectlogtext',
- 'rights' => 'rightslogtext',
'delete' => 'dellogpagetext',
- 'upload' => 'uploadlogpagetext',
- 'move' => 'movelogpagetext',
'import' => 'importlogpagetext',
- 'patrol' => 'patrol-log-header',
'merge' => 'mergelogpagetext',
+ 'move' => 'movelogpagetext',
+ 'patrol' => 'patrol-log-header',
+ 'protect' => 'protectlogtext',
+ 'rights' => 'rightslogtext',
'suppress' => 'suppressionlogtext',
+ 'upload' => 'uploadlogpagetext',
);
/**
* Extensions with custom log types may add to this array.
*/
$wgLogActions = array(
- 'protect/protect' => 'protectedarticle',
'protect/modify' => 'modifiedarticleprotection',
- 'protect/unprotect' => 'unprotectedarticle',
'protect/move_prot' => 'movedarticleprotection',
+ 'protect/protect' => 'protectedarticle',
+ 'protect/unprotect' => 'unprotectedarticle',
);
/**
* @see LogFormatter
*/
$wgLogActionsHandlers = array(
- 'move/move' => 'MoveLogFormatter',
- 'move/move_redir' => 'MoveLogFormatter',
+ 'block/block' => 'BlockLogFormatter',
+ 'block/reblock' => 'BlockLogFormatter',
+ 'block/unblock' => 'BlockLogFormatter',
+ 'contentmodel/change' => 'ContentModelLogFormatter',
'delete/delete' => 'DeleteLogFormatter',
+ 'delete/event' => 'DeleteLogFormatter',
'delete/restore' => 'DeleteLogFormatter',
'delete/revision' => 'DeleteLogFormatter',
- 'delete/event' => 'DeleteLogFormatter',
- 'suppress/revision' => 'DeleteLogFormatter',
- 'suppress/event' => 'DeleteLogFormatter',
- 'suppress/delete' => 'DeleteLogFormatter',
- 'patrol/patrol' => 'PatrolLogFormatter',
- 'rights/rights' => 'RightsLogFormatter',
- 'rights/autopromote' => 'RightsLogFormatter',
- 'upload/upload' => 'UploadLogFormatter',
- 'upload/overwrite' => 'UploadLogFormatter',
- 'upload/revert' => 'UploadLogFormatter',
- 'merge/merge' => 'MergeLogFormatter',
- 'tag/update' => 'TagLogFormatter',
- 'managetags/create' => 'LogFormatter',
- 'managetags/delete' => 'LogFormatter',
+ 'import/interwiki' => 'LogFormatter',
+ 'import/upload' => 'LogFormatter',
'managetags/activate' => 'LogFormatter',
+ 'managetags/create' => 'LogFormatter',
'managetags/deactivate' => 'LogFormatter',
- 'block/block' => 'BlockLogFormatter',
- 'block/unblock' => 'BlockLogFormatter',
- 'block/reblock' => 'BlockLogFormatter',
+ 'managetags/delete' => 'LogFormatter',
+ 'merge/merge' => 'MergeLogFormatter',
+ 'move/move' => 'MoveLogFormatter',
+ 'move/move_redir' => 'MoveLogFormatter',
+ 'patrol/patrol' => 'PatrolLogFormatter',
+ 'rights/autopromote' => 'RightsLogFormatter',
+ 'rights/rights' => 'RightsLogFormatter',
'suppress/block' => 'BlockLogFormatter',
+ 'suppress/delete' => 'DeleteLogFormatter',
+ 'suppress/event' => 'DeleteLogFormatter',
'suppress/reblock' => 'BlockLogFormatter',
- 'import/upload' => 'LogFormatter',
- 'import/interwiki' => 'LogFormatter',
- 'contentmodel/change' => 'ContentModelLogFormatter',
+ 'suppress/revision' => 'DeleteLogFormatter',
+ 'tag/update' => 'TagLogFormatter',
+ 'upload/overwrite' => 'UploadLogFormatter',
+ 'upload/revert' => 'UploadLogFormatter',
+ 'upload/upload' => 'UploadLogFormatter',
);
/**
*/
public function checkUserPassword( User $user, $password ) {
$effectivePolicy = $this->getPoliciesForUser( $user );
- $status = Status::newGood();
+ return $this->checkPolicies(
+ $user,
+ $password,
+ $effectivePolicy,
+ $this->policyCheckFunctions
+ );
+ }
+
+ /**
+ * Check if a passwords meets the effective password policy for a User, using a set
+ * of groups they may or may not belong to. This function does not use the DB, so can
+ * be used in the installer.
+ * @param User $user who's policy we are checking
+ * @param string $password the password to check
+ * @param array $groups list of groups to which we assume the user belongs
+ * @return Status error to indicate the password didn't meet the policy, or fatal to
+ * indicate the user shouldn't be allowed to login.
+ */
+ public function checkUserPasswordForGroups( User $user, $password, array $groups ) {
+ $effectivePolicy = self::getPoliciesForGroups(
+ $this->policies,
+ $groups,
+ $this->policies['default']
+ );
+ return $this->checkPolicies(
+ $user,
+ $password,
+ $effectivePolicy,
+ $this->policyCheckFunctions
+ );
+ }
- foreach ( $effectivePolicy as $policy => $value ) {
- if ( !isset( $this->policyCheckFunctions[$policy] ) ) {
+ private function checkPolicies( User $user, $password, $policies, $policyCheckFunctions ) {
+ $status = Status::newGood();
+ foreach ( $policies as $policy => $value ) {
+ if ( !isset( $policyCheckFunctions[$policy] ) ) {
throw new DomainException( 'Invalid password policy config' );
}
$status->merge(
call_user_func(
- $this->policyCheckFunctions[$policy],
+ $policyCheckFunctions[$policy],
$value,
$user,
$password
)
);
}
-
return $status;
}