Case sensitive Usernames?

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Case sensitive Usernames?

Post by peebee » 2013-05-22 03:36

I note that Appgini converts all upper case characters in Username to lower case and stores them in the database as such. Passwords do appear to be case sensitive.

I would prefer to maintain Usernames with case sensitivity as they are initially entered, if possible.

Looks like the code below in membership_signup.php is what converts the Username to lowercase;

Code: Select all

if($_POST['signUp']!=''){
		// receive data
		$memberID=makeSafe(strtolower($_POST['newUsername']));
Can anybody advise if there is a good reason why the Usernames are converted to lowercase and if there is any issue with saving them in the original case as entered?

And if it is OK to maintain case sensitivity, what code is necessary to change, apart from the strtolower above and the line "if(sqlValue("select count(1) from membership_users where lcase(memberID)='$memberID'"))" in the same file, to get it to work and keep the case sensitivity?

Thanks.

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

Re: Case sensitive Usernames?

Post by a.gneady » 2013-05-29 09:56

It was a design decision to make usernames case-insensitive for usability reasons (most users are used to the idea that email addresses are not case-sensitive, but are used to passwords being case-sensitive) ... However, if you want to change that, you should search for the following in the code (using a code editor that supports searching in multiple files, for example NotePad++):
strtolower
lcase

whenever the input to any of the above functions is a username, you should then remove the function, keeping its input of course. You should make a backup of the code first, just in case anything goes wrong -- or simply use AppGini to regenerate .... the problem with this approach is that you'd have to repeat it every time you regenerate the code ... if there are many users who would like to have usernames be case-sensitive, I might consider adding it as an option in future releases of AppGini.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply