• Resolved msamavi

    (@msamavi)


    Hello,

    I have been using your IP Login Plugin on my WordPress website to allow users to login either by username/password or by automatic IP recognition.

    When a user logs in, I would like to be able to identify whether they logged in by username/password or by automatic IP login. This would allow me to customize certain aspects of the user experience based on their login method.

    Could you please advise if the IP Login Plugin supports detecting the login method used? If so, could you provide a short code snippet demonstrating how I could check the login method upon user login and conditionally execute custom logic?

    For example, in pseudocode:

    if(user logged in via IP)
    {
    //show message about auto login
    }
    else
    {
    //they logged in via username/password
    }

    If the plugin does not natively support this, do you have any suggestions for how I could extend it or hook into it to identify the login method used? Any pointers would be greatly appreciated.

    Thank you very much for your time and assistance.

Viewing 1 replies (of 1 total)
  • Plugin Author brijeshk89

    (@brijeshk89)

    Hi,

    We have a function is_logged_in_using_ipbl which you can use to identify if the user is logged in using IP Based Login plugin or not.

    You can use it like this :

    if(is_user_logged_in()){
        if(is_logged_in_using_ipbl()){
            echo 'Logged in via IP Authentication';
        }else{
            echo 'Logged in using credentials';
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Identifying the login method used’ is closed to new replies.