&$text: string containing partially parsed text
&$this->mStripState: Parser's internal StripState object
-'LoginBadPass': a login attempt has failed with an invalid password.
- No return data is accepted; this hook is for auditing only.
+'LoginAuthenticateAudit': a login attempt for a valid user account either succeeded or failed.
+ No return data is accepted; this hook is for auditing only.
$user: the User object being authenticated against
$password: the password being submitted and found wanting
+$retval: a LoginForm class constant with authenticateUserData() return value (SUCCESS, WRONG_PASS, etc)
'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes
&$type: array of strings
if ( '' != $this->mNewpass && $wgAuth->allowPasswordChange() ) {
if ( $this->mNewpass != $this->mRetypePass ) {
+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'badretype' ) );
$this->mainPrefsForm( 'error', wfMsg( 'badretype' ) );
return;
}
if (!$wgUser->checkPassword( $this->mOldpass )) {
+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'wrongpassword' ) );
$this->mainPrefsForm( 'error', wfMsg( 'wrongpassword' ) );
return;
}
try {
$wgUser->setPassword( $this->mNewpass );
+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'success' ) );
$this->mNewpass = $this->mOldpass = $this->mRetypePass = '';
} catch( PasswordError $e ) {
+ wfRunHooks( "PrefsPasswordAudit", array( $wgUser, $this->mNewpass, 'error' ) );
$this->mainPrefsForm( 'error', $e->getMessage() );
return;
}
$wgUser->setCookies();
$wgUser->saveSettings();
}
+ if( $oldadr != $newadr ) {
+ wfRunHooks( "PrefsEmailAudit", array( $wgUser, $oldadr, $newadr ) );
+ }
}
if( $needRedirect && $error === false ) {
// reset form; bot interfaces etc will probably just
// fail cleanly here.
//
- return self::RESET_PASS;
+ $retval = self::RESET_PASS;
} else {
- wfRunHooks( 'LoginBadPass', array( $u, $this->mPassword ) );
- return '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS;
+ $retval = '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS;
}
} else {
$wgAuth->updateUser( $u );
$wgUser = $u;
- return self::SUCCESS;
+ $retval = self::SUCCESS;
}
+ wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, $retval ) );
+ return $retval;
}
function processLogin() {