• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MyAAC v0.8.10 - only numbers in account

error656

New Member
Joined
Aug 27, 2007
Messages
60
Reaction score
1
Hey guys, I need to change the configuration so that only digits can be used in the account name during registration. Currently, numbers and letters are accepted. I checked similar topics but I couldn't find a solution or I'm doing something wrong.

config.jpgwebsite.JPG

I will be grateful for hints
Regards
Error656
 
Solution
There are two file changes required for this:

1) In file: system/pages/createaccount.php

Replace:
PHP:
else if(!Validator::accountName($account_name))

With:
PHP:
else if(!Validator::accountId($account_name))

2) In file: tools/validate.php
Replace:
Code:
if(!Validator::accountName($account))

With:
Code:
if(!Validator::accountId($account))

You may also want to replace following in system/templates/account.create.html.twig:
Code:
<span{% if errors.account is defined %} class="red"{% endif %}>Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}:</span>

With:
Code:
<span{% if errors.account is defined %} class="red"{% endif %}>Account Number:</span>

So it says: "Number", and no "Name".
Hey guys, I need to change the configuration so that only digits can be used in the account name during registration. Currently, numbers and letters are accepted. I checked similar topics but I couldn't find a solution or I'm doing something wrong.

View attachment 77181View attachment 77182

I will be grateful for hints
Regards
Error656
Post your account create code, you can make a function in the account name field
 
There are two file changes required for this:

1) In file: system/pages/createaccount.php

Replace:
PHP:
else if(!Validator::accountName($account_name))

With:
PHP:
else if(!Validator::accountId($account_name))

2) In file: tools/validate.php
Replace:
Code:
if(!Validator::accountName($account))

With:
Code:
if(!Validator::accountId($account))

You may also want to replace following in system/templates/account.create.html.twig:
Code:
<span{% if errors.account is defined %} class="red"{% endif %}>Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}:</span>

With:
Code:
<span{% if errors.account is defined %} class="red"{% endif %}>Account Number:</span>

So it says: "Number", and no "Name".
 
Solution
There are two file changes required for this:

1) In file: system/pages/createaccount.php

Replace:
PHP:
else if(!Validator::accountName($account_name))

With:
PHP:
else if(!Validator::accountId($account_name))

2) In file: tools/validate.php
Replace:
Code:
if(!Validator::accountName($account))

With:
Code:
if(!Validator::accountId($account))

You may also want to replace following in system/templates/account.create.html.twig:
Code:
<span{% if errors.account is defined %} class="red"{% endif %}>Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}:</span>

With:
Code:
<span{% if errors.account is defined %} class="red"{% endif %}>Account Number:</span>

So it says: "Number", and no "Name".
Thank you very much, following the instructions provided by you, the problem has been completely resolved. Again thank you very much
 
Back
Top