latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Access Issue

Home Forums Community Forum Access Issue

This topic contains 9 replies, has 5 voices. Last updated by  Raam Dev 4 years, 4 months ago.

Topic Author Topic
Posted: Wednesday Aug 22nd, 2012 at 4:34 am #22692

I have one member that is getting the following error trying to login:

503: Service Temporarily Unavailable
Too many IP addresses accessing one secure area!
Please contact Support if you need assistance.

Is that an error message that S2Member is generating? Does anyone know what would cause that error message for just one member while other members login just fine?

Thanks in advance.

Bruce,

  • This topic was modified 4 years, 4 months ago by  Eduan. Reason: Moved to the customer support forums

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Wednesday Aug 22nd, 2012 at 8:03 am #22722
Eduan
Username: Eduan
Moderator

Hello Bruce,

Please check under Dashboard -› s2Member® -› Restriction Options -› Unique IP Access Restrictions for more information on that blockage.

Hope this helps. :)

Posted: Friday Aug 31st, 2012 at 12:55 pm #23722
Adam
Username: b4thestreet

Is there a way to change the look of the ‘503: Service Temporarily Unavailable’ page…its not the prettiest. Perhaps a custom template or redirect?? Our membership site restricts unique IPs to 2 per user (home and office). This time of year people are traveling a lot and end up at the 503 page regularly.

I have identified the code that controls this message is located here at approx. line 53: wp-content/plugins/s2member/includes/classes/ip-restrictions.inc.php

$msg_503 = _x('<strong>503: Service Temporarily Unavailable</strong><br />Too many IP addresses accessing one secure area<em>!</em><br />Please contact Support if you need assistance.', "s2member-front", "s2member");

I am confident that I can simply change the html message to serve my purpose, but a redirect would be considerably better for my use. Then I can use a page with in my site template and include a contact form etc.

Any help would be appreciated. Thanks in advance!

  • This reply was modified 4 years, 4 months ago by  Adam.
Posted: Friday Aug 31st, 2012 at 5:00 pm #23742
Bruce
Username: Bruce
Staff Member

Hi Adam,

Try adding an action hook on ‘ws_plugin__s2member_during_ip_restrictions_ok_no’. You can do this within an s2hacks.php file within wp-content/mu-plugins/ (make it if you don’t already have it).

Like this:

<?php
add_action('ws_plugin__s2member_during_ip_restrictions_ok_no', 's2hack_exit_503_func');

function s2hack_exit_503_func($vars)
{
	$m_503="This is the body of the 503 page."; # This should be changed
	
	unset($__refs, $__v); # s2Member does this within /includes/classes/ip-restrictions.inc.php above it's exit(), so you should too.
	exit($m_503); # This could also be changed to a PHP redirect using header();
}
?>

Check this out for info regarding actions and filters with s2Member.

Posted: Saturday Sep 1st, 2012 at 3:12 am #23761

Thanks for the information.

I have a member whose ISP uses dynamic IP addresses. How do we get around this?

Are there other means of watching for members who “share” their login credentials?

Bruce,

Posted: Saturday Sep 1st, 2012 at 9:25 pm #23809
Bruce
Username: Bruce
Staff Member

Hi Bruce,

I have a member whose ISP uses dynamic IP addresses. How do we get around this?

Dynamic IPs are always bothersome when you’re dealing with IP restrictions. It really comes down to a choice: support dynamic IPs and leave your site vulnerable to account sharing, or just support Static IPs (which is what most people are doing) and force users to either have a static IP, or use a proxy server. Most site owners opt for the latter as it protects their site without bothering the most users, and users that do have this problem usually know why, as they most likely have had issues with other sites as well.

It could be possible to do some tricks with PHP Cookies mixed with IPs, but it could still be very unreliable, which is why s2Member does not support it.

Posted: Monday Sep 3rd, 2012 at 11:09 pm #23981
Adam
Username: b4thestreet

Bruce (Support Rep),

Thanks for the quick reply! It is greatly appreciated.

I reviewed the documentation you suggested on Hacking s2Member® Via Hooks/Filters…and I have come to realize I am in over my head :( (lol)

Is there a way to just redirect the 503 warning to the following URL/WP Page?: http://b4thestreet.com/en/ip-restrictions/

Again, I appreciate any help you can offer.

Regards,

Adam

Posted: Tuesday Sep 4th, 2012 at 12:29 am #23999
Raam Dev
Username: Raam
Staff Member

This should redirect 503’s to that page:

<?php
add_action('ws_plugin__s2member_during_ip_restrictions_ok_no', 's2hack_exit_503_func');

function s2hack_exit_503_func($vars)
{
	unset($__refs, $__v); # s2Member does this within /includes/classes/ip-restrictions.inc.php above it's exit(), so you should too.
	header("Location: http://b4thestreet.com/en/ip-restrictions/");
}
?>

You’ll add that to wp-content/mu-plugins/s2hacks.php (create the file and directory if they don’t already exist).

Posted: Tuesday Sep 4th, 2012 at 10:37 am #24033
Adam
Username: b4thestreet

Raam (Support Rep),

Worked like a charm!! Wow A++

Thanks. You made it very simple for me to understand and do. I appreciate the help. This one feature will save me HOURS of tech support time and will be greatly appreciated by our members. Cheers.

Posted: Tuesday Sep 4th, 2012 at 9:09 pm #24099
Raam Dev
Username: Raam
Staff Member

Glad to help, Adam! :)

Viewing 9 replies - 1 through 9 (of 9 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.