Page 1 of 1

How to change the max of 20 characters for the username

Posted: 2015-06-11 18:26
by wilmira
Hello,

I want to use the email as the username in a sing up process, however, some emails are larger that 20 characters. Does anybody know where I can make that maximun of 20 characters longer?

Thanks in advance,

Wilfredo

Re: How to change the max of 20 characters for the username

Posted: 2015-06-11 19:08
by patsd102
Maybe increase max varchar value with my php admin.
Its currently set at 20

(always back up your site before making changes)

Pat

Re: How to change the max of 20 characters for the username

Posted: 2015-06-11 22:56
by wilmira
It did not work!!

Re: How to change the max of 20 characters for the username

Posted: 2015-06-12 16:33
by patsd102
ok,

Maybe Ageady would be better

Re: How to change the max of 20 characters for the username

Posted: 2015-06-14 14:52
by shasta59
What version of AppGini are you using?

Also I just tested with my testing database running 5.31 and it worked fine.

I changed the value of memberID in the membership_users table to 30, 40, 50, 60, 70 and they all worked fine with a username which was 1 character less than the max allowed. I made the type varchar size from 30 to 70 and all was fine.

[img]
Voila_Capture501.jpg
Voila_Capture501.jpg (99.71 KiB) Viewed 13861 times
[/img]

You can see in the picture a screen shot from phpmyadmin where memberID is set to 40.

Hope this helps.

Alan

Re: How to change the max of 20 characters for the username

Posted: 2015-06-16 05:43
by wilmira
Hello Shasta,

I am using Appgini 5.40.

I did that whith php my admini, as Pat suggested, however when I tried the program, the warning message appeared after entering the 20 characters long username(email). Maybe it was just the warning, I actually did not try the sign up process completly, because of the warning. I will try again, and then I just have to get rid of that warning!!

In case it works, Do you know where I can change that warning?

Thanks again,

Re: How to change the max of 20 characters for the username

Posted: 2015-06-16 06:39
by peebee
The alert looks to be this section of code, found at line 26 in admin/pageEditMember.php (V5.40)

Code: Select all

// new member or old?
		if(!$oldMemberID){ // new member
			// make sure member name is unique
			$memberID = is_allowed_username($_POST['memberID']);
			if(!$memberID){
				echo "<div class=\"alert alert-danger\">Error: Username already exists or is invalid. Make sure you provide a username containing 4 to 20 valid characters.</div>";
				include("$currDir/incFooter.php");
			}
Other Username functions/validation seem to be in "function setupMembership(){" found in admin/incFunctions.php although I haven't fiddled around in there so I don't know what sort of damage you can do editing those values?

Re: How to change the max of 20 characters for the username

Posted: 2015-06-16 15:21
by shasta59
Ah, that line does not seem to exist in 5.31. Must be a new feature to check the length. Easy enough to figure out how to change that when I get on 5.4x (Or at least I could not find that line)

Not upgrading for a while because I wait to see what issues occur and what I have to watch for.

Alan

Re: How to change the max of 20 characters for the username

Posted: 2015-06-20 13:35
by a.gneady
As of AppGini 5.40, all username validation is centralized in admin/incFunctions.php, in the is_allowed_username() function ... To allow a username to exceed 20 characters, besides changing the length of the field in the database, you need to change the code {3,19} inside the is_allowed_username() function to {3,39} (for 40 characters max username length).

Re: How to change the max of 20 characters for the username

Posted: 2015-06-23 16:28
by wilmira
Thanks to eveyone collaborating.

To close this topic, there is just a final change to make. In the file defaultLang.php, change the number of the maximum characters (arround line 276), for your new maximum, in this case 40. I changed that also in the file pageEditMember.php (lines 30 and 48), but it did not work. Just remember, this is for V5.40

Wilfredo

Re: How to change the max of 20 characters for the username

Posted: 2015-07-22 08:40
by HaroldNHulsey
Most of the email username ask Maximum 20 Characters, now a days it is set. Less characters always good and didn't forget the characters.

Max length / Allow email addresses as memberID

Posted: 2018-08-27 10:50
by jsetzer
Hi Ahmad,

I know this is an old post, but I'm also struggling with this. I have seen that there is still the limit of 20 characters in admin\incFunctions.php in AppGini ver 5.72 rev. 1036 which I am using.

From my point of view this should definately be increased in the future :!: to allow email-addresses as memberID.

Kind Regards,
Jan

Re: How to change the max of 20 characters for the username

Posted: 2018-08-28 15:07
by a.gneady
There is a related discussion where I replied here: https://forums.appgini.com/phpbb/viewto ... f=6&t=2784