Needs review
Project:
Abuse
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2007 at 19:08 UTC
Updated:
18 Dec 2008 at 06:50 UTC
Jump to comment: Most recent file
When you ban a user, the access_aid field is not incremented in the sequences table. Thereafter, you will not be able to add access rules to your site using the drupal access rule administration screen.
In two spots in abuse_ban_form_submit, there needs to be a call to db_next_id('{access}_aid'); prior to the two access table insert queries.
// ban this email address
$aid = db_next_id('{access}_aid');
db_query("INSERT INTO {access} (aid, mask, type, status) VALUES (%d, '%s', 'mail', 0)", $aid, $account->mail);
// block this user
db_query("UPDATE {users} SET status=0 WHERE uid=%d", $account->uid);
$aid = db_next_id('{access}_aid');
db_query("INSERT INTO {access} (aid, mask, type, status) VALUES (%d, '%s', 'user', 0)", $aid, $account->name);
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ban.patch | 1.22 KB | jenlampton |
Comments
Comment #1
jaydub commentedI am looking at my Drupal 5 install and the access table uses an auto_increment/serial column for (aid). The Drupal 5 version of the abuse module no longer attempts to set the (aid) in the INSERTs into {access}.
Comment #2
jenlamptonThe update made to the db when banning users BREAKS CORE user banning functionality.
It doesn't matter if the column in the {access} table is autoincrement, if the {sequences} table isn't updated to match, all user banning is still broken.
Please update right away:
Comment #3
kjl commentedResetting status from closed -> patch