Hi,
I just installed and unistalled the module twice. When I go to the user edit page the ip boxes dont appear (only the none, single ip address and ip range checkboxes). Then when I submit i get a mysql error. After submission I then gett he ip range boxes, but it still give mysql errors after this? Let me know if you need more info?

thanks!

Comments

ymmatt’s picture

Assigned: ivo72 » ymmatt

After you install the module when you go to the edit user page the options will be: None, Single IP, IP Range

You must choose one of the 3 and then submit the page, you will be taken to a second page to enter the specific IP address/range, once this is done you click submit again and you are done.

If the above process doesn't work please post the following:

  • What are the steps required to reproduce the bug?
  • What behavior were you expecting?
  • What happened instead?
  • Any error messages that you are getting

Please include as much information as you can: OS, webserver name and version, PHP version, MySQL version, Drupal version, Drupal path, and everything else you might feel is relevant. There is no such thing as a bug report that is too detailed.

ivo72’s picture

I have uninstalled an reinstalled the module 3 times just incase that was the issue... but to no avail..

When submitting a single ip address from the user section and then being taken to the next screen where the ip boxes are show I get this error..

"warning: mysql_real_escape_string() expects parameter 1 to be string, array given in D:\Hosting\Anzses\site\includes\database.mysql.inc on line 400."

When trying to remove the ip address from the users edit section I get this error

"user warning: Unknown table 'restrict_by_ip' in where clause query: DELETE FROM _anzsesrestrict_by_ip WHERE

restrict_by_ip.uid = 816 in D:\Hosting\Anzses\site\includes\database.mysql.inc on line 172."

I am using drupal 5.3 on a windows IIS server with php version 4.40 and mysql version 4.1.12a

ymmatt’s picture

I know what the issue is and will have more time to work on it next week.

I believe that the .install file is not creating the tables correctly (with the db prefix) should be an easy fix.

ivo72’s picture

Thats great! Look forward to the solution.

ymmatt’s picture

After looking at this again referring to http://drupal.org/node/51220, I can't find anything wrong with the .install file (other than verifying that the tables were installed).

However, I believe that I have isolated the problem to line 240 in the .module file which reads:

        db_query("DELETE FROM {restrict_by_ip} WHERE restrict_by_ip.uid = %d", $account->uid);

It should read:

        db_query("DELETE FROM {restrict_by_ip} WHERE {restrict_by_ip}.uid = %d", $account->uid);

So that the prefix is added to the WHERE statement.

I won't be able to get to the cvs to submit the patch until later this week, but if you can edit your copy and let me know if it worked that would be great (I don't have any sites that use prefixes).

ymmatt’s picture

Status: Active » Fixed

Correct that, it was line 244.

This bug fix has been submitted to cvs and will be in the next release

ivo72’s picture

Thanks for ttaking the time to look into this.

Yes this saves the settings now.

Two issues I see. I get the ip range box when I edit user, and If I add in an ip it saves fine now :). But when I click IP range the second range box doesnt appear. It gives errors when I submit, but then on that page the second ip range box appears and I can add the range in and its fine.

Lastly, I made up an ip adress, expecting to get denied, but it let me login regardless? it seemd like drupal is bypassing the ip restriction? Any ideas on this one.

ymmatt’s picture

Both of these are separate issues. Just to have a clear issue cue could you submit two more support requests.

Make sure to include all steps to reproduce the issues.

With regards to the second issue, also post what user you are testing this with.

ivo72’s picture

In regards to the second issue once I log in as an authenticated user (no admin privelages) I get this url http://www.anzses.org/index.php?q=node/2&restricted

ane the user is logged and and can view member pages

but it doesnt deny me, no matter what random IP I put in?

Do you need any more info?

ivo72’s picture

In regards to first issue..

If i login as admin, go to search users, find the user with the ip address under the edit menu. If I click IP range, the second box doesnt appear for the range. If i click submi I get these errors

Illegal value for the Restricted range, quad number: 1 must match Restricted IP Address 1.
Fields do not match
Illegal value for the Restricted range, quad number: 2 must match Restricted IP Address 2.
Fields do not match
Illegal value for the Restricted range, quad number: 3 must match Restricted IP Address 3.
Fields do not match

this page (edit user) now shows the second box, you can now enter a second range and it saves fine. (it still doesnt restict the login)

Here are the additonal modules I use...

IMCE 5.x-1.0 Menu Subtree Permissions 5.x-0.x-dev
Node Privacy By Role 5.x-1.x-dev
Private Upload 5.x-1.0-beta6
Remove Nonviewable Menu Items 5.x-1.x-dev
Restrict By IP 5.x-1.0-beta4 T
inyMCE 5.x-1.x-dev The most popular WYSIWYG
User Import

ymmatt’s picture

Please post comments number 9 and 10 in separate issues for this module, they are not relevant to this original issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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