1

We currently run 5 or 6 different magento stores as completely separate installations, primary as a result of weird behavior and outright crashes a few years back (pre 1.4) when magento's multistore was not as robust as is now.

On to the question: It's becoming a PITA to synchronize admin users and roles between these different stores, and short of paying out for an LDAP module and trying to integrate that (I've never touched LDAP before in my life), would there be any complications to just syncing the admin_user and admin_role tables at the SQL level?

Or does anyone else happen to know a slick trick to accomplish the same goal?

2

If you want to synchronize the database tables you at least also have to synchronize admin_rule. If you use features like the REST API, you may need to synchronize some more tables (at least api2_acl_user and oauth_token):

Foreign key constraints for the tables admin_role, admin_rule and admin_user

Once you have to sync the api2/oauth tables it may get complicated. I didn't check for further constraints but you can do it with

SELECT
  TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
FROM
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE
  REFERENCED_TABLE_NAME IN ('<table1>', '<table2>', '<table3>')
AND
  CONSTRAINT_SCHEMA = '<magento_database>';

If you only had to create/delete admin users without roles I could suggest to you to use n98-magerun to create and delete admin users in the command line.

| improve this answer | |
  • Thanks, this looks like it'd do what we wanted. However I ended up using Bitium to control access to our different stores. – Caleb Feb 6 '15 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.