Skip to main content
Back to all ideas

Separate username from community name

Launched

I think it would be better to separate the registered username from community name option. Username should be unique for a private action  and community name something nobody should be able to "guess" the persons login details :) 

Username should not be visible anywhere.

0 followers

3 comments

  1. Melynda

    The FluentCommunity username (the "username" field that's found in the fcom_xprofile and that's shown by @name under the display name) is different from Wordpress's username. Thus, the Wordpress username is never visible--only the FluentCommunity username. (I know...it's convoluted, but hang on, we're going for a ride here--WHEEEE!--because it took me about a week to figure this all out myself, noob that I am.)

    Moving on...FluentCommunity's Display Name (display_name in the fcom_xprofile table) is concatenated from the "First Name" and "Last Name" input boxes the user can edit on the "Edit Profile" form.

    At first, the user's "First Name" and "Last Name" boxes are filled with the first name and last name they registered with (from the first_name and last_name fields in the usermeta table).

    I was disturbed by the fact that the users' real names are used for that purpose, because I want my users to be able to choose whether or not to expose their real names. And, yes, you can onboard them to instruct them that they can change their display name, but we all know that many (if not most) users aren't gonna read or do their onboarding stuff anyway, so....

    A user can change their "First Name" and leave their "Last Name" box blank. But that's not obvious to users.

    Annnnd...when users try to change their username (the @name), there's a "WARNING" popup that asks users if they're sure (but doesn't really tell them why it's a problem to change it). The only reason why it might be a problem (and I'm not sure of this!) is that maybe @mentions and links to their profile (if they have any) might now work, so I don't know why the big, scary "WARNING" popup is there. After all, it doesn't change the Wordpress username or anything else in the usermeta table, so.... ¯\_(ツ)_/¯

    Anyhow...

    I (with the help of ChatGPT, because I'm a noob coder) spent the past week coding a plugin that takes care of the problem. This is what it does:

    It enforces name privacy in FluentCommunity. In public, FluentCommunity uses only xprofile.display_name. On the /update screen, it shows one “Display Name” box (which is really the "First Name" box, relabeled and hides the adjacent “Last Name” box. It prefills the Display Name box from fcom_xprofile.display_name. It saves what the user inputs in this new "Display Name" box to fcom_xprofile.display_name. It caps the display_name at 40 chars on save. It hides the username hint text, changes the “Community Account Username” label to “@name”, rewrites the username-change confirmation popup text, prevents reserving/reusing any @name ever used by another user (but the original owner can reclaim it), disallows digits in @names, and disallows digits in display names.

    Some of those features are things you didn't ask for, but they're things I wanted.

    If you're interested, you can PM me; I'm happy to share what I made. The code is pretty long. Keep in mind that I ~am~ a noob, and I've not used my plugin in a production environment yet, so I can't guarantee the plugin will be secure or will work for your use-case--YMMV! You or your handy-dandy neighborhood dev might have to do some re-working of the plugin, but I'm happy to share what I have. :-)