https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106359

Revision: 106359
Author:   bsitu
Date:     2011-12-15 19:27:37 +0000 (Thu, 15 Dec 2011)
Log Message:
-----------
sends out email confirmation only if email and email authentication are enabled!

Modified Paths:
--------------
    trunk/extensions/MoodBar/ApiMoodBarSetUserEmail.php

Modified: trunk/extensions/MoodBar/ApiMoodBarSetUserEmail.php
===================================================================
--- trunk/extensions/MoodBar/ApiMoodBarSetUserEmail.php 2011-12-15 19:08:50 UTC 
(rev 106358)
+++ trunk/extensions/MoodBar/ApiMoodBarSetUserEmail.php 2011-12-15 19:27:37 UTC 
(rev 106359)
@@ -4,7 +4,7 @@
 class ApiMoodBarSetUserEmail extends ApiBase {
        
        public function execute() {
-               global $wgUser, $wgAuth;
+               global $wgUser, $wgAuth, $wgEnableEmail, $wgEmailAuthentication;
                
                if ( $wgUser->isAnon() ) {
                        $this->dieUsage( "You don't have permission to do 
that", 'permission-denied' );
@@ -45,7 +45,7 @@
                        
                        case 'resendverification':
                                //only sends the email if the email has not 
been verified
-                               if ( $wgUser->getEmail() && 
!$wgUser->isEmailConfirmed() ) {
+                               if ( $wgEnableEmail && $wgEmailAuthentication 
&& $wgUser->getEmail() && !$wgUser->isEmailConfirmed() ) {
                                        $status = 
$wgUser->sendConfirmationMail( 'set' );
                                        if ( !$status->isGood() ) {
                                                $error =  $status->getWikiText( 
'mailerror' );
@@ -69,7 +69,7 @@
        }
 
        /**
-        * Tempoarary solution, will use Preference::trySetUserEmail in 1.19
+        * Temporary solution, will use Preference::trySetUserEmail in 1.19
         */
        private static function trySetUserEmail( User $user, $newaddr ) {
                global $wgEnableEmail, $wgEmailAuthentication;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to