diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-25 10:36:33 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-25 10:36:33 +0000 |
commit | ded3beb31fd3aa57ce15ea85effeda5c329a3343 (patch) | |
tree | 16db8260308267c8adb7cb25f35e06804b422309 /src/login/login.c | |
parent | 46733d74c81b5fccdb1e557cbceb8e977e876e47 (diff) | |
download | hercules-ded3beb31fd3aa57ce15ea85effeda5c329a3343.tar.gz hercules-ded3beb31fd3aa57ce15ea85effeda5c329a3343.tar.bz2 hercules-ded3beb31fd3aa57ce15ea85effeda5c329a3343.tar.xz hercules-ded3beb31fd3aa57ce15ea85effeda5c329a3343.zip |
Added a new login server config for _F/_M account creation method which denies an account creation if either userid or password length is lower than 4 (should be used with conjunction of Disable 4 LetterUserID/Disable 4 LetterPassword client diffs)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15265 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login/login.c')
-rw-r--r-- | src/login/login.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/login/login.c b/src/login/login.c index e57293a4c..a8abef1c7 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -931,6 +931,9 @@ int mmo_auth_new(const char* userid, const char* pass, const char sex, const cha return 3; } + if( login_config.new_acc_length_limit && ( strlen(userid) < 4 || strlen(pass) < 4 ) ) + return 1; + // check for invalid inputs if( sex != 'M' && sex != 'F' ) return 0; // 0 = Unregistered ID @@ -1507,6 +1510,7 @@ void login_set_defaults() safestrncpy(login_config.date_format, "%Y-%m-%d %H:%M:%S", sizeof(login_config.date_format)); login_config.console = false; login_config.new_account_flag = true; + login_config.new_acc_length_limit = true; login_config.use_md5_passwds = false; login_config.min_level_to_connect = 0; login_config.check_client_version = false; @@ -1565,6 +1569,8 @@ int login_config_read(const char* cfgName) else if(!strcmpi(w1, "new_account")) login_config.new_account_flag = (bool)config_switch(w2); + else if(!strcmpi(w1, "new_acc_length_limit")) + login_config.new_acc_length_limit = (bool)config_switch(w2); else if(!strcmpi(w1, "start_limited_time")) login_config.start_limited_time = atoi(w2); else if(!strcmpi(w1, "check_client_version")) |