Authentication fails in Zend for account confirmation -



Authentication fails in Zend for account confirmation -

i stuck problem. when login credentials authenticated in zend application , want check if business relationship has been confirmed or not. confirmed boolean column in business relationship table , set false default. trying accomplish through next code..but not working

$db = zend_db_table::getdefaultadapter(); $authadapter = new zend_auth_adapter_dbtable($db); $authadapter->settablename('account'); $authadapter->setidentitycolumn('email'); $authadapter->setcredentialcolumn('password'); $authadapter->setcredentialtreatment('confirmed = 1'); $authadapter->setidentity($data['email']); $authadapter->setcredential($data['password']); $auth = zend_auth::getinstance(); $result = $auth->authenticate($authadapter); if ($result->isvalid()) { if ($data['public'] == "1") { zend_session::rememberme(zend_registry::getinstance()->constants->sessiontime); } else { zend_session::forgetme(); } homecoming true; } else { homecoming false; }

despite business relationship not confirmed authentication passes. please tell me wrong

the credential treatment parameter specifies how password should checked. can override add together additional clauses, still need include password bit. wouldn't have expected method authenticate users, may not main issue, try:

$authadapter->setcredentialtreatment('md5(?) , confirmed = 1');

changing md5 bit passwords encrypted. should generate query along lines of:

... email = 'xxx' , password = md5(?) , confirmed = 1

zend-framework

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -