You can do that easily enough by overriding the find method in User
and/or adding a hook to afterFind or beforeFind.
function beforeFind($query){
if ( you think this is a login "find" ) {
if ($this->nisAuthenticate($uname,$pass)) {
return $modified_query_to_find_local_userdata
} else {
query['conditions'] = array('1=0');
}
}
return $query; // normal find
}
You need to figure out how to determine that the find is for
authentication. You might get away with just checking if the
conditions contain both a username and password fields.
You will probably also want to set your own "hashPasswords" since your
NIS probably doesn't like Cake's salted hashes.
/Martin
On Mar 20, 6:38 pm, iFeghali <[email protected]> wrote:
> Ok just took a look again at Auth source code. $authorize is not
> useful for me for the reason said in the last email. $authenticate is
> used only for the hashPasswords() method so its not helpful in my case
> too. Perhaps I am looking for a way of changing the method
> Auth::identify() but I don't want to extend the controller. Maybe
> there is a way to achieve that goal modifying the user model only ?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---