[11736] Hide passwords from logs

* DB connection
* chat/console password changes commands.
This commit is contained in:
VladimirMangos 2011-07-13 05:38:43 +04:00
parent f4802ab4c4
commit a0ff5f4536
9 changed files with 68 additions and 57 deletions

View file

@ -1223,22 +1223,7 @@ void ChatHandler::ExecuteCommand(const char* text)
if ((this->*(command->Handler))((char*)text)) // text content destroyed at call
{
if (command->SecurityLevel > SEC_PLAYER)
{
// chat case
if (m_session)
{
Player* p = m_session->GetPlayer();
ObjectGuid sel_guid = p->GetSelectionGuid();
sLog.outCommand(GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected: %s]",
fullcmd.c_str(),p->GetName(),GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(),
sel_guid.GetString().c_str());
}
else // 0 account -> console
{
sLog.outCommand(GetAccountId(),"Command: %s [Account: %u from %s]",
fullcmd.c_str(),GetAccountId(),GetAccountId() ? "RA-connection" : "Console");
}
}
LogCommand(fullcmd.c_str());
}
// some commands have custom error messages. Don't send the default one in these cases.
else if (!HasSentErrorMessage())
@ -3571,6 +3556,24 @@ std::string ChatHandler::PrepareStringNpcOrGoSpawnInformation(uint32 guid)
return str;
}
void ChatHandler::LogCommand(char const* fullcmd)
{
// chat case
if (m_session)
{
Player* p = m_session->GetPlayer();
ObjectGuid sel_guid = p->GetSelectionGuid();
sLog.outCommand(GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected: %s]",
fullcmd, p->GetName(), GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(),
sel_guid.GetString().c_str());
}
else // 0 account -> console
{
sLog.outCommand(GetAccountId(),"Command: %s [Account: %u from %s]",
fullcmd, GetAccountId(), GetAccountId() ? "RA-connection" : "Console");
}
}
// Instantiate template for helper function
template void ChatHandler::ShowNpcOrGoSpawnInformation<Creature>(uint32 guid);
template void ChatHandler::ShowNpcOrGoSpawnInformation<GameObject>(uint32 guid);