Hello,
I am in a situation where I have to use an external database to check
credential for user.
Is there any right way to do this in the application ini?
I thoughts something like
resources.db2.adapter = // external db adapter
resources.db2.params.host = // external db host
resources.db2.params.username = // external db user
resources.db2.params.password = // external db pass
resources.db2.params.dbname = // external db name
resources.db2.isDefaultTableAdapter = // what am I supposed to put here?
resources.db2.params.charset = UTF8
resources.db2.profiler.enabled = true
Save it in the registry whitin bootstrap
$db2 = // some code
$registry->db2 = $db2;
Use $db2 to check credential in auth controller
$db2 = Zend_Registry::get('db2');
$authAdapter = new Zend_Auth_Adapter_DbTable(
$db2,
$tabUsers,
'username',
'password',
"SHA1(CONCAT('".$salt."',?)) AND status_id = '".$status_id."' "
);
Is that a correct way to do or there is something better?
Thanks in advance for all your advices.
Sergio
_________________________________________________________________
Più spazio per le tue esigenze. Hotmail va oltre i 5GB
http://www.windowslive.it/hotmail/SpazioDisponibile.aspx