|
We paid Ryan to write the plugin for us.
I suggest if you offer to hire him for a few hours he is likely to respond very quickly, and be much more committed to solving your problem.
So, how do you handle new sign ups?
If they need access by IP, then completely manually (ie: by email and the WP admin “Add new user” screen).
How do you manage it when all customers with IP based access are under one username (and presumably email address)?
We are only likely to have a few dozen customers in this category, but with thousands of potential users, all sharing the single username. The email address is meaningless for this ID.
As far as I can see, there is no way for WordPress to distinguish these users from one another, so this is probably not going to work if social interaction is part of your site. Even a single IP address might have half a dozen users sharing a wi-fi network.
Generally, each of our IP based clients has a librarian or similar who manages bulk access to publications, and this is the person we deal with.
If a customer is prepared to pay many hundreds of dollars per year, a bit of inconvenient manual administration is worth accepting, in my view.
|
|
you have one single user for all of your bulk ip access?
Yes, that’s correct.
And then you just add IPs or ranges as needed for different customers
The script at the top of this page will only handle single IPs. You need Ryan’s plugin to use ranges.
Or is there a way to add individual IDs to the ID list in the functions.php file?
You could use the theme file editor, but I wouldn’t recommend this. Better to edit functions.php locally with your normal text editor and upload via FTP, so you can quickly roll it back if a typo crashes the site.
|
|
I think you might need to lower your expectations somewhat Chris.
My client runs an academic journal; Universities, Government agencies and large corporates expect to be able to purchase a ‘site licence’, with unlimited access for their entire network.
Our single “collective” ID is potentially used by hundreds or even thousands of users. It uses our only s2member level the same as the other paid members.
We negotiate a fee for each organisation depending on how many users they might reasonably be expected to have, but there is no way I can see of actually limiting their use to numbers of seats or downloads, etc.
Adding this kind of access by IP is not automatic; in fact there isn’t even a nice admin screen to update the data.
I need to edit our function.php file every time we add a new member (or group) with access by IP.
If you (ie: anyone reading this) are not experienced with modifying the PHP in theme function files, this solution is probably not for you – crashing your site and locking yourself out of the admin is extremely easy if you make an error in this particular file.
I’m just an s2member customer like you.
I’m hoping that if enough people start asking for this feature, Jason (the lead developer of s2member) will get inspired to include it in the core, with a user friendly admin page.
Then, what I really want, is that Quick Cache can be updated to ignore our list of IPs so I can turn it back on.
|
|
I don’t think the plugin is available for download anywhere, so yes, you’ll have to email Ryan.
You would use Ryan’s plugin instead of the hack on this page.
The plugin allows for multiple:
- individual IPS
- ranges of IPs
- IPs with wildcards
|
|
The code above can only handle single IPs.
Ryan Imel (ryan@aspiringindie.com) made us a plugin which can handle both multiple ranges and wildcards.
|
|
Hi Chris
The array looks something like this when you have multiple IPs:
( '111.222.333.444', '222.333.444.555', '333.444.555.666')
All users logged in this way will end up with a single ID, which you specify in the plugin code on line 8.
You do need to create this ‘collective’ user and decide how much access they have to your site.
Everything you need to make this work for single IPs is in Bruce’s instructions above.
|
|
My client badly needs this functionality, so I will follow up your suggestion above of getting a free-lance developer to quote on this if you guys aren’t interested.
I’m thinking it would be so great to have a page in the s2member admin where allowed IPs, ranges of IPs and IPs with wildcards could be entered.
If they could be labeled by institution as well, to make updating simple, that would be fantastic.
And if Quick Cache could be then instructed to ignore those IPs all would be perfect.
|
|
My client might be prepared to contribute a small amount towards development costs.
If anyone else reading this needs this function, please lobby s2member to get it moved up the priority list.
I understand that both Joomla and Drupul have modules that allow auto-login by IP, but this not currently easy with WordPress.
|
|
Thanks for your quick response Bruce.
Your suggestion confirms that this particular customization is beyond my abilities.
If you guys offered this functionality as an add-on module or even a stand-alone plugin I’m sure many users would pay extra for it.
|
|
NB: this hack does not work if you have Quick Cache activated.
|
|
YES! It works now!
Thank you very much for your help Bruce.
It would be useful to others if you could update my original thread.
|
|
Correction – “corporate” user does, in fact, get access to protected posts, but NOT to restricted downloads.
My settings allow unlimited downloads for Level #2members.
|
|
OK Raam, I’ve found the problem – when I turn off the Quick Cache plugin I am automatically logged in as “corporate” (using the id in the script).
Unfortunately Quick Cache does not seem to have an option for configuring No-cache remote-address patterns.
But even if I proceed without a cache I’m no further ahead – even though “corporate” is a s2Member Level #2 there is still no access to protected content – I am referred to the “Membership Options” page when I try.
I also note there is no admin bar when logged in this way, and if I try to access wp-admin I am asked for a password.
The login page has a message:
“ERROR: The username field is empty.”
but actually the Username field has “corporate” pre-filled.
FYI this login also does not by-pass the Maintenance Mode plugin (not an issue for me).
Any further suggestions would be appreciated.
|
|
I just checked now, and yes, $_SERVER[‘REMOTE_ADDR’] also reports my IP address correctly.
|
|
Hi Raam
The complete line from the code that I tried at first was:
$id = 82; # The ID of the user you wish to log the visitor in as / Could also be User's Login
so you can see why I next tried the login: ‘corporate’.
The traffic tracking service verifies that my reported IP is correct.
|
|
I have a client who needs this feature as well.
He runs a legal journal, and has found that big firms, institutions and libraries expect automatic login based on IP address.
There is a plugin which claims to be able to do this, but the support forum for User Access Manager , which does not seem to be monitored by the plugin author, suggests that it only works with old versions of PHP and may also be broken in recent versions of WordPress.
Is it possible to incorporate this into s2member?
|
|
Thank you for this Jason. I actually figured out a similar solution on my own, and came back here to document it:
<?php if (current_user_can("access_s2member_level2")){ ?>
<script type="text/javascript">
var ws_plugin__s2member_skip_all_file_confirmations = true;
</script>
<?php } ?>
|
|
I’ve just spent a wasted hour trying to solve this myself! So it’s reassuring to find this.
Perhaps a line of advice added to the Registration/Profile Fields & Options edit box might be helpful?
|
|
Hi Raam
My s2-hacks.php file with the code above does not stop the pop-up.
However I have followed the advice in a post by Jason and this does indeed disable all JavaScript confirmations.
<script type="text/javascript">
var ws_plugin__s2member_skip_all_file_confirmations = true;
</script>
If anyone finds a way of stopping or altering this single, redundant message without loosing the entire file-counting feature, I’d be much appreciated.
|
|
I appreciate the assistance guys. I’ve now got this in the plug-in:
<?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
{
if($context === "s2member-front" && $original === "You`re entitled to UNLIMITED downloads though ( so, no worries ).")
$translation = "You`re entitled to UNLIMITED downloads.";
return $translation;
}
?>
But still no change :-(
|
|
Thanks for the suggestion.
I’ve uploaded a plugin here: /wp-content/mu-plugins/s2-contextual-translation.php
with this code:
<?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
{
if($context === "s2member-front" && $original === "( so, no worries )")
$translation = "";
return $translation;
}
?>
but the message is still there in the javascript prompt.
|
|
I’ve found and deleted the text from s2member.pot , but it still appears in the pop-up.
There is no cacheing installed yet.
|