Rename db_group_table -> db_user_group_table since it's more accurate.

Backport of b14a4b1bb3
This commit is contained in:
pentarctagon 2019-08-26 12:50:06 -05:00
parent 9f40471099
commit b2d85bb3a6
No known key found for this signature in database
GPG key ID: 29E48D667D52CCF3
3 changed files with 4 additions and 4 deletions

View file

@ -247,7 +247,7 @@ section is present in the configuration the server will run without any nick reg
.B db_game_modification_info_table
(for user_handler=forum) The name of the table in which wesnothd will save its own data about the modifications used in a game.
.TP
.B db_group_table
.B db_user_group_table
(for user_handler=forum) The name of the table in which your phpbb forums saves its user group data. Most likely this will be <table-prefix>_user_group (e.g. phpbb3_user_group).
.TP
.B mp_mod_group

View file

@ -45,7 +45,7 @@ fuh::fuh(const config& c)
, db_game_info_table_(c["db_game_info_table"].str())
, db_game_player_info_table_(c["db_game_player_info_table"].str())
, db_game_modification_info_table_(c["db_game_modification_info_table"].str())
, db_group_table_(c["db_group_table"].str())
, db_user_group_table_(c["db_user_group_table"].str())
, mp_mod_group_(0)
, conn(mysql_init(nullptr))
{
@ -416,7 +416,7 @@ void fuh::write_detail(const std::string& name, const std::string& detail, T&& v
bool fuh::is_user_in_group(const std::string& name, unsigned int group_id) {
try {
return prepared_statement<bool>("SELECT 1 FROM `" + db_users_table_ + "` u, `" + db_group_table_ + "` ug WHERE UPPER(u.username)=UPPER(?) AND u.USER_ID = ug.USER_ID AND ug.GROUP_ID = ?", name, group_id);
return prepared_statement<bool>("SELECT 1 FROM `" + db_users_table_ + "` u, `" + db_user_group_table_ + "` ug WHERE UPPER(u.username)=UPPER(?) AND u.USER_ID = ug.USER_ID AND ug.GROUP_ID = ?", name, group_id);
} catch (const sql_error& e) {
ERR_UH << "Could not execute test query for user group '" << group_id << "' and username '" << name << "'" << e.message << std::endl;
return false;

View file

@ -105,7 +105,7 @@ class fuh : public user_handler {
std::time_t retrieve_ban_duration_internal(const std::string& col, const std::string& detail);
std::time_t retrieve_ban_duration_internal(const std::string& col, unsigned int detail);
std::string db_name_, db_host_, db_user_, db_password_, db_users_table_, db_banlist_table_, db_extra_table_, db_game_info_table_, db_game_player_info_table_, db_game_modification_info_table_, db_group_table_;
std::string db_name_, db_host_, db_user_, db_password_, db_users_table_, db_banlist_table_, db_extra_table_, db_game_info_table_, db_game_player_info_table_, db_game_modification_info_table_, db_user_group_table_;
unsigned int mp_mod_group_;
MYSQL *conn;