mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
*Mangos Implement AURA_STATE_HEALTH_ABOVE_75_PERCENT use. By DiSlord.
*Mangos [7045]. More correct spell select for creatures if spell PreventionType == SPELL_PREVENTION_TYPE_SILENCE. Also add check for PreventionType == SPELL_PREVENTION_TYPE_PACIFY. By DiSlord. *Mangos [7046] Do more security level checks in commands using HasLowerSecurity. Make use .account set addon safe for players. By Vladimir. *Mangos [7047] Fix Draenei race spell add at client switch. By DiSlord. --HG-- branch : trunk
This commit is contained in:
@@ -840,19 +840,10 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 targetSecurity = accmgr.GetSecurity(targetAccountId);
|
||||
|
||||
/// m_session==NULL only for console
|
||||
uint32 plSecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE;
|
||||
|
||||
/// can set password only for target with less security
|
||||
/// This is also reject self apply in fact
|
||||
if (targetSecurity >= plSecurity)
|
||||
{
|
||||
SendSysMessage (LANG_YOURS_SECURITY_IS_LOW);
|
||||
SetSentErrorMessage (true);
|
||||
if(HasLowerSecurityAccount (NULL,targetAccountId,true))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strcmp(szPassword1,szPassword2))
|
||||
{
|
||||
@@ -6277,8 +6268,15 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Let set addon state only for lesser (strong) security level
|
||||
// or to self account
|
||||
if (m_session && m_session->GetAccountId () != account_id &&
|
||||
HasLowerSecurityAccount (NULL,account_id,true))
|
||||
return false;
|
||||
|
||||
int lev=atoi(szExp); //get int anyway (0 if error)
|
||||
if(lev < 0)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user