Commit graph

51 commits

Author SHA1 Message Date
pentarctagon
c04ecaa8fb Store the client version in the database.
This will now store the version of the client playing a side in `game_player_info`.
2019-10-20 13:57:45 -05:00
pentarctagon
2cd4273192 Use BIT(1) for fields with only 2 possible non-NULL values. 2019-09-28 09:27:20 +02:00
pentarctagon
7cb6482b32 Store in the database whether the game is a reload or not. 2019-09-28 09:27:20 +02:00
Pentarctagon
25f1537003 Remove the user_handler's clean_up() method.
It doesn't do anything.
2019-08-22 10:41:51 +02:00
Pentarctagon
eef0c34b0e Removes unused/unimplemented nickserv functionality.
Commands removed:
* register
* set
* details
* drop
2019-08-22 10:41:51 +02:00
Pentarctagon
0870d1bc89 Remove unused email-related functions. 2019-08-22 10:41:51 +02:00
Pentarctagon
b9246dc6b4 Add a flag to record if the game encountered an OOS error. 2019-08-17 14:42:35 +02:00
Pentarctagon
59e9f9a138 Add support for storing game information in wesnoth's mysql database.
This requires three more tables to be added to any database with the forum user handler enabled, the structures of which are defined in the wesnothd man page:
* `db_game_info_table` - stores information about each game.
* `db_game_player_info_table` - stores information about each player in the game.
* `db_game_modification_info_table` - stores information about any modifications that are enabled for the game.
2019-08-12 13:04:26 +02:00
Iris Morelle
6d567889cd wesnothd: Retrieve forum ban durations and send the remaining time to clients
This should make it less confusing for players who might assume that
their ban is permanent otherwise. If the ban is permanent the duration
is not sent to clients, however. Since permanent bans can be revoked on
appeal, it seems like a good idea to me to avoid using any wording that
would allude to their otherwise infinite duration.

Closes #3766.
2019-03-01 02:29:33 -03:00
Martin Hrubý (hrubymar10)
674fda85b7 Migrate links to https if available - Fwd c18537edc0
(cherry-picked from commit bc4d22dc72)
2018-10-07 03:23:36 +00:00
Iris Morelle
3dc31e66f5 wesnothd: Report different user_handler ban types
This enables reporting back to the client the specific type of ban that
affects the account. This information is already normally provided by
phpBB when trying to view a page while banned, so we are not leaking any
new information here.

There isn't an API to retrieve the (user-visible) ban reason from the
ban list yet. It's probably not worth worrying about it since affected
users can see it when navigating to forums.wesnoth.org anyway.

(cherry-picked from commit 749e684f03)
2018-10-07 03:20:29 +00:00
Iris Morelle
aa8c1793d9 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.

(cherry-picked from commit f2c06f0a4e)
2018-10-07 03:20:29 +00:00
Charles Dang
122976bef0 wesnothd: removed password reminder backend (closes #2753)
(cherry-picked from commit e52682e07b)
2018-10-07 03:18:17 +00:00
Gregory A Lundberg
108f6188ab Use standard names
The word salt was used to mean both the password salt and the password challenge nonce.

The word pepper was used to represent the password challenge.

Also renamed the MD5 nonce generator to make it clear it's not secure.
2018-03-13 19:58:43 -05:00
Gregory A Lundberg
4c77b5c418 Use cryptographic-strength RNG for password nonce
rand() and srand() are crap.

We can't fix the existing MD5 password hashing but it will go away when Bcrypt password hashing goes live on the Forums.
2018-03-13 19:58:43 -05:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
Charles Dang
2101353d36 Convert include guards to the shorter #pragma once
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.

For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
2017-05-09 19:41:37 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Charles Dang
e22c8967ee Cleaned up global.hpp includes 2016-12-17 15:21:04 +11:00
Charles Dang
83ee4f6087 Convert most includes to src/-relative
This excludes includes that need backtrack path specifiers in order to resolve
name clashes.
2016-03-19 19:35:17 +11:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Ignacio R. Morelle
3f9ca006e1 Add wesnothd user_handler support...
...for checking whether a user account is active and can claim
ownership or a nickname or not

Right now this code is unused in the auth logic. Both suh and fuh
implementations are provided, only the latter works (using phpBB 3.0's
rules).
2011-06-21 00:53:33 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Alexander van Gessel
48ce177759 Made some more errors inherit from game::error 2010-08-03 18:36:59 +01:00
Alexander van Gessel
884de7f851 Make user_handler::error and gui::button::error inherit from game::error 2010-08-01 23:26:47 +01:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Alexander van Gessel
57b6e955b1 Strip out jwsmtp and the server mailer based on it.
Turn related functions into stubs
2009-11-08 19:05:49 +01:00
Mark de Wever
671b0b256c Strip trailing whitespace. 2009-08-29 18:46:38 +00:00
Karol Nowak
d28ba2b176 Delete mailer_ in user_handler's destructor. 2009-07-05 21:48:19 +00:00
Guillaume Melquiond
ffcbaf82bd Fixed source documentation. 2009-04-26 16:15:13 +00:00
Sergey Popov
e38299198f Fixed compile error with forum_user_handler enabled. 2009-04-25 10:53:20 +00:00
Mark de Wever
31e4b00269 Remove unneeded includes. 2009-04-10 19:20:26 +00:00
Guillaume Melquiond
60808a88ba Got rid of pointers to config objects. Removed code duplication along the way. 2009-04-04 17:51:20 +00:00
Thomas Baumhauer
c6590bc850 cleanup of the password hashing code and the login protocol...
...(thus breaks compatibility)
2009-03-29 16:53:42 +00:00
Mark de Wever
fac95b3ea5 Added constructor to initialize all members. 2009-02-20 19:55:01 +00:00
Thomas Baumhauer
5941c9bce8 reenable people to write their own user handlers:
...only let the client encrypt the password using phpbb's algorithm if
the server has asked it to do so.
2009-01-29 17:17:16 +00:00
Mark de Wever
973a0a7d5c Remove trailing whitespace. 2009-01-01 10:28:26 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Thomas Baumhauer
080b04ae3e automatically remember server moderators 2008-12-26 11:45:51 +00:00
Mark de Wever
c0322851a2 Update doxygen comment style. 2008-09-21 07:31:58 +00:00
Thomas Baumhauer
82ee1bed73 Adding the license header to the user_handler files 2008-09-14 07:29:10 +00:00
Thomas Baumhauer
b4c01744fa Adding user_handler log domain. 2008-09-12 18:17:52 +00:00
Thomas Baumhauer
5410f759fb Add deconstructor to the forum_user_handler class to make it compile again 2008-08-16 12:57:42 +00:00
Sergey Popov
ec62afa06e Fix compile warnings. 2008-08-16 10:54:26 +00:00