r75751 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75750‎ | r75751 | r75752 >
Date:22:20, 31 October 2010
Author:nad
Status:deferred
Tags:
Comment:
include mailer class version-indpendently and update message re entering recipients
Modified paths:
  • /trunk/extensions/EmailPage/EmailPage.i18n.php (modified) (history)
  • /trunk/extensions/EmailPage/EmailPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EmailPage/EmailPage.i18n.php
@@ -25,9 +25,7 @@
2626 'ea-sent' => "Page [[$1]] sent successfully to '''$2''' {{PLURAL:$2|recipient|recipients}} by [[User:$3|$3]].",
2727 'ea-selectrecipients' => 'Select recipients',
2828 'ea-compose' => 'Compose content',
29 - 'ea-selectlist' => "Additional recipients as page titles or e-mail addresses
30 -*''separate items with , ; * \\n
31 -*''list can contain templates and parser-functions''",
 29+ 'ea-selectlist' => "Email addresses can be separated with one or more semicolon, comma, asterisk or newline characters",
3230 'ea-show' => 'Show recipients',
3331 'ea-send' => 'Send!',
3432 'ea-subject' => 'Enter a subject line for the e-mail',
Index: trunk/extensions/EmailPage/EmailPage.php
@@ -1,6 +1,7 @@
22 <?php
33 /**
4 - * EmailPage extension - Send rendered HTML page to an email address or list of addresses using phpmailer
 4+ * EmailPage extension - Send rendered HTML page to an email address or list of addresses using
 5+ * the phpmailer class from http://phpmailer.sourceforge.net/
56 *
67 * See http://www.mediawiki.org/wiki/Extension:EmailPage for installation and usage details
78 *
@@ -12,7 +13,7 @@
1314 */
1415 if( !defined( 'MEDIAWIKI' ) ) die( "Not an entry point." );
1516
16 -define( 'EMAILPAGE_VERSION', "1.4.0, 2010-10-29" );
 17+define( 'EMAILPAGE_VERSION', "2.0.0, 2010-11-01" );
1718
1819 $wgEmailPageGroup = "sysop"; # Users must belong to this group to send emails (empty string means anyone can send)
1920 $wgEmailPageCss = "EmailPage.css"; # A minimal CSS page to embed in the email (eg. monobook/main.css without portlets, actions etc)
@@ -20,16 +21,15 @@
2122 $wgEmailPageAllowAllUsers = false; # Whether to allow sending to all users (the "user" group)
2223 $wgEmailPageToolboxLink = true; # Add a link to the sidebar toolbox?
2324 $wgEmailPageActionLink = true; # Add a link to the actions links?
24 -$wgPhpMailerClass = dirname( __FILE__ ) . "/PHPMailer_v5.1/class.phpmailer.php"; # From http://phpmailer.sourceforge.net/
2525
2626 if( $wgEmailPageGroup ) $wgGroupPermissions['sysop'][$wgEmailPageGroup] = true;
2727
2828 if( isset( $_SERVER['SERVER_ADDR'] ) ) $wgEmailPageAllowRemoteAddr[] = $_SERVER['SERVER_ADDR'];
2929
30 -$dir = dirname( __FILE__ ) . '/';
31 -$wgAutoloadClasses['SpecialEmailPage'] = $dir . "EmailPage_body.php";
32 -$wgExtensionMessagesFiles['EmailPage'] = $dir . "EmailPage.i18n.php";
33 -$wgExtensionAliasesFiles['EmailPage'] = $dir . "EmailPage.alias.php";
 30+$dir = dirname( __FILE__ );
 31+$wgAutoloadClasses['SpecialEmailPage'] = "$dir/EmailPage_body.php";
 32+$wgExtensionMessagesFiles['EmailPage'] = "$dir/EmailPage.i18n.php";
 33+$wgExtensionAliasesFiles['EmailPage'] = "$dir/EmailPage.alias.php";
3434 $wgSpecialPages['EmailPage'] = "SpecialEmailPage";
3535
3636 $wgExtensionCredits['specialpage'][] = array(
@@ -42,7 +42,10 @@
4343 );
4444
4545 # If form has been posted, include the phpmailer class
46 -if( isset( $_REQUEST['ea-send'] ) ) require_once( $wgPhpMailerClass );
 46+if( isset( $_REQUEST['ea-send'] ) ) {
 47+ if( $files = glob( "$dir/*/class.phpmailer.php" ) ) require_once( $files[0] );
 48+ else die( "PHPMailer class not found!" );
 49+}
4750
4851 # Add toolbox and action links
4952 if( $wgEmailPageToolboxLink ) $wgHooks['SkinTemplateToolboxEnd'][] = 'wfEmailPageToolboxLink';

Status & tagging log