Skip to Content Skip to Menu

How can a CB Auto Action detect or a Profile URL (alias) is (still) available?

  • NFA
  • NFA
  • OFFLINE
  • Posts: 84
  • Thanks: 15
  • Karma: 0
1 year 8 months ago - 1 year 8 months ago #332850 by NFA
Hi,

I started this week using the email address as username, as it will make, together with auto password generation, user registration easier for new users.

Now I get a privacy problem with the auto generated URL of the profile. It shows a strong hint of the email address of the user in their default userprofile URL. Of course, they can change their own Profile URL (alias) after a login, but in the meantime I am exposing the private email-address information to the world.

So I think I have to use a field/PHP action in CB Auto Actions onAfterUserRegistraion to change the Profile URL (alias) of the user. I want to give them if possible an alias like "Firstname-Lastname". When that is already taken by another user, then "Firstname-Lastname-user_id"

1.) Any idea how a CB Auto Action can be used to test, or a Profile URL alias like "/menu-alias/Firsntame-Lastname" is already taken?
- If NOT exist then, Profile URL (alias) = Firstname-Lastname
- If already exits as URL, then set Profile URL alias = Firstname-Lastname-user_id.

Can It be done with a field or other CB action or should we use PHP/SQL or something else to get this done?

With thanks in advance, Noa
 
Last edit: 1 year 8 months ago by NFA.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 8 months ago #332855 by krileon
It is not recommended to use email address as username. Joomla and CB both expose username quite heavily throughout the site as it's your display name. You can of course use the profile url (alias) field to cover that 1 situation, but it won't stop all the other places where username will output and is a data leak just waiting to happen.

My recommendation for a minimalistic registration form is actually our own, which you can reference below.

 

It can of course be more minimal with no newsletter checkboxes and using single name field. This would give you a registration form that's 4 fields + captcha or 3 fields + captcha if using randomly generated passwords. This shouldn't be a problem for users to provide.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: NFA

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 8 months ago #332856 by krileon
Almost forgot! Another option is to use randomly generated usernames. To do this navigate to CB > Configuration > User Profile and set "Username Fallback" to "Randomly Generated". They can then use the Profile URL field to customize their profile URL if they so desire so it won't just be the randomly generated string.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • NFA
  • NFA
  • OFFLINE
  • Posts: 84
  • Thanks: 15
  • Karma: 0
1 year 8 months ago #332858 by NFA
Okay, so I will stop using email as username and go back to the situation of having a username, randomly generated or submitted by a user.

But then I still have my question. When I want to use CB Auto Actions to create the same kind of Profile URL alias for al new users, is there a way that I can test in CB Auto Actions or my preferred default "/menu-alias/Firsntame-Lastname" URL is still available?

Because using usernames is sometimes also giving private information or doesn't always look professional.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 8 months ago #332859 by krileon
If a field action is being used to set the profile url (alias) field and the profile url already exists it just does nothing, which will fallback to default profile url behavior which would be /username or /userid-username if username is not URL safe. It currently doesn't have any functionality to just increment this if already in use, but there are plans to eventually implement this. There isn't a condition for already in use alias either so you won't be able to check for that.

You might be able to use the following though within your field action to guarantee it's uniquely set for each user by prefixing their user id.

[user_id]-[name]

The alternative is you completely implement your own profile url behavior using a Code action and using PHP or a Query action and using SQL.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: NFA

Please Log in or Create an account to join the conversation.

  • NFA
  • NFA
  • OFFLINE
  • Posts: 84
  • Thanks: 15
  • Karma: 0
1 year 8 months ago #332860 by NFA

If a field action is being used to set the profile url (alias) field and the profile url already exists it just does nothing, which will fallback to default profile url behavior which would be /username or /userid-username if username is not URL safe.

I think this solves my issue. Using CB Auto Actions fields to create alias [Firstname]-[Lastname] after user registration will work for almost 99% from the new users. The double ones will keep the default profile username url. I thought this would give errors on the double ones, but just skipping those aliases is all right with me. 
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum