isValidEmailAddr hook added to User method of that name, to allow, e.g., restricting...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 21 Oct 2007 17:15:37 +0000 (17:15 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 21 Oct 2007 17:15:37 +0000 (17:15 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/User.php

index 4473411..89b4acc 100644 (file)
@@ -39,6 +39,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   against the previous revision, whether currently deleted or live.
 * Added tooltips for the "Go" and "Search" buttons
 * (bug 11649) Show input form when Special:Whatlinkshere has no parameters
+* isValidEmailAddr hook added to User method of that name, to allow, e.g., re-
+  stricting e-mail addresses to a specific domain
 
 === Bug fixes in 1.12 ===
 
index a7b371e..0212dd0 100644 (file)
@@ -516,8 +516,14 @@ after noinclude/includeonly/onlyinclude and other processing.
 &$text: string containing partially parsed text
 &$this->mStripState: Parser's internal StripState object
 
+'isValidEmailAddr': Override the result of User::isValidEmailAddr(), for ins-
+tance to return false if the domain name doesn't match your organization
+$addr: The e-mail address entered by the user
+&$result: Set this and return false to override the internal checks
+$user: User the address is being validated for
+
 'isValidPassword': Override the result of User::isValidPassword()
-$password: Desired password
+$password: The password entered by the user
 &$result: Set this and return false to override the internal checks
 $user: User the password is being validated for
 
@@ -745,4 +751,4 @@ $article: article object watched
 
 
 More hooks might be available but undocumented, you can execute
-./maintenance/findhooks.php to find hidden one.
\ No newline at end of file
+./maintenance/findhooks.php to find hidden one.
index 71307f6..5f41c8c 100644 (file)
@@ -526,6 +526,11 @@ class User {
         * @return bool
         */
        public static function isValidEmailAddr( $addr ) {
+               $result = null;
+               if( !wfRunHooks( 'isValidEmailAddr', array( $addr, &$result, $this ) ) ) {
+                       return $result;
+               }
+
                return strpos( $addr, '@' ) !== false;
        }