Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wesnothd: Initial support for checking forum bans during login
This adds a user_is_banned() method to the user_handler classes that returns whether a given username (and optionally IP address) is banned by the user_handler platform. Obviously right now this is only intended to work with forum_user_handler and phpBB. Forum bans are checked against entries in the banlist table using username (actually user id), IP address, and email address where applicable. A user matching a ban on any of those three items will not be permitted into the server *unless* they have the moderator flag set. It might be worth making an exception for board founders as well, although that is probably orthogonal to this patchset. Right now there are a few missing items: * The server sends clients an error that allows them to try again with a different username/password combination immediately. Nothing stops them from causing noise in the server logs this way, so we probably need to ensure this counts as an authentication failure for the purpose of temporarily and automatically banning the IP address. * The user handler doesn't allow retrieving details about the ban, so all that the main server code can do is report back to the client as their nickname being banned, when this is not necessarily the case (email or IP address bans). I need to figure out a better API for retrieving this info. * Likewise, the server does not log the specifics about the matched ban yet unless the mp_user_handler log domain is set to the info log level. * There's no i18n support on the client side for the error message sent by the server -- which is going to change anyway. * Testing this patch uncovered an issue with the MP client not displaying messages sent during the login sequence, including the mod authentication notice.
- Loading branch information
Showing
8 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters