This module is for providing an option to the users that the user will be remembered with his Login if he is logged-in from a IP range given by the Site Administers. Only the site administer have the permission to add IP Ranges for the user.

This module have dependency on Remember me Module.

If you enable Remember Me in IP Range Module you won't see Remember me check box in Login page or block.

This module supports various format for IP or IP ranges. Accepted IP Range format are:

  • Single IP matches like 123.123.123.123
  • Wildcards using an asterisk (*) in any quadrant except the first one, for example 123.123.123.* or 100.*.*.* etc.
  • Ranges using a hyphen (-) in any quadrant except the first one, for example 123.123.123.100-200 etc.
  • Any number of comma-separated IP addresses or ranges like 10.11.12.13, 123.123.123.100-200, 123.123.124-125.* etc.

Project Page: http://drupal.org/sandbox/behestee/1970404

Git:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/behestee/1970404.git remember_me_in_ip_range

CommentFileSizeAuthor
remember me in ip range.png26.6 KBbehestee
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxbehestee1970404git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

sreynen’s picture

Title: Remember Me in IP Range » [D7] Remember Me in IP Range
molenick’s picture

Hello, a few quick things I noticed:

1) Change the git link in your original post for non-maintainers. Cloning using the original link asks for your d.o user password.

2) Remove the master branch and add one compatible with Drupal's release conventions. Take a look at this document for additional information: https://drupal.org/node/1015226

3) Remove LICENSE.txt, it will be added automatically by Drupal's packaging system.

4) README.txt could use some additional information about use and configuration. It lists no dependencies which conflicts with the info file: remember_me.

chetan-singhal’s picture

Hi behestee

While taking git clone its asking for password. Please resolve this.

molenick’s picture

Hello sreynen,

lines 156-187
Consider replacing your implementation of remember_me_in_ip_range_get_client_ip() with the API call ip_address(). This will give you a client's IP address and account for reverse-proxying, which REMOTE_ADDR may not. Registered Globals are removed in PHP versions above 5.4.0, so it's better looking forward to not rely on them.

molenick’s picture

Ah, I forgot to link to the ip_address() documentation: http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/ip_addr...

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

behestee’s picture

Status: Closed (won't fix) » Needs review

Password seeking solved and added new branch. thanks ..

Enxebre’s picture

Hi,

I think in "function remember_me_in_ip_range_disable()" you could get the same result with a direct call to "db_update()" which would become in a higher performance. You are retrieving and going through absolutly all users of your database unnecessarily.

Regards.

thebruce’s picture

Hi,

There are a couple coding style issues, but not many.

There are a couple of places in the .module file where a new line would be appropriate for the control statement.

i.e.

// not this:
} else {
// but this:
}
else {

That's in lines 131,133,135,155.

A small update in comments on line 14:

    // initial value set to 0, if it is not updated the next time it is checked
    // it will remain 0 as it shouldn't be remembered.

I agree with Enxebre above that going through all the users in the uninstall might be a little much. I'd look towards entity field query on the user object to generate a list of uids that actually need to be changed:

Here is a good example, although there are many others online -
https://drupal.org/node/916776
One very good walk through from phase2:
http://www.phase2technology.com/blog/entityfieldquery-let-drupal-do-the-...

The data column, where your property gets referenced should be available to the user entity since it is in the base table. I would guess that you'd end up using propertyCondition in your efq to get the remember me value if you end up going this way.

I had a difficult time getting remember me to show up on my login form, though that was completely to do with remember_me and not your module. After some modification it worked and i was able to use, but I wouldn't trust my functional test, which went fine, as a final say.

Thanks for your work, Cheers!

kscheirer’s picture

Status: Needs review » Needs work
Master Branch
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
README.txt
Please take a moment to make your README.txt follow the guidelines for in-project documentation.
  • You have a number of style issues reported here: http://pareview.sh/pareview/httpgitdrupalorgsandboxbehestee1970404git, it would be good to clean those up.
  • I'm not sure why you remove user data in the disable hook. Usually it's expected that disable won't lose data, that should only happen on hook_uninstall().
  • In uninstall() instead of looping through all defined variables, can you explicitly delete those used by your module? Also, I don't think you need to remove the row from the system table manually, Drupal should take care of that for you.
  • Instead of setting the remember_me checkbox to hidden, I think you want to use '#type' => 'value' - it will still be included in the form submission.

This looks like a very useful module, otherwise would get an RTBC from me.

----
Top Shelf Modules - Crafted, Curated, Contributed.

behestee’s picture

Priority: Normal » Major
Status: Needs work » Needs review

Hi kscheirer

I have fixed all the styling issues. please see the link
http://pareview.sh/pareview/httpgitdrupalorgsandboxbehestee1970404git

Master branch has been removed

Updated README.txt as much as I thought necessary. Please let me if you have suggestion.

Removing user data in Disable hook was not much necessary. I had another plan. So now I have removed that.

Deleted all variables of this module explicitly. Removed the code deleting the row from system table. Left this for Drupal.

Remember me check box has been changed to value field.

Thanks for spending time for me to review this project. Please review once again.

behestee’s picture

Hi thebruce,
Your solution regarding entity field query seems good one. But I couldn't figure out how to do this query on user data. Please help me to do this if you have some time for me.

Thanks..

kscheirer’s picture

Priority: Major » Normal

It's only major if it's been 2 weeks and no review. See https://drupal.org/node/894256#anchor-workflow.

----
Top Shelf Modules - Crafted, Curated, Contributed.

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for those updates, looks ready to me.

----
Top Shelf Modules - Crafted, Curated, Contributed.

kscheirer’s picture

Issue summary: View changes

Updated git url

kscheirer’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

It's been a month without any problems reported, so I'm promoting this myself as per https://drupal.org/node/1125818.

Thanks for your contribution, behestee!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

----
Top Shelf Modules - Crafted, Curated, Contributed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.