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.

About: chris mitchell

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing topic 1 (of 1 total)
Topic Count Last Reply
Automatic Login Based on IP 1 2

By:  Bruce in: Unofficial Extensions/Hacks

voices: 4
replies: 26

3 years, 3 months ago  chris mitchell

Viewing topic 1 (of 1 total)

My Latest Replies (From Various Topics)

Viewing 18 replies - 1 through 18 (of 18 total)
Author Replies
Author Replies
Posted: Thursday Sep 26th, 2013 at 4:43 pm #59929

Hi Nigel, you can email me at chris@mitchellmarketing.com to continue the discussion. If you want, include your skype name in the email and we can talk about it directly.

Posted: Monday Jul 8th, 2013 at 10:04 am #53119

Hi John (and any others who might be interested),

I went ahead and had a plugin created for this. Now, each user can have his own account with associated IP addresses or ranges of IP addresses. It’s still slightly manual in that you have to create a list of users who have IP based access and enter their IP addresses or ranges of addresses in fields. But this is done in the WordPress backend, rather than editing a php file. It’s dead simple to use and seems to work quite well.

The big benefit is that each institution now has it’s own account and email address and gets access or not based on S2Member protections. Makes it easy for us to contact them, do marketing, etc.

If you are interested in a copy, let me know. I’m willing to sell you a copy to help me recoup my investment in getting the plugin created. $50.

Chris

Posted: Wednesday May 29th, 2013 at 2:26 pm #50864

@John, I found this script. http://blog.stefan-macke.com/wp-content/uploads/2006/11/wp-useriplogin.phps
I think if used with a custom IP address field stored during user registration, it might be along the lines of what we need to auto login users. It’s an old post, but could possibly be updated. Just an FYI.

Posted: Wednesday May 29th, 2013 at 7:29 am #50809

John,

Good points, all. I think we are using this system almost identically. My customer is a librarian too, who is managing access for other users.

I agree, a bit of manual work may be acceptable in this case.

I’m surprised that the S2Member team hasn’t made this sort of thing a core functionality. It seems like it would be a fairly common request.

