Index: trunk/extensions/EmailPage/EmailPage_body.php |
— | — | @@ -38,16 +38,16 @@ |
39 | 39 | $this->from = $wgRequest->getText( 'ea-from' ); |
40 | 40 | $this->subject = $wgRequest->getText( 'ea-subject', wfMsg( 'ea-pagesend', $this->title, $wgSitename ) ); |
41 | 41 | $this->message = $wgRequest->getText( 'ea-message' ); |
42 | | - $this->message = $wgRequest->getText( 'ea-message' ); |
43 | 42 | $this->group = $wgRequest->getText( 'ea-group' ); |
44 | | - $this->to = $wgRequest->getText( 'ea-to' ) . ";" . $wgRequest->getText( 'ea-cc' ); |
| 43 | + $this->to = $wgRequest->getText( 'ea-to' ); |
| 44 | + $this->cc = $wgRequest->getText( 'ea-cc' ); |
45 | 45 | $this->textonly = $wgRequest->getText( 'ea-textonly', false ); |
46 | 46 | $this->css = $wgRequest->getText( 'ea-css', $wgEmailPageCss ); |
47 | 47 | $this->record = $wgRequest->getText( 'ea-record', false ); |
48 | 48 | $this->db = $db; |
49 | 49 | |
50 | 50 | # Bail if no page title to send has been specified |
51 | | - if( $this->title ) $wgOut->addWikiText( wfMsg( 'ea-heading', $this->title ) ); |
| 51 | + if( $this->title ) $wgOut->addWikiText( "===" . wfMsg( 'ea-heading', $this->title ) . "===" ); |
52 | 52 | else return $wgOut->addWikiText( wfMsg( 'ea-nopage' ) ); |
53 | 53 | |
54 | 54 | # If the send button was clicked, attempt to send and exit |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | # To |
74 | 74 | $wgOut->addHTML( "<tr id=\"ea-to\"><th align=\"right\" valign=\"top\">" . wfMsg( 'ea-to' ) . ":</th>" ); |
75 | | - $wgOut->addHTML( "<td><textarea name=\"ea-to\" rows=\"2\" style=\"width:100%\"></textarea>" ); |
| 75 | + $wgOut->addHTML( "<td><textarea name=\"ea-to\" rows=\"2\" style=\"width:100%\">{$this->to}</textarea>" ); |
76 | 76 | $wgOut->addHTML( "<br /><small><i>(" . wfMsg( 'ea-to-info' ) . ")</i></small>" ); |
77 | 77 | |
78 | 78 | # To group |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | Xml::element( 'input', array( |
97 | 97 | 'type' => 'text', |
98 | 98 | 'name' => 'ea-cc', |
99 | | - 'value' => $ue, |
| 99 | + 'value' => $this->cc ? $this->cc : $ue, |
100 | 100 | 'style' => "width:100%" |
101 | 101 | ) ) |
102 | 102 | . "</td></tr>" ); |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | |
115 | 115 | # Message |
116 | 116 | $wgOut->addHTML( "<tr id=\"ea-message\"><th align=\"right\" valign=\"top\">" . wfMsg( 'ea-message' ) . ":</th>" ); |
117 | | - $wgOut->addHTML( "<td><textarea name=\"ea-header\" rows=\"3\" style=\"width:100%\">{$this->message}</textarea>" ); |
| 117 | + $wgOut->addHTML( "<td><textarea name=\"ea-message\" rows=\"3\" style=\"width:100%\">{$this->message}</textarea>" ); |
118 | 118 | $wgOut->addHTML( "<br /><i><small>(" . wfMsg( 'ea-message-info' ) . ")</small></i></td></tr>" ); |
119 | 119 | |
120 | 120 | # CSS |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | */ |
177 | 177 | function send( $send = true ) { |
178 | 178 | global $wgOut, $wgUser, $wgParser, $wgServer, $wgScript, $wgArticlePath, $wgScriptPath, $wgEmergencyContact, |
179 | | - $wgEmailPageCss, $wgEmailPageGroup, $wgEmailPageAllowRemoteAddr, $wgEmailPageAllowAllUsers; |
| 179 | + $wgEmailPageCss, $wgEmailPageGroup, $wgEmailPageAllowRemoteAddr, $wgEmailPageAllowAllUsers, $wgEmailPageSepPattern; |
180 | 180 | |
181 | 181 | # Set error and bail if user not in postmaster group, and request not from trusted address |
182 | 182 | if( $wgEmailPageGroup && !in_array( $wgEmailPageGroup, $wgUser->getGroups() ) |
— | — | @@ -196,8 +196,9 @@ |
197 | 197 | $db->freeResult( $res ); |
198 | 198 | } |
199 | 199 | |
200 | | - # Recipients from the "to" field |
201 | | - foreach( preg_split( "|[\\x00-\\x1f,;*]+|", $this->to ) as $item ) $this->addRecipient( $item ); |
| 200 | + # Recipients from the "to" and "cc" fields |
| 201 | + foreach( preg_split( $wgEmailPageSepPattern, $this->to ) as $item ) $this->addRecipient( $item ); |
| 202 | + foreach( preg_split( $wgEmailPageSepPattern, $this->cc ) as $item ) $this->addRecipient( $item ); |
202 | 203 | |
203 | 204 | # Compose the wikitext content of the page to send |
204 | 205 | $title = Title::newFromText( $this->title ); |
— | — | @@ -242,7 +243,7 @@ |
243 | 244 | $mail->Body = $message; |
244 | 245 | $mail->IsHTML( !$this->textonly ); |
245 | 246 | } |
246 | | - else $msg = wfMsg( 'ea-listrecipients', $count ); |
| 247 | + else $msg = "===" . wfMsg( 'ea-listrecipients', $count ) . "==="; |
247 | 248 | |
248 | 249 | # Loop through recipients sending or adding to list |
249 | 250 | foreach( $this->recipients as $recipient ) { |
Index: trunk/extensions/EmailPage/EmailPage.php |
— | — | @@ -13,15 +13,15 @@ |
14 | 14 | */ |
15 | 15 | if( !defined( 'MEDIAWIKI' ) ) die( "Not an entry point." ); |
16 | 16 | |
17 | | -define( 'EMAILPAGE_VERSION', "2.1.0, 2010-11-01" ); |
| 17 | +define( 'EMAILPAGE_VERSION', "2.1.1, 2010-11-01" ); |
18 | 18 | |
19 | | -$wgEmailPageGroup = "sysop"; # Users must belong to this group to send emails (empty string means anyone can send) |
20 | | -$wgEmailPageCss = false; # A minimal CSS page to embed in the email (eg. monobook/main.css without portlets, actions etc) |
21 | | -$wgEmailPageAllowRemoteAddr = array( "127.0.0.1" ); # Allow anonymous sending from these addresses |
22 | | -$wgEmailPageAllowAllUsers = false; # Whether to allow sending to all users (the "user" group) |
23 | | -$wgEmailPageToolboxLink = true; # Add a link to the sidebar toolbox? |
24 | | -$wgEmailPageActionLink = true; # Add a link to the actions links? |
25 | | - |
| 19 | +$wgEmailPageGroup = "sysop"; # Users must belong to this group to send emails (empty string means anyone can send) |
| 20 | +$wgEmailPageCss = false; # A minimal CSS page to embed in the email (eg. monobook/main.css without portlets, actions etc) |
| 21 | +$wgEmailPageAllowRemoteAddr = array( "127.0.0.1" ); # Allow anonymous sending from these addresses |
| 22 | +$wgEmailPageAllowAllUsers = false; # Whether to allow sending to all users (the "user" group) |
| 23 | +$wgEmailPageToolboxLink = true; # Add a link to the sidebar toolbox? |
| 24 | +$wgEmailPageActionLink = true; # Add a link to the actions links? |
| 25 | +$wgEmailPageSepPattern = "|[\\x00-\\x20,;*]+|"; # Regular expression for splitting emails |
26 | 26 | if( $wgEmailPageGroup ) $wgGroupPermissions['sysop'][$wgEmailPageGroup] = true; |
27 | 27 | |
28 | 28 | if( isset( $_SERVER['SERVER_ADDR'] ) ) $wgEmailPageAllowRemoteAddr[] = $_SERVER['SERVER_ADDR']; |