Keep Usernames case sensitive

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Keep Usernames case sensitive

Post by peebee » 2021-11-22 22:10

Rather than strip all capitals from Usernames with strtolower() - it would be great to keep them case sensitive as intended and entered by the User.

This would not only cause less confusion for Users/Amins but would also enhance security and allow Users to use proper titles they way they were designed.

It also leads to potential issues like this: viewtopic.php?f=11&t=4530

Personally, I can't see any benefit in converting Usernames to lowercase? It can/does cause confusion and likely requires more code to add that function that it would to leave it out?

If there is a benefit, I would be interested to know what that may be?

Just my thoughts.....

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Keep Usernames case sensitive

Post by jsetzer » 2022-02-01 19:43

Isn't it just for comparison? I think in login page user can enter login name the way they want and browser will save as typed, for example even "mYuSeRnaME" or "MyUsername" or "myusername". For comparing equality appgini compares lowercase input with lowercase database entry, but I may be wrong.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

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

Re: Keep Usernames case sensitive

Post by peebee » 2022-02-01 23:18

Yes Jan, you are correct in that the Username sign-in is not case sensitive.

And yes, Usernames are converted and stored in the database in all lower case.

The sign in is not the actual issue for me - that's all good.

My (selfish perhaps) reasoning for not stripping case sensitivity: in virtually all of my situations, for professional purposes we use actual first and last names of individuals as the Username. Primarily, this is so Users and who has done what are easily identified within a business, amongst other reasons.

We also use many time/date stamps with Username included, updates by Username, email inclusions with Username, etc, etc. Username is also displayed to Users in all lower case , as it is when accessing your own profile.

For professionalism, the look of proper names stripped of capitalisation is not a particularly good look and perhaps unnecessary (just my opinion of course).

I understand and appreciate the necessity to compare Usernames at signup/login (User1, USER1, uSER1 could all be accepted for example - a possible potential problem) but for cases like me at least, it would be nice to have the option to accept, or at least display, case sensitive Usernames as they are entered purely for the reasons outline above.

Just one persons opinion for what it's worth. :)

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

Re: Keep Usernames case sensitive

Post by peebee » 2022-02-24 00:20

Thought of a no code edit workaround to keep proper name Usernames case sensitive (or capitalized at least). Just pure CSS.

Rather than store the Usernames in the database as case sensitive (a lot of work), just transform them with "text-transform: capitalize;" property for each class and id where the Username appears.

For example: .username { text-transform: capitalize; } will capitalize the Username that appears in the Nav Bar "Signed in as Xxxxx Xxxxx"

Thanks to good coding in Appgini, each location a Username appears it seems to have a unique css class or id so easy to apply the property for each instance.

Problem solved and no potential issues of duplicated Usernames being registered.

User avatar
urichard
Veteran Member
Posts: 87
Joined: 2018-11-01 12:11

Re: Keep Usernames case sensitive

Post by urichard » 2022-06-16 14:54

Hi Peebee,

My appologies im still new

I read your thread and im looking to auto CAPITALIZE the VarChar data type field but cant seem to find the CSS location you mentioned here?

Im using Nirthwind Demo
[email protected][/color]

Kind Regards
Richard

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

Re: Keep Usernames case sensitive

Post by peebee » 2022-06-17 00:40

Hi Richard,

There is no specific CSS file to add to. You will need to either add any additional CSS to your hooks/header-extras.php, hooks/footer-extras.php or include a dedicated additional custom.css file (which is what I do out of preference as I have a lot of additional CSS). Here's a blog post by the Appgini developer that will show you how to include additional CSS in your hooks/footer-extras.php file: https://bigprof.com/blog/appgini/how-to ... able-view/

You can either add the { text-transform: capitalize; } property to each individual field ID or CSS class you want to capitalize (inspect element in your browser - each field has their own unique id="whatever" and CSS class) or

To capitalize EVERY field - whilst I haven't tried it, for Detail view I think the following will work:

.form-control {text-transform: capitalize;}
.form-control-static {text-transform: capitalize;}

and for Table view the following to should capitalize every field:

.table a {text-transform: capitalize}

Alternatively, you will just need to inspect each individual element to find the appropriate class or ID to apply any CSS property

Hope that helps

Post Reply