$promote = array();
foreach ( $wgAutopromote as $group => $cond ) {
- if ( self::recCheckCondition( $cond, $user ) )
+ if ( self::recCheckCondition( $cond, $user ) ) {
$promote[] = $group;
+ }
}
wfRunHooks( 'GetAutoPromoteGroups', array( $user, &$promote ) );
}
return $res;
- } elseif ( $cond[0] = '!' ) {
+ } elseif ( $cond[0] == '!' ) {
foreach ( array_slice( $cond, 1 ) as $subcond ) {
if ( self::recCheckCondition( $subcond, $user ) ) {
return false;
* @return bool Whether the condition is true for the user
*/
private static function checkCondition( $cond, User $user ) {
+ global $wgEmailAuthentication;
if ( count( $cond ) < 1 ) {
return false;
}
switch( $cond[0] ) {
case APCOND_EMAILCONFIRMED:
if ( User::isValidEmailAddr( $user->getEmail() ) ) {
- global $wgEmailAuthentication;
if ( $wgEmailAuthentication ) {
return (bool)$user->getEmailAuthenticationTimestamp();
} else {
throw new MWException( "Unrecognized condition {$cond[0]} for autopromotion!" );
}
- return $result ? true : false;
+ return (bool)$result;
}
}
}