开发者

How to add credential column in authentication adepter using ZF

My开发者_运维知识库 auth adapter is like below

 $authAdapter->setTableName('register')
                        ->setIdentityColumn('username')
                        ->setCredentialColumn('pwd');

It's working fine :

but now i want to check status column active/inactive also.

How can we add one more credential column here ?


You could use setCredentialTreatment() method

$authAdapter->setTableName('register')
            ->setIdentityColumn('username')
            ->setCredentialColumn('pwd')
            ->setCredentialTreatment('? AND status = "active"');


$select = $authAdapter->getDbSelect();
$select->where('status = "active"');
$authAdapter->authenticate();

Have a look at the documentation, under the Advanced Usage By Example heading.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