Yii Framework Forum: Using a module specific database for access control - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Using a module specific database for access control Trouble with module specific models Rate Topic: -----

#1 User is offline   Jason George 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 30-December 09

Posted 14 January 2012 - 02:53 PM

I've asked this same question at stackoverflow here (as that's become my goto site for community support), but this is such a specific question the Yii forum might be a more appropriate venue.

I'm trying to set up a separate module for a special set users on my site. I'd like to store those users in a separate database and use a separate authentication for them. Where I'm having trouble is on user authentication. The module is using a module specific user identity class which works, but both my site database and my module database have Account tables (for authentication) and the module is using my site Account model as opposed to my module Account model. Is there any way I can convince the modules to select my module Account model?
0

#2 User is offline   Ivica 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 317
  • Joined: 25-May 11

Posted 20 January 2012 - 04:13 AM

Using two databases with yii can be a bit tricky:
http://www.yiiframew...support-in-yii/
The problem is that ActiveRecord by default is using default db connection from config file, so you will need to override few things.
To be more precisious, you will need to extend CWebUser, and to check two cases, when user access User module, and all other modules.

But I think you should look for simpler acceptable solution if possible.
Zurmo: Yii Powered Open Source CRM
zurmo.org
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users