cake have a hook method: hashPasswords

<?php
class User extends AppModel {

    var $name = 'User';

    function hashPasswords($data) {
        if (isset($data[$this->name]['password'])) {
            $data[$this->name]['password'] = md5($data[$this->name]
['password']);
        }

        return $data;
    }
}
?>

On Sep 17, 6:43 am, mark <[EMAIL PROTECTED]> wrote:
> I looked around for a solution to removing password hashing in
> AuthComponent, and the closest thing I found was to overwrite the
> password method. It explained it in the section of the manual where it
> talks about changing the hashing type.
>
> http://manual.cakephp.org/view/566/Changing-Encryption-Type
>
> I wasn't sure though how to actually go about doing this. Auth is
> setup in my AppController like so:
> <?php
> class AppController extends Controller {
>         var $name = 'App';
>         var $components = array('Acl', 'Auth');
>         var $publicControllers = array('pages', 'archives', 'mail');
>
>         function beforeFilter() {
>                 if (isset($this->Auth)) {
>                         $this->Auth->loginAction = '/admin/users/login';
>                         $this->Auth->loginRedirect = '/admin/issues';
>                         $this->Auth->authorize = 'actions';
>
>                         // turn off password hashing
>
>                         if (in_array(low($this->params['controller']),
>                                 $this->publicControllers)) {
>                                         $this->Auth->allow();
>                                 }
>                 }
>         }
>
> }
>
> What exactly would I do?
>
> Thank you guys so much!!!!
>
> -Mark
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to