Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] REST API Style CB User Registration Direct URL Using Auto Actions

  • xengent
  • xengent
  • OFFLINE
  • Posts: 54
  • Thanks: 2
  • Karma: 0
8 years 11 months ago - 8 years 10 months ago #274012 by xengent
I need to have an external website be able to register users by using a direct URL where all the variables are passed in the URL.

Krileon mentioned that I can use CB Auto Actions and a Registration action with trigger set to None. Then use the direct URL and access URL variables with [get_VARIABLE].

Krileon, can you give me a step by step on this. I think a lot of people would benefit from this as a step by step (especially me, since I'm vaguely familiar with Auto Actions). Thanks so much.
Last edit: 8 years 10 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
8 years 11 months ago #274013 by krileon
The below example action can be used to do as you're wanting.

Global
Type: Registration
Triggers: None
User: Automatic
Access: Everybody
Action
Username: [get_username]
Password: (empty, it'll generate one)
Email: [get_email]
Groups: Registered
First Name: [get_name]

After saving under the Global tab you'll see the "Internal Action URL" parameter. This is the URL to directly fire the trigger (only works with Triggers set to None). You can then use this to register users view URL. Example as follows.

index.php?option=com_comprofiler&view=pluginclass&plugin=cbautoactions&action=action&actions=ACTION_ID&username=Test&email=test@cb.invalid&name=Test

Note basic sensitization is always done on user input, but you can extend it further using format functions (enabled under Parameters).


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: xengent

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

  • xengent
  • xengent
  • OFFLINE
  • Posts: 54
  • Thanks: 2
  • Karma: 0
8 years 11 months ago #274021 by xengent
Works perfectly. Thank you.

1. I'm guessing that to add custom fields I would select them from the drop-down and put a [get_cb_customfield] in their value?

For example if I want to pass in the custom field cb_companyname , I would select it from the drop-down list and then put [get_cb_companyname] in it's value?

2. How can I validate the URL with a password. For example I want people to be able to access this action without them being logged in, but this of course opens me up to a security risk. Is there a way to have it validated using a password of sorts, so that I can leave the access open, and not have them need to be able to log in?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
8 years 11 months ago - 8 years 11 months ago #274063 by krileon

1. I'm guessing that to add custom fields I would select them from the drop-down and put a [get_cb_customfield] in their value?

For example if I want to pass in the custom field cb_companyname , I would select it from the drop-down list and then put [get_cb_companyname] in it's value?

Yup, or whatever your GET variable name is. The variable could just be &company=COMPANY and you'd substitute it using [get_company].

2. How can I validate the URL with a password. For example I want people to be able to access this action without them being logged in, but this of course opens me up to a security risk. Is there a way to have it validated using a password of sorts, so that I can leave the access open, and not have them need to be able to log in?

Sure, add a password variable to the URL for example as &token=12345. Next in Conditions add a condition as follows.

[get_token] Equal To 12345

This will only allow the action to execute if the token matches.


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.
Last edit: 8 years 11 months ago by krileon.
The following user(s) said Thank You: nant

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

  • xengent
  • xengent
  • OFFLINE
  • Posts: 54
  • Thanks: 2
  • Karma: 0
8 years 11 months ago #274099 by xengent
Works perfectly again. Thank you.

One last question, I'm having trouble setting the values of dropdowns options on profiles via the URL. Is there a special way I need to specify them in the URL?

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

  • xengent
  • xengent
  • OFFLINE
  • Posts: 54
  • Thanks: 2
  • Karma: 0
8 years 11 months ago #274100 by xengent
Got it figured out. I was putting the label instead of the value of the option. All good now. THANK YOU SO MUCH. This will make my life a lot easier.

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

Moderators: beatnantkrileon
Powered by Kunena Forum