I guess what I would like to be able to do is have this little plugin somehow hook into the user authentication part of S2Member. That way if there is an associated IP or range of IPs (and perhaps a setting “Login Automatically”, it will do the auto login. Otherwise, just require the user to do a normal login. Conceptually, it seems pretty simple. But maybe I’m kidding myself.

Communication between users is unimportant. But it would be nice to have each IP access account separate for contact purposes, etc.

One other thing. Does the plugin above in any way detect whether the customer is currently a paid subscriber? I.e. if you set your IP address access user to Level0, would they still have access to your paid content? Or does the plugin just circumvent that altogether? I can’t tell from the code.

Posted: Tuesday May 28th, 2013 at 10:30 pm #50778

Hi John,

I really appreciate the time you’ve taken to try to help me out with this. As mentioned above, I have a customer who is willing to pay for 30 seats to my app. That’s about a $1,000 sale. So I am quite motivated to find solutions to this question. In return for your help, I’ll be sure to share with you whatever I work out. Still waiting for further news from Ryan with the plugin.

Regardless of how that (Ryan’s plugin) turns out, I think it should be a fairly simple to task to get a PHP developer to build out the script above in a little more detail so that it processes each user account either as a standard access account – i.e. an account without any specific IP addresses associated, or as an IP-based access account. I have upgraded my registration form to capture the range of IP addresses that the customer wishes to use to access my app. So it seems like it should be possible to hook it all together.

So, how do you handle new sign ups? Seemingly each new subscriber to your site would get a unique username. How do you manage it when all customers with IP based access are under one username (and presumably email address)?

Regards,
Chris

Posted: Tuesday May 28th, 2013 at 2:04 pm #50759

Got it working. I think I’m almost where I need to be. So John, in your entry above, you have one single user for all of your bulk ip access? And then you just add IPs or ranges as needed for different customers with different IPs? Or is there a way to add individual IDs to the ID list in the functions.php file?

Posted: Tuesday May 28th, 2013 at 11:16 am #50749

Update…. Although automatic IP-based login did seem to work when I hard-coded my own IP, it also seems to have broken my admin panel. Couldn’t search for users etc. I don’t have quick cache activated. But I am using a number of other plugins on the site. Full stop at this point. :-(

Any suggestions?

Posted: Tuesday May 28th, 2013 at 9:41 am #50744

Wow! Got it to work. Just created a single .php file with name and content as described by Bruce above. I did add the standard plugin header code as described in the WordPress Plugins Codex: https://codex.wordpress.org/Writing_a_Plugin. Then entered user my user ID and my IP address. Worked perfectly.

Still wonder if this will conflict with Unique IP restrictions setup for my site, if under a given IP address there is a network with many computers. Any experience with that, Bruce or John?

Chris

Posted: Tuesday May 28th, 2013 at 9:14 am #50743

@Bruce, can you confirm?
1. Is the content of the plugin file (s2hack_auto_ip_login.php) simply, “$ips = array(‘127.0.0.1’); # This array should be filled with possible IPs the visitors could be using” ?

Posted: Friday May 24th, 2013 at 5:10 pm #50567

PS If I can get clear on all the steps, I’d be glad to volunteer to write a KB article that ties it all together in a step by step fashion. I’m sure you guys are very busy.

Posted: Friday May 24th, 2013 at 1:58 pm #50563

John, after hours or searching various support forums on this site, I’m starting to piece this together. But still need some help getting all the pieces to work. As far as I can see, these are the steps to implementing group access from a block of IPs and charging a central user for multi-seat access to a site…

1. I think I can accomplish the financial aspect of multi-seat / multi-license access based on a range of IP addresses, i.e. charging a recurring membership for say, 20 seats, by either creating more membership levels or by creating custom capabilities. For scalability, I would probably create several multi-seat membership options: 10 seats, 20 seats, etc. and set a unique recurring subscription fee for each. According to my research on this site, this would be better accomplished with custom capabilities than with increasing the number of membership levels. But the documentation on custom capabilities is vague. I don’t see specific instructions anywhere on how to create additional membership types with custom capabilities and then implement them on page restriction and on the order form. The documentation and videos are too brief to provide a complete picture.

2. I think I can bypass the 5 Unique IPs / user / month restriction based on userID using the code snippet from this post by your support rep, Bruce: http://www.s2member.com/forums/topic/ip-restrictions/ However, again, I don’t see how to implement this script. I don’t know where to put this file or how to make sure it’s implemented into the system. Can you provide specifics please? The post is closed to new replies so I can’t ask Bruce about it.

3. I would then create the MU Plugin you mentioned above. But I am unclear on the following: Should I add your function code to my functions.php file? Or should I put this somewhere else? And, is the single line of code that you mentioned above to create the array of IP addresses the only line of code that needs to be in the .php file? Or is there other php code that needs to be in there.

I apologize for all the questions, but if these posts were worth answering in part, I am hopeful that answering them in full detail so non-programmers could make them work would be worthwhile as well. Also, this might prevent some questions in the future as it would be clearly laid out, once and for all.

Thanks again, Chris

Posted: Friday May 24th, 2013 at 12:45 pm #50560

Hi John,

Another challenge that occurred to me…. if I have my Unique IP Address restrictions set to limit access for each user to only 5 IP addresses per user per month, and I set up a new user with a block of IP addresses for bulk access per the hack above, is there going to be a conflict? Or will the hard-coding somehow override the Unique IP restrictions I’ve set?

Chris

Posted: Friday May 24th, 2013 at 11:09 am #50558

Hi John, I’ve heard back from Ryan and he is making sure his plugin is up to snuff and then, I believe, he is going to send me a copy. So thanks again for that.

All of this has been for a client who wants to purchase multiple seats and get auto login based on IP address. So I am about to take a swing at this.

In the interest of speed, can you recommend the best way to handle selling multiple seats to one user? Under the scenario above, I would create just one user ID. But there will be 20 seats. Should I create a new membership level to handle this? Or is there a way to set up S2 so that a user can enter a number of licenses at checkout? We think we may begin having a number of institutional users who will need a multi-seat setup.

Any pointers greatly appreciated!

Posted: Wednesday May 22nd, 2013 at 7:54 am #50363

Great! I’ll try to reach Ryan by email. Thanks again for all your help.

Posted: Tuesday May 21st, 2013 at 3:58 pm #50305

Thanks John. Do i need to email ryan directly to get that plugin, or is it available elsewhere? Does it do everything that the hack above does, or does it just allow for the IP ranges.

Thanks again, Chris

Posted: Tuesday May 21st, 2013 at 7:56 am #50285

Ok. Thank you! One more…. Can the IPs be a range, instead of an array of IPs? Further can it be multiple ranges? I have a client who is determining how many IPs they will need access from. but these could be several blocks of ips.

Thanks for you help!

Posted: Monday May 20th, 2013 at 11:21 am #50226

PS I am, in fact a paying customer of your plugin. I don’t know why I am showing as a free user. My website which uses your paid plugin is ifastfacts.com. Can you also help me get this fixed?

Posted: Monday May 20th, 2013 at 11:20 am #50225

Could you provide a little more specifics on how this is implemented?
1. What does the function look like when there are multiple IPs and multiple User IDs and User Passes?
2. If I had five users in one location, would I need an IP for each of them, plus a user ID and login for each? I.e. do I need to create a user for each of the 5 users?

A more detailed explanation of setup would be very greatly appreciated!

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

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.