summaryrefslogtreecommitdiffstats
path: root/src/account-server
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-15 21:51:48 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-16 23:22:43 +0100
commitf98ba725442348584810c089111501a07ac59905 (patch)
tree3a475e2f873b938c3d15ced23b58490f10c90ac0 /src/account-server
parent5e0fc928dca6f074cca25f3d76401d40523e9a7d (diff)
downloadmanaserv-f98ba725442348584810c089111501a07ac59905.tar.gz
manaserv-f98ba725442348584810c089111501a07ac59905.tar.xz
manaserv-f98ba725442348584810c089111501a07ac59905.zip
Use the guild ID when setting guild member rights
While the plan is to allow only one guild per player, the database currently doesn't enforce this. The expected behavior of this API is that it changes the rights only for the specified guild, but the query was changing the rights of the player in all his guilds. Reviewed-by: Erik Schilling
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/storage.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp
index da51697..9a19a67 100644
--- a/src/account-server/storage.cpp
+++ b/src/account-server/storage.cpp
@@ -1468,10 +1468,10 @@ void Storage::setMemberRights(int guildId, int memberId, int rights)
try
{
std::ostringstream sql;
- sql << "update " << GUILD_MEMBERS_TBL_NAME
- << " set rights = '" << rights << "'"
- << " where member_id = \""
- << memberId << "\";";
+ sql << "UPDATE " << GUILD_MEMBERS_TBL_NAME
+ << " SET rights = '" << rights << "'"
+ << " WHERE member_id = '" << memberId << "'"
+ << " AND guild_id = '" << guildId << "'';";
mDb->execSql(sql.str());
}
catch (const dal::DbSqlQueryExecFailure& e)