Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How to change the allowed length of registration e-mail's and user names.

Junior Spellweaver
Joined
Jan 22, 2012
Messages
197
Reaction score
42
Ok guys so I asked for an answer to this and didn't get it bit I found it myself and figured it out. So if you want to change the length of allowed emails and account names do as follows bare with me as this is my first tutorial.

If your using 343's release go to /opt/lampp/htdocs/register get the index file there index.php MAKE A BACK UP OF THE FILE BEFORE PROCEEDING I would suggest making a folder and labeling it backup files and putting a copy of the unedited file in it.

Then open it in your text editor of choice.. for noobies id use wordpad since it keeps the formatting better and find the following.

Code:
 if (MySQL_Num_Rows($Result))
            {
                echo "Account <b>".$Login."</b> already exists";
            }
        
        elseif ((StrLen($Login) < 4) or (StrLen($Login) > 10)) 
        
            {
                echo "User Name must have more than 4 and not more than 10 characters.";
            }
            
        elseif ((StrLen($Pass) < 4) or (StrLen($Pass) > 10)) 
        
            {
                echo "Password must have more than 4 and not more than 10 characters.";
            }
            
        elseif ((StrLen($Repass) < 4) or (StrLen($Repass) > 10)) 
            {
                echo "Confirmation password error.";
            }
            
        elseif ((StrLen($Email) < 4) or (StrLen($Email) > 25)) 
            {
                echo "Email Address must have more than 4 and not more than 25 characters.";
            }

For some of you I am sure this becomes painfully obvious as to what to change looking at it but for those who don't have as much experience these numbers effect the allowed lengths < 4) > 10 four being the minimum number and 10 being the high except for in the emails which are 4-25 characters.

Also be sure to edit these three messages

echo "User Name must have more than 4 and not more than 10 characters.";

echo "Password must have more than 4 and not more than 10 characters.";
}


echo "Email Address must have more than 4 and not more than 25 characters."; so they show the new values they entered for those of you who need an example I included my edited lines below.

Code:
if (MySQL_Num_Rows($Result))
            {
                echo "Account <b>".$Login."</b> already exists";
            }
        
        elseif ((StrLen($Login) < 4) or (StrLen($Login) > 16)) 
        
            {
                echo "User Name must have more than 4 and not more than 16 characters.";
            }
            
        elseif ((StrLen($Pass) < 4) or (StrLen($Pass) > 30)) 
        
            {
                echo "Password must have more than 4 and not more than 30 characters.";
            }
            
        elseif ((StrLen($Repass) < 4) or (StrLen($Repass) > 30)) 
            {
                echo "Confirmation password error.";
            }
            
        elseif ((StrLen($Email) < 4) or (StrLen($Email) > 60)) 
            {
                echo "Email Address must have more than 4 and not more than 60 characters.";
            }
        
        elseif ($Pass != $Repass)
            {
                echo "Confirmation password error.";
            }        
        else
            {



Ok so this is how you edit it in the admin account registration page since it uses a different file than the main registration.

go here /opt/apache-tomcat-5.5.28/2/webapps/pwAdmin

get the account.jsp file again MAKE A BACK UP BEFORE GOING FORWARD

then find this line

Code:
if(login.length() > 0 && password.length() > 0)

directly below it you will see an entry with numbers just like the first tutorial just change them to match your new settings and your good again here is my own edit as an example.

Code:
if(login.length() > 0 && password.length() > 0)
				{
					if(login.length() < 4 || login.length() > 16 || password.length() < 4 || password.length() > 30)
					{

Additionally could a mod please change the title of this thread so it reads registration EMAILS and user names I kind of goofed on that.
 
Last edited:
PW Dev <3
Joined
Feb 28, 2011
Messages
722
Reaction score
117
Re: How to change the allowed length of registration and user names.

Good job, 17 posts and already a tutorial. Welcome to PW development! (That signals the end of my heavy sarcasm to you).
 
Junior Spellweaver
Joined
Jan 22, 2012
Messages
197
Reaction score
42
Re: How to change the allowed length of registration and user names.

Haha don't worry about it I take it for what it is I have run forums before myself so I know how it is. I am actually skilled in somethings myself but I tend to be a space case of a person who learns better through interaction and reverse engineering once I know where I need to look. Luckily you guys were plenty able to put me on the right path lol. Now I want to try and give back for any irritation I caused xd. Speaking of which I plan on writing more of these as I pick up useful stuff so if anyone has any criticisms of how I can make things more clear etc feel free to send me a pm or ask if you need some help.
 
Back
Top