Page 1 of 1

Question About IP

PostPosted: March 27th, 2011, 5:49 am
by Supertvplayer
I have s2Member pro plugin and I would like to restrict if logged users try to login with same account from different IP address. Giving 2 different IP access in month is not much useful for me because my clients are would like to access to their content from home, work and other locations.

Re: Question About IP

PostPosted: March 27th, 2011, 5:15 pm
by Cristián Lávaque
Hi! :)

You can find the unique IP restrictions configuration here WP Admin -> s2Member -> General Options -> Unique IP Access Restrictions.

Is that what you were looking for?

Re: Question About IP

PostPosted: April 11th, 2011, 9:45 am
by phenotype
Hello there.
I have a different problem, but I figured this was the only post about IP addresses, so I should stick it here.

Is there any plans in the future for having different IP access to different levels of membership.
In my case we are doing things for schools, whereby you have an individual user (a pupil say) and a silver member which might be a school. So all pupils in one school can login in as the same user.

Individual members I want to have limited IP usage. Silver members I want unlimited.

Just wondered if you guys had thought of this and it was on your radar, or there was an easy way to make this so.
Thanks in advance, Sam

Re: Question About IP

PostPosted: April 12th, 2011, 7:17 pm
by Jason Caldwell
Thanks for the great suggestion.
I'll see what we can do about this in the next release.

Until then, here is a hackety hack that should work for you.
Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_action 
("ws_plugin__s2member_before_ip_restrictions_ok", "my_function");
function my_function ($vars = array ())
    {
        if (is_object ($user = new WP_User ($username = $vars["restriction"]))) /* A Username restriction? */
            if ($user->has_cap ("s2member_level1")) /* OK. So now, are they at Membership Level #1 ? */
                $vars["__refs"]["restriction"] = false; /* Do NOT impose restrictions. */
    }
?>

Re: Question About IP

PostPosted: July 27th, 2011, 1:57 am
by Cristián Lávaque
Here's a variation of the above hack that lets you set different IPs depending on the level, in case someone finds it helpful: viewtopic.php?f=4&t=14230