Skip to content

Commit

Permalink
Fixed #9628 (Console command: addAccount shows password in logs)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed May 11, 2017
1 parent bec9631 commit 85951d2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Server/mods/deathmatch/logic/CConsoleCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,14 +895,16 @@ bool CConsoleCommands::ChgMyPass ( CConsole* pConsole, const char* szArguments,
pAccount->SetPassword( szNewPassword );

// Tell the client
if ( pClient->GetClientType() != CClient::CLIENT_CONSOLE )
pEchoClient->SendEcho ( SString ( "chgmypass: Your password was changed to '%s'", szNewPassword ) );
CLogger::LogPrintf ( "ACCOUNTS: %s changed their account password", GetAdminNameForLog ( pClient ).c_str () );
CLogger::LogPrintf ( "ACCOUNTS: %s changed their account password\n", GetAdminNameForLog ( pClient ).c_str () );
return true;
}
else
{
if ( pClient->GetClientType() != CClient::CLIENT_CONSOLE )
pEchoClient->SendEcho ( "chgmypass: Bad old password" );
CLogger::LogPrintf ( "ACCOUNTS: %s failed to change their account password", GetAdminNameForLog ( pClient ).c_str () );
CLogger::LogPrintf ( "ACCOUNTS: %s failed to change their account password (Bad old password)\n", GetAdminNameForLog ( pClient ).c_str () );
}
}
else
Expand Down Expand Up @@ -958,10 +960,11 @@ bool CConsoleCommands::AddAccount ( CConsole* pConsole, const char* szArguments,
g_pGame->GetAccountManager ()->AddNewPlayerAccount ( szNick, szPassword );

// Tell the user
if ( pClient->GetClientType() != CClient::CLIENT_CONSOLE )
pClient->SendEcho ( SString ( "addaccount: Added account '%s' with password '%s'", szNick, szPassword ) );

// Tell the console
CLogger::LogPrintf ( "ACCOUNTS: %s added account '%s' with password '%s'\n", GetAdminNameForLog ( pClient ).c_str (), szNick, szPassword );
CLogger::LogPrintf ( "ACCOUNTS: %s added account '%s'\n", GetAdminNameForLog ( pClient ).c_str (), szNick );
return true;
}
else
Expand Down Expand Up @@ -1027,6 +1030,7 @@ bool CConsoleCommands::DelAccount ( CConsole* pConsole, const char* szArguments,
}

// Tell the client
if ( pClient->GetClientType() != CClient::CLIENT_CONSOLE )
pEchoClient->SendEcho ( SString ( "delaccount: Account '%s' deleted", szArguments ) );

// Tell the console
Expand Down Expand Up @@ -1071,10 +1075,11 @@ bool CConsoleCommands::ChgPass ( CConsole* pConsole, const char* szArguments, CC
pAccount->SetPassword ( szPassword );

// Tell the client
if ( pClient->GetClientType() != CClient::CLIENT_CONSOLE )
pEchoClient->SendEcho ( SString ( "chgpass: %s's password changed to '%s'", szNick, szPassword ) );

// Tell the console
CLogger::LogPrintf ( "ACCOUNTS: %s changed %s's password to '%s'\n", GetAdminNameForLog ( pClient ).c_str (), szNick, szPassword );
CLogger::LogPrintf ( "ACCOUNTS: %s changed %s's password\n", GetAdminNameForLog ( pClient ).c_str (), szNick );
return true;
}
else
Expand Down

0 comments on commit 85951d2

Please sign in to comment.