Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Autoaction limit to frontend and direct calls only

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
1 year 2 months ago #335227 by activha
Hello

I cannot retrieve how to condition autoaction so that they would apply only to frontend users and direct calls, but not be applied when users are logged in back end

Mind to remind me ;-)

 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48622
  • Thanks: 8303
  • Karma: 1446
1 year 2 months ago - 1 year 2 months ago #335228 by krileon
Empty the "Triggers" param so it says "None" then set "Allow Direct Access" to "Yes". It's now only used for direct access. There isn't a frontend vs backend for auto actions. They're always executed on the frontend unless they're dependent on a trigger.

There are IF substitutions for determining location if that's what you meant. They are as follows.
Code:
[cb:if application_context="frontend"]Frontend Only[/cb:if] [cb:if application_context="administrator"]Backend Only[/cb:if]

So I guess technically you could have the following condition.

Field: Custom > Value
Custom Value: [cb:if application_context="frontend"]PASS[/cb:if]
Operator: Equal To
Value: PASS


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: 1 year 2 months ago by krileon.
The following user(s) said Thank You: activha

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
1 year 2 months ago #335307 by activha
I have a follow up question :

If I am a mod in frontend and editing another user profile, will [var1_user_id] be this user's id ?

For instance with the trigger onBeforeDeleteUser and the code $userid = $action->string($user, '[var1_user_id]'), is it the mod's id or the edited user's id ?

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48622
  • Thanks: 8303
  • Karma: 1446
1 year 2 months ago #335311 by krileon

If I am a mod in frontend and editing another user profile, will [var1_user_id] be this user's id ?

That'll depend entirely on the trigger.

For instance with the trigger onBeforeDeleteUser and the code $userid = $action->string($user, '[var1_user_id]'), is it the mod's id or the edited user's id ?

For onBeforeDeleteUser [var1_user_id] is the user id of the user being deleted. [user_id] would be the user id of the user deleting the user.


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.

  • activha
  • activha
  • OFFLINE
  • Posts: 2336
  • Thanks: 117
  • Karma: 13
1 year 2 months ago #335551 by activha
Just a quick precision on this one : if there are no triggers in the autoaction, will [var1_user_id] be the user id of the user being edited by a moderator ?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48622
  • Thanks: 8303
  • Karma: 1446
1 year 2 months ago #335558 by krileon
No, what variables are available is purely dependent on the trigger the ran the auto action. So if there's no triggers then there is no var1.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum