Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Vanilla2 php events: Hook Gdn::Authenticator->Trigger

caerostriscaerostris ✭✭
edited February 2011 in Vanilla 2.0 - 2.8
Hey there!

I need to hook the function
Gdn::Authenticator()->Trigger(Gdn_Authenticator::AUTH_DENIED);

What i want to do:
If a user has been successfully authenticated (he logged in), vanilla2 executes this function:

Gdn::Authenticator()->Trigger(Gdn_Authenticator::AUTH_SUCCESS); $this->FireEvent('Authenticated');

And if he entered a wrong password or username this function is executed:
Gdn::Authenticator()->Trigger(Gdn_Authenticator::AUTH_DENIED);

I need my code to be executed when Gdn::Authenticator()->Trigger(Gdn_Authenticator::AUTH_DENIED); is executed. My code will check the users password and username via ldap, and if its OK, Gdn::Authenticator()->Trigger(Gdn_Authenticator::AUTH_SUCCESS); $this->FireEvent('Authenticated');
should be executed...

Is that possible without modefiying
library/core/authenticators/class.passwordauthenticator.php
?


Thanks, Caerostris

Comments

  • Options
    My frend has found a much better way inject my authentication code:

    I could just hook the function
    Authenticate($Username, $password)
    from library/core/authenticators/class.passwordauthenticator.php, but its seems like its not hookable by magic methodes and so on...

    Anyone has an idea how i could hook this function?
Sign In or Register to comment.