• Resolved Retrofitter

    (@retrofitter)


    Hi

    When setting up the plugin to log in as a user with role as subscriber, it creates problems for any other user, that has a real login credentials.

    Eg. a user with administrator role can no longer login with username and password and therefore cannot access the sites administration interface (wp-admin)

    Any solution to that problem.

    Best regards
    Steffen Bang Nielsen

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author brijeshk89

    (@brijeshk89)

    Hi Steffen,

    When you are auto logged in via IP Based Login there is a “Logged in with IP Based Login” link in the top admin bar. Hover on that link and it will show 3 options “Disable Auuto Login” for 5 mins, 15 mins or 1 hour. Use the option you need and it will not auto login you and you can then use your real login credentials to login as admin.

    Let us know if you face any issues.

    Thread Starter Retrofitter

    (@retrofitter)

    Hi again

    Thanks for the answer. Unfortunately it is not helpful in the specific situation. The users will auto-logged-in via IP with role subscriber and will not see the admin bar, so that link will not be visible to the users.

    Can the link be placed in the footer instead. If it is available via a php function that would work for us.

    Another question – if a user ’disable auto login’ will that only work for the specified amount? And will the user be auto logged in again, when 5 mins, 15 mins or 1 hour has passed?

    it would be more useful in this specific situation if the admin user could completely disable auto login – basically do not auto login if wordpress_logged_in_[hash] cookie has already been set.

    Another solution could be IP Based Login could be disabled for /wp-admin/ and wp-login.php – maybe using is_admin()

    Best regards
    Steffen

    Plugin Author brijeshk89

    (@brijeshk89)

    Hi,

    >> Can the link be placed in the footer instead. If it is available via a php function that would work for us.

    You can create the link yourdomain.com/?no_login=5
    Here 5 is the number of minutes to disable login for. We have option for 1 minute, 15 mins, 30 mins and 1 hour. But you can pass any value (in minutes). You can add this link in footer.

    However this uses browser cookie to disable login so if you access from another browser you will need to disable login again.

    >> it would be more useful in this specific situation if the admin user could completely disable auto login – basically do not auto login if wordpress_logged_in_[hash] cookie has already been set.

    If the user is already logged in IP Based Login will not log that user in. It will simply skip.

    >> Another solution could be IP Based Login could be disabled for /wp-admin/ and wp-login.php – maybe using is_admin()`

    I can make a filter for you and you can hook into that filter using “add_filter” and write your logic as you wish to enable/disable login. Let me know if this works for you and I will add it.

    Thread Starter Retrofitter

    (@retrofitter)

    Hi again

    Thanks a lot for answering so promptly.

    You can create the link yourdomain.com/?no_login=5

    If the user is already logged in IP Based Login will not log that user in. It will simply skip.

    That’s great. We will test and it will probably mostly solve the issue.

    I can make a filter for you and you can hook into that filter using “add_filter” and write your logic as you wish to enable/disable login. Let me know if this works for you and I will add it.

    That would be an even better solution.

    If we could check for is_admin() and the new is_login() function and return false or something, it would be really great.

    Best regards
    Steffen

    Plugin Author brijeshk89

    (@brijeshk89)

    Hi Steffen,

    We have just released v2.2.9 which includes the hook point “ipbl_can_auto_login” which is called just before logging in the user. Using this hook you can decide to proceed with auto login or not. Return false to disallow auto login, return true to allow auto login. Note : This hook is executed after the IP check with the allowed IPs in database so if the accessing IP is not in the allowed list this hook will not be called.

    Example usage :

    add_filter('ipbl_can_auto_login', 'ipbl_can_auto_login', 1, 1);
    
    function ipbl_can_auto_login($status){
    	return true;
    }
    • This reply was modified 2 years, 5 months ago by brijeshk89.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Administrators cannot access admin-pages’ is closed to new replies.