Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F9754
EmailBureaucrats.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 22 2014, 12:51 AM
2014-11-22 00:51:34 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
EmailBureaucrats.patch
View Options
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();
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9248
Default Alt Text
EmailBureaucrats.patch (2 KB)
Attached To
Mode
T42221: Notify all bureaucrats when account request comes in
Attached
Detach File
Event Timeline
Log In to Comment