Page 1 of 1

Share Frontend Users Between Multiple Sites

Posted: Tue Apr 08, 2008 6:08 pm
by Nullig
If you want to share frontend users among multiple sites, redirect the registration to the main site (originating). Then set up the following crontab job for each site:

Minute: 1,16,31,46
Hour: *
Day of Month: *
Month : *
Day of Week: *

Command:
/usr/bin/mysqldump -h -u -p --quick --add-drop-table --add-locks --lock-tables --tables cms_module_feusers_belongs cms_module_feusers_dropdowns cms_module_feusers_grouppropmap cms_module_feusers_groups cms_module_feusers_groups_seq cms_module_feusers_propdefn cms_module_feusers_properties cms_module_feusers_properties_seq cms_module_feusers_tempcode cms_module_feusers_users cms_module_feusers_users_seq | mysql -h -u -p

This example will run the job every 15 minutes and synch the feusers tables between 2 sites.

Notes:
- This will work between different servers.
- You may need to change the path to mysqldump, depending on your setup.
- Replace the entries in with your specific database info.
- Replace the "cms_" table prefixes with your table prefixes.
- The command must be a single line.

Nullig

Re: Share Frontend Users Between Multiple Sites

Posted: Wed Apr 09, 2008 6:16 pm
by Pierre M.
Hello,

interesting, thx.

Some (humble) improvements suggestions for the future :
-use a parameter for the cms_ prefix.
-use another one to contain "module_feusers" to shorten the line.
-refine the SQL query to extract and import only the new entries (the ones from the last successfull import). Or doesn't it work this way already ?

Pierre M.

Re: Share Frontend Users Between Multiple Sites

Posted: Wed Apr 09, 2008 6:31 pm
by Nullig
This is strictly a crontab entry, not php code.

I suppose a module could be built using this as the basis.

Nullig

Re: Share Frontend Users Between Multiple Sites

Posted: Fri Apr 11, 2008 12:08 pm
by ameagher
Hi Nullig,

This is a nice workaround!

However, for some people using shared hosting, and even vps accounts their isp will not allow them to run cron jobs more than once an hour.

Has anyone looked at openid for this within cmsms?

Cheers,
Anthony

Re: Share Frontend Users Between Multiple Sites

Posted: Mon Apr 14, 2008 1:34 pm
by Pierre M.
Hello Anthony,
ameagher wrote: Has anyone looked at openid for this within cmsms?
What do you mean ? I don't see the relationship between crontabs and openid.

Pierre M.

Re: Share Frontend Users Between Multiple Sites

Posted: Fri Apr 18, 2008 8:26 am
by ameagher
Pierre,

Sorry for not replying to your message quicker!

Quoting someone else (http://www.barnraiser.org/index.php?wp= ... penIDintro) about OpenID:
"What is OpenID?
OpenID gives you a way to login to many websites using a single identity with a single password. You control what identity information you give to the website and you control which websites you trust and which you don't - OpenID puts you in control with a single password to remember." - Simpler and more eloquent than I would have put it ;)

Some other cms are making use of it through modules e.g. Drupal.

It has no direct relationship to cron jobs as such! I was just asking if anybody had considered implementing it for cmsms?

The reason I made mention of the cron jobs is that some hosting companies prohibit/restrict end user use of regular cron jobs (i.e. less than hourly for example, so they may not be generally usable to control frontend logins across multiple sites if they need to be run very frequently.

Anthony

Re: Share Frontend Users Between Multiple Sites

Posted: Fri Apr 18, 2008 8:37 am
by cubix
cms 2.0 has openid support, however, whether it will be implemented for the frontend, i dont know.