Yii Framework Forum: Multiple Database Selection Based On Url - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Multiple Database Selection Based On Url Rate Topic: -----

#1 User is offline   candyman 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 22-December 13

Posted 09 June 2014 - 10:09 AM

Hi,

I am developing an application that is used by many users.Each user of the application has separate database. Currently I am using http://www.yiiframew...ser-id-dynamic/ to achieve this. Now, each user of the application has its own sub users.How can I make the application to use a single login screen for the users.Is it possible to change the database connection based on the url? Please help.
0

#2 User is offline   Paul G. 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 24-April 09
  • Location:Molde, Norway

Posted 11 June 2014 - 02:45 AM

View Postcandyman, on 09 June 2014 - 10:09 AM, said:

I am developing an application that is used by many users.Each user of the application has separate database. Currently I am using http://www.yiiframew...ser-id-dynamic/ to achieve this. Now, each user of the application has its own sub users.How can I make the application to use a single login screen for the users.Is it possible to change the database connection based on the url? Please help.

So the users are going to authenticate against one of the databases, so you need something in the URL to tell you which database to authenticate against?


I have some applications where different users have their own subdomain, and i detect subdomain in index.php and use it to select the right config file. In your case you could detect subdomain and do some kind of selection of database.


Yii fan from Norway
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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