What you can do is add more databases in the yii main,
then add a logic in case you use the login in your page that at the beginning of the session by a parameter determine which database to use,
It occurs to me to have a single database to validate the users and in it you can determine which connection to use, but in the main of yii 1.x it is required to add the connections.
'db1' => array( //db de Calidad
'connectionString' => 'mysql:host=localhost;dbname=db1',
'emulatePrepare' => true,
'username' => 'admin',
'password' => 'admin',
'charset' => 'utf8',
),
'db2' => array( //db de Desarrollo
'connectionString' => 'mysql:host=localhost;dbname=test',
'emulatePrepare' => true,
'username' => 'admin',
'password' => 'admin',
'charset' => 'utf8',
),
I hope it helps you.
Greetings.