Add an info to the comment field of the newuserlog when an account was created "by...
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 29 Jan 2008 16:18:55 +0000 (16:18 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 29 Jan 2008 16:18:55 +0000 (16:18 +0000)
This was inspired by bug 12767 to identify such accounts.

docs/hooks.txt
includes/SpecialLog.php
includes/SpecialUserlogin.php

index acfc86d..b059299 100644 (file)
@@ -257,6 +257,7 @@ $message: out parameter: error message to display on abort
 
 'AddNewAccount': after a user account is created
 $user: the User object that was created. (Parameter added in 1.7)
+$byEmail: true when account was created "by email" (added in 1.12)
 
 'AjaxAddScript': Called in output page just before the initialisation
 of the javascript ajax engine. The hook is only called when ajax
@@ -659,6 +660,7 @@ $paramArray: Array of parameters that corresponds to logging.log_params field. N
     appears to contain anything.
 &$comment: string that corresponds to logging.log_comment database field, and which is displayed in the UI.
 &$revert: string that is displayed in the UI, similar to $comment.
+$time: timestamp of the log entry (added in 1.12) 
 
 'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes
 &$type: array of strings
index be8649b..1671e6d 100644 (file)
@@ -402,7 +402,7 @@ class LogViewer {
                                                array('target' => $paramArray[0], 'dest' => $title->getPrefixedText(), 'mergepoint' => $paramArray[1] ) 
                                        ) 
                                ) . ')';
-                       } elseif ( wfRunHooks( 'LogLine', array( $s->log_type, $s->log_action, $title, $paramArray, &$comment, &$revert ) ) ) {
+                       } elseif ( wfRunHooks( 'LogLine', array( $s->log_type, $s->log_action, $title, $paramArray, &$comment, &$revert, $s->log_timestamp ) ) ) {
                                // wfDebug( "Invoked LogLine hook for " $s->log_type . ", " . $s->log_action . "\n" );
                                // Do nothing. The implementation is handled by the hook modifiying the passed-by-ref parameters.
                        }
index 8ee0f36..02bb1fe 100644 (file)
@@ -125,7 +125,7 @@ class LoginForm {
                $u->saveSettings();
                $result = $this->mailPasswordInternal( $u, false, 'createaccount-title', 'createaccount-text' );
 
-               wfRunHooks( 'AddNewAccount', array( $u ) );
+               wfRunHooks( 'AddNewAccount', array( $u, true ) );
 
                $wgOut->setPageTitle( wfMsg( 'accmailtitle' ) );
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
@@ -856,3 +856,4 @@ class LoginForm {
        }
 }
 
+