Core/Command: Check account password max length
This commit is contained in:
1 parent
c425b91368
commit
f59e00b85c
4 files changed
+14
-3
No files matched your search
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `trinity_string` WHERE `entry` = 1031;
|
||||
INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
|
||||
(1031, 'An account password can NOT be longer than 16 characters (client limit). The account was NOT created.');
|
||||
@@ -44,6 +44,9 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass
|
||||
if (utf8length(username) > MAX_ACCOUNT_STR)
|
||||
return AccountOpResult::AOR_NAME_TOO_LONG; // username's too long
|
||||
|
||||
if (utf8length(password) > MAX_PASS_STR)
|
||||
return AccountOpResult::AOR_PASS_TOO_LONG; // password's too long
|
||||
|
||||
Utf8ToUpperOnlyLatin(username);
|
||||
Utf8ToUpperOnlyLatin(password);
|
||||
Utf8ToUpperOnlyLatin(email);
|
||||
|
||||
@@ -863,7 +863,7 @@ enum TrinityStrings
|
||||
LANG_ACCOUNT_NOT_DELETED_SQL_ERROR = 1002,
|
||||
LANG_ACCOUNT_NOT_DELETED = 1003,
|
||||
LANG_ACCOUNT_CREATED = 1004,
|
||||
LANG_ACCOUNT_TOO_LONG = 1005,
|
||||
LANG_ACCOUNT_NAME_TOO_LONG = 1005,
|
||||
LANG_ACCOUNT_ALREADY_EXIST = 1006,
|
||||
LANG_ACCOUNT_NOT_CREATED_SQL_ERROR = 1007,
|
||||
LANG_ACCOUNT_NOT_CREATED = 1008,
|
||||
@@ -889,7 +889,8 @@ enum TrinityStrings
|
||||
LANG_SQLDRIVER_QUERY_LOGGING_DISABLED = 1028,
|
||||
LANG_ACCOUNT_INVALID_BNET_NAME = 1029, // 6.x ONLY
|
||||
LANG_ACCOUNT_USE_BNET_COMMANDS = 1030, // 6.x enum value name but different text in DB
|
||||
// Room for more level 4 1031-1099 not used
|
||||
LANG_ACCOUNT_PASS_TOO_LONG = 1031,
|
||||
// Room for more level 4 1032-1099 not used
|
||||
|
||||
// Level 3 (continue)
|
||||
LANG_ACCOUNT_SETADDON = 1100,
|
||||
|
||||
@@ -141,7 +141,11 @@ public:
|
||||
}
|
||||
break;
|
||||
case AccountOpResult::AOR_NAME_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
|
||||
handler->SendSysMessage(LANG_ACCOUNT_NAME_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AccountOpResult::AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_PASS_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AccountOpResult::AOR_NAME_ALREADY_EXIST:
|
||||
|
||||
Reference in new issue
Block a user