I want my 'users' table in my database to contain users of all different levels (members, moderators, admins, etc). So a column in my 'users' table is role. I want to be able to check the role to see if they have permission to log in to special parts of the application. How can I do this? Here is my auth adapter so far:
protected function _getAuthAdapter($formData)
{
$dbAdapter = Zend_Db_Table::getDefaultAdapter();
$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
$authAdapter->setTableName('users');
$authAdapter->setIdentityColumn('username');
$authAdapter->setCredentialColumn('password');
$authAdapter->setIdentity($formData['username']);
$authAdapter->setCredential(md5($formData['password']));
return $authAdapter;
}
If you’re not wanting to use Zend_Acl for this yet, try this:
You can see that you can use getDbSelect() to get the actual Zend_Db_Select object that Zend_Auth is using and modify it as needed.