Make sure BlockHideName really defaults to 0, not false. Fixes bug 10007.
[lhc/web/wiklou.git] / includes / SpecialEmailuser.php
index 16270b1..900a2c3 100644 (file)
@@ -1,15 +1,14 @@
 <?php
 /**
  *
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @addtogroup SpecialPage
  */
 
-/**
- *
- */
 require_once('UserMailer.php');
 
+/**
+ * @todo document
+ */
 function wfSpecialEmailuser( $par ) {
        global $wgUser, $wgOut, $wgRequest, $wgEnableEmail, $wgEnableUserEmail;
 
@@ -51,7 +50,14 @@ function wfSpecialEmailuser( $par ) {
        if ( "success" == $action ) {
                $f->showSuccess( $nu );
        } else if ( "submit" == $action && $wgRequest->wasPosted() &&
-               $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
+                               $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) 
+       {
+               # Check against the rate limiter
+               if( $wgUser->pingLimiter( 'emailuser' ) ) {
+                       $wgOut->rateLimited();
+                       return;
+               }
+
                $f->doSubmit();
        } else {
                $f->showForm();
@@ -59,9 +65,8 @@ function wfSpecialEmailuser( $par ) {
 }
 
 /**
- * @todo document
- * @package MediaWiki
- * @subpackage SpecialPage
+ * Implements the Special:Emailuser web interface, and invokes userMailer for sending the email message.
+ * @addtogroup SpecialPage
  */
 class EmailUserForm {
 
@@ -123,7 +128,7 @@ class EmailUserForm {
 <span id='wpTextLabel'><label for=\"wpText\">{$emm}:</label><br /></span>
 <textarea name=\"wpText\" rows='20' cols='80' wrap='virtual' style=\"width: 100%;\">" . htmlspecialchars( $this->text ) .
 "</textarea>
-" . wfCheckLabel( $emc, 'wpCCMe', 'wpCCMe' ) . "<br />
+" . wfCheckLabel( $emc, 'wpCCMe', 'wpCCMe', $wgUser->getBoolOption( 'ccmeonemails' ) ) . "<br />
 <input type='submit' name=\"wpSend\" value=\"{$ems}\" />
 <input type='hidden' name='wpEditToken' value=\"$token\" />
 </form>\n" );