Skip to Content Skip to Menu

🏖 Summer has arrived! Start your summer right with our summer sale! Get 25% off professional and developer memberships with code SUMMER-2025!

cbautoaction

  • mjl1817
  • mjl1817
  • OFFLINE
  • Posts: 45
  • Thanks: 7
  • Karma: 1
9 years 3 months ago #281324 by mjl1817
cbautoaction was created by mjl1817
Help....

I am, of course, trying to accomplish something cockeyed and failing at it.
I have 50 sites, each using a separate database (all on same server). They share the Joomla users for a single log in on all sites. I cannot use the same CB data as we want each user to be able to set up a unique profile for each site.

Now the problem, syncing all of these users with CB across all fifty sites.. I am certain there is a way to do this via CB auto actions (upon verification) but nothing seems to work. I tried writing it as a cron job but to no avail.
Code:
<?php $server = 'localhost'; $username = 'dbusername_dbname'; $password = 'password'; $database = 'db_name'; $connection = mysql_connect($server,$username,$password); if (!$connection) { die( mysql_error() ); } $db_selection = mysql_select_db($database, $connection); if (!$db_selection) { die( mysql_error() ); } $alltables = mysql_query("SHOW TABLES") or die ( mysql_error() ); while ( $table = mysql_fetch_array($alltables) ) { mysql_query("INSERT IGNORE INTO prefix_comprofiler(id,user_id) SELECT id,id FROM prefix_users") or die( mysql_error() ); } mysql_close($connection); ?>

I use CBautoaction = code conditions = (empty) method = php

I then loop it to each of the databases.. This used to work on syncing someone in CB using joomla 1.5 way back when but now?? Nothing.. Can someone please tell me where I am going wrong?

I wish I knew, Then we would both know.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49427
  • Thanks: 8463
  • Karma: 1465
9 years 2 months ago #281346 by krileon
Replied by krileon on topic cbautoaction
We do not support multisite usage. Primarily because it's a support nightmare and also because Joomla doesn't support in any way. You can try looking to a multisite extension if any are still maintained.

With that said your code won't work because it's not valid for a code action. Do not include the php open and closing tags (<?php and ?>). Enable debug mode and maximum error reporting in Joomla global configuration then enable debugging under parameters within your action to debug your code if it continues to not work.


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

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

  • mjl1817
  • mjl1817
  • OFFLINE
  • Posts: 45
  • Thanks: 7
  • Karma: 1
9 years 2 months ago #281370 by mjl1817
Replied by mjl1817 on topic cbautoaction
I had read in one of the threads that I should not use the autosync feature via cron to accomplish this, however that post was at least 3 or 4 years old. I know autosync would solve this. (I think so anyway). Is there really a big issue with setting up a cron job to run the autosync?

I am using mightysites for the multi-site information but I can't share the cb as it then would not permit a different profile on each site

I wish I knew, Then we would both know.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49427
  • Thanks: 8463
  • Karma: 1465
9 years 2 months ago #281396 by krileon
Replied by krileon on topic cbautoaction
If you mean CB > Tools > Synchronize Users then it has no frontend usage and no CRON endpoint. Regardless it doesn't synchronize from site to site. It just synchronizes users from Joomla to CB that don't exist in CB. It's not usable on frontend unless I guess you tried force loading its controller. You can try the below to see if it'll execute.

Code:
require_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/comprofiler.php' ); syncUsers();

Aside from that I don't know what more to suggest as again we do not support multisite. You'd need to run a CRON for each of your sites to execute the code action that runs syncUsers.


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.

  • mjl1817
  • mjl1817
  • OFFLINE
  • Posts: 45
  • Thanks: 7
  • Karma: 1
9 years 2 months ago #281431 by mjl1817
Replied by mjl1817 on topic cbautoaction
that should work for me.. the only thing shared is the user information and that is done via mightysites component... If I use the autosync on each site it works to add the users into CB and then everything seems to work just fine after that...

Thx, you really have helped me to solve this problem..

I wish I knew, Then we would both know.

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

  • mjl1817
  • mjl1817
  • OFFLINE
  • Posts: 45
  • Thanks: 7
  • Karma: 1
9 years 2 months ago #281807 by mjl1817
Replied by mjl1817 on topic cbautoaction
sadly, it does not seem to execute. I have also noticed that when I manually use the autosync that it works fine except that even with the configuration set to auto confirm and auto approve they are neither confirmed or approved. So even if it worked the approval does not seem to correspond to it.

Is it possible for me to alter the default values directly in the database to get those results? (to auto confirm and auto approve)

I wish I knew, Then we would both know.

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

Moderators: beatnantkrileon
Powered by Kunena Forum