Index: frontend/specialpages/actions/RequestAccount_body.php =================================================================== --- frontend/specialpages/actions/RequestAccount_body.php (revision 115706) +++ frontend/specialpages/actions/RequestAccount_body.php (working copy) @@ -359,19 +359,38 @@ if ( $name !== false ) { # Send confirmation email to prospective user ConfirmAccount::confirmEmail( $name ); - # Send mail to admin after e-mail has been confirmed + # Send mail to bureaucrats after e-mail has been confirmed if ( $wgConfirmAccountContact != '' ) { - $target = new MailAddress( $wgConfirmAccountContact ); $source = new MailAddress( $wgPasswordSender, $wgPasswordSenderName ); $title = SpecialPage::getTitleFor( 'ConfirmAccounts' ); $subject = wfMsgForContent( 'requestaccount-email-subj-admin' ); $body = wfMsgForContent( 'requestaccount-email-body-admin', $name, $title->getFullUrl() ); - # Actually send the email... - $result = UserMailer::send( $target, $source, $subject, $body ); - if ( !$result->isOK() ) { - wfDebug( "Could not sent email to admin at $target\n" ); + + # Get all the bureaucrats, and send each one an email + $dbr = wfGetDB( DB_SLAVE ); + # Query user_groups to get all users in the 'bureaucrat' group + $tables = array( 'u'=>'user', 'ug' => 'user_groups'); + $fields = array( 'user_id'=>'u.user_id', + 'user_name'=>'u.user_name', + 'real_name' => 'u.user_real_name', + 'email' => 'u.user_email'); + $conds = array( 'ug.ug_group="bureaucrat"', 'u.user_id = ug.ug_user'); + $bureaucrats = $dbr->select( + $tables, $fields, $conds, __METHOD__); + + while ($row = $bureaucrats->fetchRow()) + { + $target = new MailAddress( $row['user_email'] ); + if ($target != '') { + # Actually send the email... + $result = UserMailer::send( $target, $source, $subject, $body ); + if ( !$result->isOK() ) { + wfDebug( "Could not sent email to admin ".$row['user_name']." at $target\n" ); + } + } } + } $out->addWikiMsg( 'request-account-econf' ); $out->returnToMain();