How can I programmatically create user in another Drupal site?
The setup: multisite installation, userbase should be partially shared. Both websites have DB credentials setup in the settings.php
file so I can query all tables from either site.
The problem: if I use db_set_active()
to switch the database to the second site, calling user_save()
will invoke all hooks of modules that are installed on the first site, not on the second one. This causes errors if the sites have different modules.
How can I avoid this problem? Any thoughts on workarounds?
Thanks!