Closed (fixed)
Project:
IP Login
Version:
5.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Dec 2008 at 15:14 UTC
Updated:
21 Sep 2013 at 16:14 UTC
Jump to comment: Most recent file
Comments
Comment #1
okmi commentedi would just like to second this. we could use this module if we could assign multiple ips and complex ranges to each user. :)
Comment #2
davidwhthomas commentedYes, it's an interesting idea, I'll look into it.
DT
Comment #3
okmi commentedwhat we really need is for our member institutions to be recognized from their IP ranges, and then have a separate user login give them the ability to edit and change their ranges. I think the IPAuthenticator module is closer to this, but I'm not sure (?)
Comment #4
sgriffin commentedGiving someone ability to edit their own ranges, is a little nuts. They could easily open your whole site to unauthorized access. I don't think this is a feature any group of people will want, so you'd need to program the forms yourself.
Comment #5
davidwhthomas commentedIf the profile field containing the IP address has a certain visibility set, it will be editable by that user i.e they can update their own IP address. That _might_ be suitable in certain situations.
Of course, IP Login does support IP address ranges of the form 123.123.123.*
More complex ranges ( regular expressions ? ) may be available in the next version.
DT
Comment #6
tscyberia commentedStrangely, IP range does not work for me. The following is what I did:
1) Install IP Login
2) Create a profile
3) Enable IP Login
4) Choose the IP Login profile
5) Assign an IP range to a user
Am I missing anything?
I'm desperately in need of support for multiple IP addresses/ranges. Until this module supports this, is there any other way?
Comment #7
davidwhthomas commented@tscyberia
IP ranges are currently supported in the form of adding an asterisk to the end of the address
e.g: 123.123.123.*
more complex ranges may be implemented in the future.
DT
Comment #8
tscyberia commentedThank you, DT.
Actually, before posting my inquiry I did exactly as you explained, but no IP range was recognized. That's why I asked you whether I was missing anything. What reasons can there be for this problem I've encountered?
Another question: a wild card can be used not only in the fourth block but also in others, e.g., 123.123.*.*, or partially, e.g., 123.123.123.12*?
Comment #9
tscyberia commentedI've solved the issue of multiple IP addresses temporarily by simply making a separate user for each of them. But unfortunately, I haven't solved the problem of an IP range. I use only basic ones like 123.123.123.*, but even they don't always seem to be recognized. I use IP Login for IP authentication for institutional subscribers to an online journal. Some institutions have told me that they are authorized automatically to access the site, but others have not been recognized by their IPs. I haven't been able to find any difference between the two groups. Is there anyone who had this problem with IP Login (and solved it)? DT, any suggestion?
Comment #10
davidwhthomas commentedIt may be the case the those users who are not authenticated have an invalid / different IP address from that stored in their profile field.
They will need to supply their public IP address which can be found be visiting sites such as
http://whatismyip.com
Regarding IP address ranges, if anyone wants to submit a patch on that, it would be welcomed.
Also, regarding multiple IPs per user, it would be reasonably simple to create multiple profile fields for the IPs, or perhaps store a comma separated string in one, and check for that. The admin settings could have a multi-select for the profile fields or the code could extract a comma separated list and loop through those instead. I will consider that for a next version though patches are always welcome.
DT
Comment #11
tscyberia commentedThank you, DT.
Actually, what I wrote in my previous comment wasn't exact. Something like 123.123.123.* does always work, but the problem is with something like 123.123.*.*. It's not recognized. I've tried 123.123.* instead of 123.123.*.*, but in vain. Any workaround?
Comment #12
davidwhthomas commentedno workaround as such as only 123.123.123.* type address ranges are supported, as stated earlier.
to add further complexity there, you'd need to modify the module, particularly the
ip_login_get_range($ip){}function, to return the range, or perhaps an array of ranges to check for.
DT
Comment #13
tscyberia commentedThank you, DT.
Unfortunately, the solution you kindly suggested is beyon my limited knowledge of Drupal.
In the meanwhile I've realized a serious security problem. Anyone who is inside an institution that subscribes to our journal and is authorized to access it can actually change the registered email and password. Finding a way to prevent this is also beyond me. After all, I'm just a university lecturer in the humanities, and am volunteering for one of the academic societies I belong to for its new online journal.
If you think you can solve these two problems, our society is ready to pay for you. It seems difficult to find someone else who is more qualified than you. If you think you can, please let me know where I can find your online contact form so that neither of us may have to put our email addresses here.
Comment #14
davidwhthomas commented@tscyberia
My contact form is available through my user profile
http://drupal.org/user/151344/contact
What you have specified is a particular use case that isn't currently accounted for by IP Login, however, it wouldn't be too difficult to implement.
Perhaps we can work something out, on the condition any further development of the module can be committed back to the GPL project here.
regards,
DT
Comment #15
tscyberia commentedDT, thank you for your readiness. Yesterday I sent you a message through the contact form you mentioned, but I haven't heard from you. So I'm not sure if it has reached you. Please acknowledge receipt by private mail (my email address must be in that message). If you haven't received it, I'll retry.
Comment #16
ymmatt commentedOk, so I did an ugly patch to get this to work for the 123.456.*.* range.
This first set of code IS NOT what I did, but we really should be checking by every quadrant like this:
So I added a new function at the bottom of ip_login.module:
and modified the ip_login_login function so that the first 13 lines of that function look like this (i really only added one line, and changed the dbquery) :
Comment #17
ymmatt commentedOk, so it isn't the prettiest work I've ever done, but from what I can tell it is functional with ranges of the type:
123.456.789.*
123.456.*.*
123.456.1.* - 123.456.7.*
If you want to specify a range like the latter, you have to create a second profile field which doesn't have to be used for all users.
I had to rework most of the module, what I did is attached.
Comment #18
ymmatt commentedJust realized that I left the main function call outside of an if statement, corrected in new attachment
Comment #19
tripper54 commentedHi there,
I'm trying to port this solution to D6, but it doesn't seem to be working.
I'm getting the following error:
Attached is my code - basically all I've changed from the .module file above is the hook_menu call, and I've replaced the db_num_rows in function ip_login_admin_settings with
Does anyone have any ideas what I've missed here? I'm not experienced with this stuff at all, just finding my way around in the dark, so to speak.
Thanks.
Also not sure if I should change the "version" stuff above.
Comment #20
tripper54 commentedHello again,
I have solved the error above by running the following SQL on the database:
Problem is, I'm still not being logged in as I should be.
Anyone have any ideas?
thanks,
Comment #21
tripper54 commentedOK, I figured it out. I'm not sure if it's my version of mysql or a drupal 5/6 issue, but my system did not like the SQL that used MATCH AGAINST.
I changed that db query to use LIKE:
and everything seems to work fine now.
I also changed the hook_init call to hook_boot.
Comment #22
jim kirkpatrick commentedPlease see #791410: Improved: now supports logging in as alternate user plus comma separated values, IP ranges and wildcards for an improved D6 version supporting values like "10.11.12.13, 123.123.123.100-200, 123.123.124.*"
Comment #23
jim kirkpatrick commentedComment #24
frenchnewbie commentedHey Guys,
I've been looking for a way to add ranges to this plugin for drupal 5. From what I can, the only ones posted here are for D6. Could anyone help me figure out how to do it ?
Thanks a lot.
Comment #25
frenchnewbie commentedOk, I figured some things out, and got it to work on D5.
there remain a few problems, one of them being a message being displayed 2 or 3 times...
can't figure out why.
Anyway, in the spirit of sharing, I've attached my latest foundings :)