PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Question About IP

s2Member Plugin. A Membership plugin for WordPress®.

Question About IP

Postby Supertvplayer » March 27th, 2011, 5:49 am

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.
User avatar
Supertvplayer
Registered User
Registered User
 
Posts: 6
Joined: March 27, 2011

Re: Question About IP

Postby Cristián Lávaque » March 27th, 2011, 5:15 pm

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?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Question About IP

Postby phenotype » April 11th, 2011, 9:45 am

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
User avatar
phenotype
Registered User
Registered User
 
Posts: 1
Joined: March 28, 2011

Re: Question About IP

Postby Jason Caldwell » April 12th, 2011, 7:17 pm

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. */
    }
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Question About IP

Postby Cristián Lávaque » July 27th, 2011, 1:57 am

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
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 0 guests

cron