diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-15 21:51:48 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-16 23:22:43 +0100 |
commit | f98ba725442348584810c089111501a07ac59905 (patch) | |
tree | 3a475e2f873b938c3d15ced23b58490f10c90ac0 | |
parent | 5e0fc928dca6f074cca25f3d76401d40523e9a7d (diff) | |
download | manaserv-f98ba725442348584810c089111501a07ac59905.tar.gz manaserv-f98ba725442348584810c089111501a07ac59905.tar.bz2 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
-rw-r--r-- | src/account-server/storage.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp index da516979..9a19a673 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) |