I'm still struggling to get Zend_Auth to work.
I understand i need to get a reference to my database adaptor, but i don't
know how to do that. This is my code;
public function getAuthAdapter(array $params)
{
$db = Zend_Registry::get('defaultDb');
$authAdapter = new Zend_Auth_Adapter_DBTable(
$db,
'USERS',
'USERNAME',
'PASSWORD'
);
// Set the input credential values (e.g., from a login form)
$authAdapter->setIdentity($params['username'])
->setCredential($params['password']);
return $authAdapter;
}
It throws an error;
Zend_Exception: No entry is registered for key 'defaultDb'
I also tried the key as being just 'db' but that throws the same error.
Any help apreciated.
Steve
Registered in England & Wales under Registered Number 3872673. Registered
Office Address - Bryggen Road, North Lynn, Industrial Estate, Kings Lynn, Norfolk, PE30 2HZ
Williams Refrigeration reserves the right to block any email attachment we deem inappropriate and to also reject any inbound connections from Blacklisted servers. Any email meeting the above criteria will be automatically rejected without notification given to the original sender.
NOTE: In accordance with the Data Protection Act compliance, all Bulk sends should use the BCC field as much as possible.
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error or are having trouble sending email to Williams please notify the system administrator - postmaster@williams-refrigeration.co.uk
Any views or opinions expressed in this e-mail are those of the sender and do not necessarily coincide with those of Williams Refrigeration or the AFE Group.
没有评论:
发表评论