-
Bug
-
Resolution: Fixed
-
3.0.5
-
None
-
PHP Environment:
Database:
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.

