Skip to Content Skip to Menu

auto generate a field in profile secction

  • regnium
  • regnium
  • OFFLINE
  • Posts: 10
  • Thanks: 1
  • Karma: 0
6 years 3 months ago #305913 by regnium
Hey I've found your plugins and add ons to be quite powerful and I think I can achieve what I'm going for with them, I'm setting up a site that will serve additional content corresponding to certain products, like printables for some books or, videos for certain manuals, so I'm managing the access to these via the ACL, and using the CB auto actions to add the users to the correct group, up to here everything ok, but I need to be able to keep adding the corresponding user to the corresponding ACL group, those I need to have always a field available in their profile for them to be able to input their code and gain access to the content.

Is this possible? Is there any recommendation you could give me to achieve this?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 3 months ago #305936 by krileon
Replied by krileon on topic auto generate a field in profile secction
You want them to input a code to do what? To be validated against a database then give them a usergroup? Please be more specific as to what you're trying to do.

Also you're a Professional subscriber so you've access to priority support forums and have moved your topic to Professional support forums.


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.

  • regnium
  • regnium
  • OFFLINE
  • Posts: 10
  • Thanks: 1
  • Karma: 0
6 years 3 months ago - 6 years 3 months ago #305940 by regnium
Replied by regnium on topic auto generate a field in profile secction
thanks for the quick response, I'm new on this forum and haven't find myself on it yet.

Ok let me explain in more detail, my requirements are to restrict access to users so they can't see the content until they input a code (I'm using a field with querry validation on the user profile in order to make this happen with a db that holds the codes) and the plan is to change the usergroup of the user so they can access the content with cb autoactions, however if theres a way to make this more straight forward I'm open to suggestions, I'm quite a noobie with sql so I hope to make this work.

My doubt right now is if you could give me an example to set the autoactions condition right so I add the user to it's new group properly.
Let me set a use case to make more clear this:

On registration its necessary to assign the user to one of two groups "professor" and "student"
so I created a selection field with each value, and on autoactions I'm checking for one of them in this case for the professor so after registration add them to "professors" usersgroup (I suppose that in case of not comply with the condition the usergroup is left by default)

Later on once the user can acces their user profile page I have a field with the querry validation to check if the code is in the database, and I'm setting up an auto action that checks for the value of the code (every code will have a corresponding user group) so the user is added to given usergroup.

Do you think I'm on the right path or do you have any suggestions?

Please could you give me some examples of the substitutions and the reach of them or the link to them so I can set up the conditions properly?
Last edit: 6 years 3 months ago by regnium. Reason: use cases

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 3 months ago #305952 by krileon
Replied by krileon on topic auto generate a field in profile secction
That should work perfectly fine. You'd create a field to hold your code then validate it against your custom database using CB Query Field and its Query Validation parameters founder under Integrations > CB Query Field when editing your field. If you only need PHP to validate the code you could use CB Code Field.

After that you'd create an auto action using CB Auto Actions that acts on the after user registration (if needed after frontend registration) and after user update (if needed after frontend profile update) triggers. Under conditions you'd condition your code field (e.g. [FIELD_NAME] Is Not Empty). As for the action type you'll want to use Usergroup so you can add/remove/replace usergroups of the user. You'll probably only want this to happen once with each change of the field which you can do using the below conditions in your auto action.

1: [var1_FIELD_NAME] Not Equal To [var3_FIELD_NAME]
2: [FIELD_NAME] Is Not Empty

See the below tutorial for substitution usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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

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

  • regnium
  • regnium
  • OFFLINE
  • Posts: 10
  • Thanks: 1
  • Karma: 0
6 years 3 months ago #305966 by regnium
Replied by regnium on topic auto generate a field in profile secction
Great thanks a lot!! you've been really helpful
Now I have one more question, can I add fields dynamically?

for example in case of a selection field if I select a professor rol the fields for name of the school, the subject and stuff like that are revealed, but if the rol the user selected is for student the registration process ends there.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 3 months ago #305980 by krileon
Replied by krileon on topic auto generate a field in profile secction

for example in case of a selection field if I select a professor rol the fields for name of the school, the subject and stuff like that are revealed, but if the rol the user selected is for student the registration process ends there.

You'll need to pre-create the fields for name, school, and subject within CB > Field Management. Next you'll need to use CB Conditional to show/hide those fields based off the value of your select field.


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum