Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-8474 now.

banning an already banned user does nothing (fix completed in vcs)

Example:
A user is on your banlist for 7 days. During that time you find out that he tried to circumvent the ban with a second account and you want to extend the ban to an 1 month ban. You go into the MCP/ACP -> manage bans, type in the username/ip/email, select the ban length and click submit. You get a confirmation saying "The banlist has been updated successfully." although nothing was changed at all.

The reason for this behaviour ist that in lines 985-1022 of functions_user.php, duplicate entries are silently discarded.


I can think of two possible solutions, depending on which behaviour you think is better:

Solution 1: replace existing entries
This solution assumes that the most recently set ban lengths are "master", no matter whether they last longer or shorter than the already existing ones (as with edits in the acp). So instead of discarding the new entries, the old ones are discarded.

I've attached a patch for this solution.


Solution 2: inform the user
This solution assumes that in case of a conflict the user should decide whether he wants the old or new version (as in the autoupdater or beaten-to-posting). This requires that the user_ban function can (using a new byref parameter?) return the discarded entries to the calling mcp/acp plugin, which in turn displays a message like "The banlist has been updated successfully. Warning: The following users/ip/emails are already banned and have not been replaced: ... You need to remove the existing bans, before you can ban them again".

Since this is a more complex change and might break mods, I haven't created a patch for this.

Comments / History

Changed ticket status from "New" to "Fix in progress"

Action performed by nickvergessen (Development Team Member) on Jul 6th 2009, 10:44

Assigned ticket to user "nickvergessen"

Action performed by nickvergessen (Development Team Member) on Jul 6th 2009, 10:45

Linked ticket with changeset: r9840

Action performed by nickvergessen (Development Team Member) on Jul 24th 2009, 08:49

Changed ticket status from "Fix in progress" to "Fix completed in SVN"

Action performed by nickvergessen (Development Team Member) on Jul 24th 2009, 08:49

Ticket details

Related SVN changesets