Recent Topics

1 Aug 16, 2008 21:19    

My b2evolution Version: 2.x

Hi,

I want to trigger something when user's password is wrongly entered.

Under event handler LoginAttempt (plugin) there is a param which is:
'pass_ok': is the password ok for 'login'? (by reference) (since 1.10.0)

but I cant seem to test for it.

I tried combinations of:
if ( $params['pass_ok'] == 1 )
if ( $params['pass_ok'] == true )
if ( $params['pass_ok'] == 0 )

they all cant distinguish between whether the user's password was correct or not.

But it seems to work with:
if ( user_pass_ok( $params['login'], $params['pass_md5'], true ) == 0 )

I dont want to call user_pass_ok function if it is already in the data structure pass_ok.

Have I mistaken the use of this pass_ok?

Thanks.

2 Aug 16, 2008 21:42

Actually - that line
if ( user_pass_ok( $params['login'], $params['pass_md5'], true ) == 0 ) { do this } else { do that }

didnt work also

Nor did this:
if ( user_pass_ok( $params['login'], $params['pass_md5'], true ) ) { do this } else { do that }

Now I am really confused

3 Aug 17, 2008 00:20

Finally I get whats happening - I need LoginAttemptNeedsRawPassword() to get the clear text password otherwise I only get the hashed password back from the broswer.

I think there needs to be another hook ( AfterUserValidation ? ) so I can know if the user has successfully logged in or not.


Form is loading...