Hi, I'm building a cake app that need to authentify agains a legacy
database. That database has a user table with users login and password data,
but the password is encrypted with MySQL's aes_encrypt. Looking at cake Auth
mechanism there is no way I can auth against this table, so I'm wondering if
I can hook some method to the auth process like this:
function check_credentials($login, $passwd) {
$data = $this->User->query(sprintf("SELECT * FROM users WHERE
username='%s' AND passwd=aes_decrypt('%s') ", $login, $passwd);
if(sizeof($data) > 0) {
return true; // The username and passwd are valid
} else {
return false; // The username or passwd are invalid
}
}
I know this is not the best way to do it, but maybe the easiest way. Can I
something like this? or wath other options do I have? Thanks in advance!
--
Mauricio Tellez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---