Community Support Forums — WordPress® ( Users Helping Users ) — 2011-07-27T01:55:55-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14230 2011-07-27T01:55:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14230&p=29258#p29258 <![CDATA[Re: IP restriction question...]]>

I imagine it may at some point, no date at this moment, though. Still, this hack will remain after updates, so it's safe to use for now.

Statistics: Posted by Cristián Lávaque — July 27th, 2011, 1:55 am


]]>
2011-07-26T16:28:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14230&p=29209#p29209 <![CDATA[Re: IP restriction question...]]>
That worked perfectly.

Thank you so much for your help.

Do you know if this functionality will be added to a future release?

Thanks again!

Statistics: Posted by solraco — July 26th, 2011, 4:28 pm


]]>
2011-07-26T02:12:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14230&p=29135#p29135 <![CDATA[Re: IP restriction question...]]>
Here's a related thread viewtopic.php?f=4&t=2839#p9484

Take the hack Jason posted and edit it to work for you. Here's the line where that hook is in the IP Restrictions file. viewtopic.php?f=40&t=13016&src_doc_v=110710#src_doc_line_45

Based on the level of the current user, you could edit the number of IPs changing $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] in your hack.

/wp-content/mu-plugins/s2hacks.php
Code:
<?php
add_action 
('ws_plugin__s2member_before_ip_restrictions_ok', 'levels_max_ips');
function levels_max_ips($vars = array()) {
    if (is_object($user = new WP_User($username = $vars['restriction'])))
        if ($user->has_cap('s2member_level1'))
            $GLOBALS['WS_PLUGIN__']['s2member']['o']['max_ip_restriction'] = 2;
        if ($user->has_cap('s2member_level2'))
            $GLOBALS['WS_PLUGIN__']['s2member']['o']['max_ip_restriction'] = 10;
}
?>


Haven't tried it. Let me know if that helps. :)

Statistics: Posted by Cristián Lávaque — July 26th, 2011, 2:12 am


]]>
2011-07-25T12:02:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14230&p=29048#p29048 <![CDATA[IP restriction question...]]>
For example if I had a level 1 account restricted to 2 IPs and then had a level 2 account that was restricted to 10 IPs?

Is there any way to do this with s2member?

Thanks for the help in advanced.

Statistics: Posted by solraco — July 25th, 2011, 12:02 pm


]]>