CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Multi-Site functionality »
  • Drupal 7 Multisite Single Database and common login - site registration
Pages: [1]

Author Topic: Drupal 7 Multisite Single Database and common login - site registration  (Read 5949 times)

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Drupal 7 Multisite Single Database and common login - site registration
March 28, 2012, 03:12:28 am
Hi

I have a Drupal 7 multisite, single database common login set up consisting of a main site and 5 addon sites...but would like if possible individual site registration that allows a common login.

Initially the setup used the single database and allowed individual site registration through CiviContribute but this caused a problem in that having registered through Site_A you couldn't log in to Site_B without having to go through the (Drupal) registration process...this did not work as usernames etc had already been allocated.

Having followed guidelines, can't remember where, I use the following code in settings.php for the main site which is used simply to manage the database;


$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'ehfap957_members',
      'username' => 'myusername',
      'password' => 'mypassword',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => 'ehfa_',
    ),
  ),
);

and for the addon domain;

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'ehfap957_members',
      'username' => 'myusername',
      'password' => 'mypassword',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
    'prefix' => array(
    'default'   => 'fitcon_',
    'users'     => 'ehfa_',
    'sessions'  => 'ehfa_',
    'role'      => 'ehfa_',
    'authmap'   => 'ehfa_',
  ),
    ),
  ),
);

This allows data to be common throughout all sites but registration only works if I force the user to to register through CiviContribute from the main site. The problem with this is that Drupal then sends out an email to the registrant with a link to confirm login which points back to the main site...and I am having problems trying to explain the process to registrants that they have to confirm password in one site, save, log out and then return to the original site. The email also is generic and I can not format it to say welcome to site A and all these wonderful benefits etc.

Ideally I would like a setup that allows a site registration process as follows;

- user registers on Site_A through CiviContribute
- Drupal (Site_A) sends out an email with link back to Site_A
- user confirms password and updates profile in Site_A
- user is then able to login to Site_B with the same username and password

All user data is available for profiles in ALL sites. Access to the individual sites is restricted by roles.

I am not a coder so if anyone can give me any pointers it would be most appreciated.

Cheers

Robbie
YNWA


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Drupal 7 Multisite Single Database and common login - site registration
March 28, 2012, 07:07:26 am

Dont know if CiviCRM handles the below case properly.

An alternative might be to get users to register via the drupal user registration process and then send them to the CiviContribute form.

This is probably a good workaround and allows u to move forward with the site

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Drupal 7 Multisite Single Database and common login - site registration
March 29, 2012, 02:31:40 am
Hi Lobo

Thanks for the quick reply.

Thought of that one but the problem is that if you are registering through Drupal you are selecting a user name and password which as far as I can tell will be site specific removing the ability for members to have access to more than one site using the same details.

Robbie


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Drupal 7 Multisite Single Database and common login - site registration
March 29, 2012, 06:31:35 am

i dont think so. might want to check drupal docs on that.

if you are sharing the user table, the user name/password should be valid for all sites sharing it

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Drupal 7 Multisite Single Database and common login - site registration
April 11, 2012, 08:18:35 am
Terminology is a problem here but

1) If you are creating multiple drupal sites with one drupal DB using drupal domain (drupal.org/projects/domain) module then you will automatically have a shared user table

2) If you are using multiple drupal databases you can share just the user table or you can also share roles and / or permissions.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Multi-Site functionality »
  • Drupal 7 Multisite Single Database and common login - site registration

This forum was archived on 2017-11-26.