How to change the max of 20 characters for the username

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
wilmira
Veteran Member
Posts: 47
Joined: 2013-07-11 18:00

How to change the max of 20 characters for the username

Post by wilmira » 2015-06-11 18:26

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

patsd102
Veteran Member
Posts: 76
Joined: 2013-01-15 19:59

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

Post by patsd102 » 2015-06-11 19:08

Maybe increase max varchar value with my php admin.
Its currently set at 20

(always back up your site before making changes)

Pat

wilmira
Veteran Member
Posts: 47
Joined: 2013-07-11 18:00

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

Post by wilmira » 2015-06-11 22:56

It did not work!!

patsd102
Veteran Member
Posts: 76
Joined: 2013-01-15 19:59

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

Post by patsd102 » 2015-06-12 16:33

ok,

Maybe Ageady would be better

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

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

Post by shasta59 » 2015-06-14 14:52

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 7041 times
[/img]

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

Hope this helps.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

wilmira
Veteran Member
Posts: 47
Joined: 2013-07-11 18:00

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

Post by wilmira » 2015-06-16 05:43

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,

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 189
Joined: 2013-03-21 04:37

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

Post by peebee » 2015-06-16 06:39

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?

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

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

Post by shasta59 » 2015-06-16 15:21

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
Calgary, Alberta, Canada - Using Appgini 5.50 -

User avatar
a.gneady
Site Admin
Posts: 922
Joined: 2012-09-27 14:46
Contact:

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

Post by a.gneady » 2015-06-20 13:35

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).
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

wilmira
Veteran Member
Posts: 47
Joined: 2013-07-11 18:00

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

Post by wilmira » 2015-06-23 16:28

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

HaroldNHulsey
Posts: 5
Joined: 2015-07-22 07:29

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

Post by HaroldNHulsey » 2015-07-22 08:40

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.

User avatar
jsetzer
Veteran Member
Posts: 56
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Max length / Allow email addresses as memberID

Post by jsetzer » 2018-08-27 10:50

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

User avatar
a.gneady
Site Admin
Posts: 922
Joined: 2012-09-27 14:46
Contact:

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

Post by a.gneady » 2018-08-28 15:07

There is a related discussion where I replied here: https://forums.appgini.com/phpbb/viewto ... f=6&t=2784
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

Post Reply