'UploadComplete': Upon completion of a file upload
$uploadForm: Upload form object. File can be accessed by $uploadForm->mLocalFile.
+'User::mailPasswordInternal': before creation and mailing of a user's new temporary password
+$user: the user who sent the message out
+$ip: IP of the user who sent the message out
+$u: the account whose new password will be set
+
'UserArrayFromResult': called when creating an UserArray object from a database result
&$userArray: set this to an object to override the default object returned
$res: database result used to create the object
*/
function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
global $wgCookiePath, $wgCookieDomain, $wgCookiePrefix, $wgCookieSecure;
- global $wgServer, $wgScript;
+ global $wgServer, $wgScript, $wgUser;
if ( '' == $u->getEmail() ) {
return new WikiError( wfMsg( 'noemail', $u->getName() ) );
}
-
- $np = $u->randomPassword();
- $u->setNewpassword( $np, $throttle );
- $u->saveSettings();
-
$ip = wfGetIP();
if( !$ip ) {
return new WikiError( wfMsg( 'badipaddress' ) );
}
- #if ( '' == $ip ) { $ip = '(Unknown)'; }
+
+ wfRunHooks( 'User::mailPasswordInternal', array(&$wgUser, &$ip, &$u) );
+
+ $np = $u->randomPassword();
+ $u->setNewpassword( $np, $throttle );
+ $u->saveSettings();
$m = wfMsg( $emailText, $ip, $u->getName(), $np, $wgServer . $wgScript );
$result = $u->sendMail( wfMsg( $emailTitle ), $m );