From f98ba725442348584810c089111501a07ac59905 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Thu, 15 Mar 2012 21:51:48 +0100 Subject: 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 --- src/account-server/storage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/account-server/storage.cpp') 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) -- cgit v1.2.3-60-g2f50