Add 'EmailConfirmed' hook
authorRob Church <robchurch@users.mediawiki.org>
Tue, 2 May 2006 20:05:25 +0000 (20:05 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 2 May 2006 20:05:25 +0000 (20:05 +0000)
RELEASE-NOTES
includes/User.php

index c3e7077..ea9ae28 100644 (file)
@@ -187,6 +187,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 5789) Treat "loginreqpagetext" as wikitext
 * Sanitizer: now handles nested <li> in <ul> or <ol>
 * (bug 5796) We require MySQL >=4.0.14
+* Add 'EmailConfirmed' hook
 
 == Compatibility ==
 
index bd8b06c..8c89cc3 100644 (file)
@@ -288,7 +288,7 @@ class User {
                        (false !== strpos( $addr, '@' ) );
        }
 
-       /**
+       /**f
         * Count the number of edits of a user
         *
         * @param int $uid The user ID to check
@@ -1850,13 +1850,18 @@ class User {
        function isEmailConfirmed() {
                global $wgEmailAuthentication;
                $this->loadFromDatabase();
-               if( $this->isAnon() )
-                       return false;
-               if( !$this->isValidEmailAddr( $this->mEmail ) )
-                       return false;
-               if( $wgEmailAuthentication && !$this->getEmailAuthenticationTimestamp() )
-                       return false;
-               return true;
+               $confirmed = true;
+               if( wfRunHooks( 'EmailConfirmed', array( &$this, &$confirmed ) ) ) {
+                       if( $this->isAnon() )
+                               return false;
+                       if( !$this->isValidEmailAddr( $this->mEmail ) )
+                               return false;
+                       if( $wgEmailAuthentication && !$this->getEmailAuthenticationTimestamp() )
+                               return false;
+                       return true;
+               else {
+                       return $confirmed;
+               }
        }
 
        /**