[Solar-talk] Working with hashes (MD5) and column updates

Rodrigo Moraes rodrigo.moraes at gmail.com
Wed Jan 2 15:43:11 CST 2008


On Jan 1, 2008 2:15 PM, Raymond Kolbe wrote:
> I noticed that Tipos has encountered the same hash filter issue I have as I
> see a commented line in your model for your hash filter ;-)

Oh, I tried it after our IRC talks, but gave up to continue using what
I was using before, which is...

In the model:

        $this->_calculate_cols[] = 'passwd_confirm';
        $this->_addFilter('passwd', 'validateConfirm');

In the controller:

        $data = $request->post('user', array());

        if (! empty($data['passwd']) && !empty($data['passwd_confirm'])) {
            // Force hashed values for password comparison.
            $data['passwd'] = hash('md5', $data['passwd']);
            $data['passwd_confirm'] = hash('md5', $data['passwd_confirm']);
        }

No validateHash(), only the code above. It works fine for me.

-- rodrigo


More information about the Solar-talk mailing list