Skip to Content Skip to Menu

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

CB URL and Subscribers User access level settings

1 year 3 months ago #335042 by Ducatiklubben
We have used CB URL since 2010 to call a procedure in MySQL and it still works fine. Now we need to assign users of a plan to another user group than "Registered". That works fine with "Subscribers User access level settings". But when using "Subscribers User access level settings" the CB URL part doesn't work. If we go back to "No change of user group" the CB URL works fine again. Should it be possible to use both these functions at the same time?

Joomla: 4.3.4
CB: 2.8.1
CBSubs: 4.6.2+build.2023.08.28.17.18.16.905ab5925
PHP: 7.4.33
SQL: MySQLi 10.5.22-MariaDB-cll-lve

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
1 year 3 months ago #335049 by krileon
I assume by CB URL you mean CBSubs URL? That simple calls a URL via HTTP it can't execute SQL so am a bit confused about what you're doing. Setting view access levels shouldn't conflict with other integrations though. Is your SQL querying for their usergroups as maybe the query no longer matches since their usergroups changed?


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.

1 year 3 months ago #335051 by Ducatiklubben
Replied by Ducatiklubben on topic CB URL and Subscribers User access level settings
Sorry for being unclear. CBSubs URL calls a URL to run a php-script ( www.URL.se/xxxx/xxxx/updateuser.php?user_id= [user_id] ). The php-script calls a procedure in MySQL (it checks if username is numeric or not, if not it changes username to highest not used username). This works fine since 2010.

Now we need to assign users of a plan to another user group than "Registered". We use the function "Subscribers User access level settings" (see attached screenshot with red box). This works fine, but the CBSubs URL is then not run. If we go back to "No change of user group" the CBSubs URL works fine again. 

 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
1 year 3 months ago #335061 by krileon
Strange, I can't see any reason for usergroup assignment to interrupt integrations. Do you have any access logs for your script to confirm it's not being called? You can try using the below in CB Auto Actions to let auto actions handle usergroup assignment as well.

Global
Triggers: onCPayUserStateChange
Type: Usergroup
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A
Action
Mode: Add Usergroups
Usergroups: USERGROUP_HERE

I'm not able to confirm usergroup assignment by CBSubs interrupting integrations in my tests. Does your query check against a users usergroups?


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.

1 year 3 months ago #335076 by Ducatiklubben
Replied by Ducatiklubben on topic CB URL and Subscribers User access level settings
Really strange. I've now tried with CB Auto Actions and the change of user group works fine (changed back to "No change of user group" in "Subscribers User access level settings" ), but it still "blocks" part the function of the CBSubs URL. The part in the PHP-script that calls the procedure in MySQL is not run (the part that changes username if not numeric to highest not used username). When I disable the CB Auto Action the PHP-script and the procedure works fine again. Looks like the server is "overloaded" with tasks and misses the procedure part. I tried with sleep(2); in the PHP-script to delay the call of the procedure, but it doesn't help.
If I put the URL ( www.url.se/xxxx/xxxx/updateuser.php?user_id=10600 ) that CBSubs URL uses into a browser the PHP-script and the procedure works fine.
I can't see any difference in the logs of a fail membership (username not changed) or a successful membership (username changed).
Fail 


Successful
 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
1 year 3 months ago #335079 by krileon
It doesn't sound like CBSubs URL is failing. It sounds like something in your PHP script is failing. Is a PHP script really necessary as in what exactly is it doing? It maybe better to move some of that behavior to CB Auto Actions instead.


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