Support » Plugin: External Login » Possible bug in exlog_hook_filter_custom_should_exclude

  • Resolved Leif Harmsen

    (@leifharmsen)


    If I’m not doing something else very wrong, I think I found a serious bug in exlog_hook_filter_custom_should_exclude

    Using your handy example almost exactly:

    function myExlogCustomExcluder($userData) {
        return strtotime($userData['expiry']) < strtotime('now') ? 'Your membership has expired.' : false;
    }
    add_filter('exlog_hook_filter_custom_should_exclude', 'myExlogCustomExcluder', 10, 1);

    When I set my expiry field to a past date it works perfectly when I attempt to login using my username, reporting “Your membership has expired.” as it should. But when I login using my email address it lets me in anyway: BAD! Perhaps you never tested exlog_hook_filter_custom_should_exclude with email logins. It really is a thing!

    I checked my external database and my username and email are both unique and both are in the same record. When I set my expiry to a date in the future, both my username and my email let me in as they should.

    I’m hoping this is an easy bug to fix!

    Leif

    I would love for this to work so I don’t have to rely on my UGLY hack of creating a current_member boolean field in my external database that I update using the expiry field whenever there’s a possibility the expiry field has been changed, and as a cron job over the whole database once a day for good measure.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author tbenyon

    (@tbenyon)

    Hey @leifharmsen,

    Thanks for flagging. Just wanted to acknowledge the message and let you know I’m going to look at this tomorrow.

    Thanks,

    Tom ๐Ÿ™‚

    Plugin Author tbenyon

    (@tbenyon)

    Hey Leif,

    Thanks for the beer encouragement.

    Good news, I’ve found the source of the problem ๐Ÿ™‚

    Thanks for flagging this.

    I need to do some tidying up and preparation for the release but I’ll make sure it goes out today.

    Will let you know once the fix is released ๐Ÿ™‚

    Thanks again for sharing and for the beers ๐Ÿ™‚

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @leifharmsen,

    This is now deployed.

    Could you please test the new version and let me know if this has resolved your issue.

    Thanks,

    Tom ๐Ÿ™‚

    Plugin Author tbenyon

    (@tbenyon)

    I havenโ€™t heard back so Iโ€™m going to mark as resolved.

    If you have any more questions donโ€™t hesitate to get in contact.

    Thanks,

    Tom๐Ÿ˜Š

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.