Not really...

SELECT 0 = "0" // true
SELECT FALSE = "0" // true
SELECT FALSE = 0 // true

Bruno Friedmann wrote:
Hi
Just a word : be carefull with 0/1 TRUE/FALSE and the type of your column and 
the database used.


I suspect if you write you
$authAdapter = new Zend_Auth_Adapter_DbTable($db, 'Members',
'Email', 'Password', 'AND IsActive != "0"');

AND IsActive != 0

this would work ... :-)
As another advice to be more SQL linguistic I would inverse the " and '
"AND IsActive != '0'")



dele454 wrote:
Am trying to implement a similar scenario where if the column IsActive is set
to '0' the authentication should fail. A typical scenario is when a user
just signed up and still needs to active acct before allowed to gain access.

I followed the instruction in the Ref Guide but it isnt working. If the user
supplies email+password before acct is activated - login is granted.

The only code i didnt implement from the advanced useage example is the
MD5(?) because i have something similar implemented already. Except if it
does something else - i cant loggin with any credentials if i include it
though


                $db= Zend_Registry::get('db');
                $authAdapter = new Zend_Auth_Adapter_DbTable($db, 'Members',
'Email', 'Password', 'AND IsActive != "0"');

$config = Zend_Registry::get('config');
                                $password = $logins['password'];
                                $salt = "$^&##&@";
                                $password = md5($salt.$logins['password']);
                                
                                $authAdapter->setIdentity($logins['email']);
                                $authAdapter->setCredential($password);
                                return $authAdapter;    

Please help is needed thanks :)

-----
dee



Reply via email to