Hi Stephen,

I checked on your codes, thanks.

But I tried Auth earlier and I had to include this:

var $components = array('Auth');

---------------

         function beforeFilter()
                {
                        parent::beforeFilter();
                        this->Auth->autoRedirect = false;


                }
------------------
The password field would be automatically filled if left blank. I was
reading solutions from the net couldn't find one for this yet..

it's 2:08AM have a morning meeting later. See you guys tomorrow,
thanks for the replies !





On Dec 22, 1:42 am, John Maxim <[email protected]> wrote:
> Hi,
>
> the controller register function code is here:
>
> function register()
>                 {
>                   if (!empty($this->data))
>                   {
>                     $this->data['User']['password'] = md5($this->data['User']
> ['password']);
>
>                         if ($this->User->save($this->data))
>
>                                 {
>                                   $this->Session->setFlash('Your registration 
> information was
> accepted.');
>                                   $this->Session->write('user', 
> $this->data['User']['username']);
>                                   $this->redirect(array('action' => 'index'), 
> null, true);
>
>                                 }else{
>                                 $this->data['User']['password'] = '';
>                 $this->Session->setFlash('There was a problem saving
> this information');
>                                 }
>                         }
>
>                 }
>
> --------------
> I know already some veterans here have suggested Auth but I'm in a bit
> rush to complete a milestone and have a meeting, at least something
> going on what I initially started, I'd be using Auth after I fix this
> thing, is Md5 above wrongly used ?
>
> Does it affect my validation model code ? Why is it always triggered
> even though the same passwords for both fields are entered ?
>
> Thanks, guys..
>
> On Dec 22, 1:22 am, Stephen <[email protected]> wrote:
>
> > Maybe this will help
>
> >http://pastie.org/private/cku2m7kpvmfd7pub3q24ga
>
> > On 21 December 2010 17:19, Ryan Schmidt <[email protected]> wrote:
>
> > > On Dec 21, 2010, at 11:13, John Maxim wrote:
>
> > > > By the way I'm using md5 in controller for register function, could
> > > > that be that reason that hinders the validation?
>
> > > *How* are you "using md5"? If you mean you have specified md5 as the hash
> > > algorithm for the security class by writing "Security::setHash('md5');" in
> > > your config file, and you are using Security::hash() every time you want 
> > > to
> > > hash a password, then that should be fine. If you mean something else, 
> > > that
> > > might not be fine.
>
> > >http://book.cakephp.org/view/1254/Change-Hash-Function
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> > > with their CakePHP related questions.
>
> > > 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]<cake-php%[email protected]>For
> > >  more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en
>
> > --
> > Kind Regards
> >  Stephen @ NinjaCoderMonkey
>
> >  www.ninjacodermonkey.co.uk

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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