Made addNewUserLogEntry() return the ID of the new log entry to be more useful
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 30 Sep 2011 17:31:36 +0000 (17:31 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 30 Sep 2011 17:31:36 +0000 (17:31 +0000)
includes/User.php

index b961285..ef724c4 100644 (file)
@@ -3913,7 +3913,7 @@ class User {
         * @param $byEmail Boolean: account made by email?
         * @param $reason String: user supplied reason
         *
-        * @return true
+        * @return int|bool True if not $wgNewUserLog; otherwise ID of log item or 0 on failure
         */
        public function addNewUserLogEntry( $byEmail = false, $reason = '' ) {
                global $wgUser, $wgContLang, $wgNewUserLog;
@@ -3935,13 +3935,12 @@ class User {
                        }
                }
                $log = new LogPage( 'newusers' );
-               $log->addEntry(
+               return (int)$log->addEntry(
                        $action,
                        $this->getUserPage(),
                        $reason,
                        array( $this->getId() )
                );
-               return true;
        }
 
        /**