Re: Custom Function Password Match Always Triggered

2010-12-23 Thread John Maxim
Hi Ryan, Thanks for this, it will help in my documentation later. On Dec 23, 2:34 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Dec 21, 2010, at 22:45, John Maxim wrote: Hi Ryan what is a wrapper ? A wrapper is a function that calls another function.

Re: Custom Function Password Match Always Triggered

2010-12-22 Thread Ryan Schmidt
On Dec 21, 2010, at 22:45, John Maxim wrote: Hi Ryan what is a wrapper ? A wrapper is a function that calls another function. http://en.wikipedia.org/wiki/Wrapper_function Does it make it less secure ? but seeing that it has salted added doesn't sound like so. Using a salt makes your

Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
function confirmPassword() { return (($this-data[$this-alias]['password']) == Security::hash($this-data[$this-alias]['confirm_password'], null, true)); } Code 1 function confirmPassword() { $hash

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
By the way I'm using md5 in controller for register function, could that be that reason that hinders the validation? On Dec 22, 12:42 am, John Maxim goog...@gmail.com wrote: function confirmPassword() {                 return (($this-data[$this-alias]['password']) ==                

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread Ryan Schmidt
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

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread Stephen
Maybe this will help http://pastie.org/private/cku2m7kpvmfd7pub3q24ga On 21 December 2010 17:19, Ryan Schmidt google-2...@ryandesign.com 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

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
Hi, the controller register function code is here: function register() { if (!empty($this-data)) { $this-data['User']['password'] = md5($this-data['User'] ['password']); if

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread Ryan Schmidt
On Dec 21, 2010, at 11:42, John Maxim wrote: the controller register function code is here: function register() { if (!empty($this-data)) { $this-data['User']['password'] = md5($this-data['User'] ['password']);

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
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 =

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
Hi Ryan, Thanks I think I get what you're saying, going to change tomorrow, gtg, Thanks ! On Dec 22, 2:02 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Dec 21, 2010, at 11:42, John Maxim wrote: the controller register function code is here: function register()            {    

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread Ryan Schmidt
On Dec 21, 2010, at 12:02, Ryan Schmidt wrote: On Dec 21, 2010, at 11:42, John Maxim wrote: $this-data['User']['password'] = md5($this-data['User']['password']); As I said in my previous message, use Security::hash(). Do not use md5(). If you want Security::hash() to use

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread bujanga
On Tue, Dec 21, 2010 at 2:57 PM, Ryan Schmidt google-2...@ryandesign.com wrote: I should add that Security::hash() does not use the salt unless you tell it to, by passing true in the third parameter. The Auth component does pass true in the third parameter, so if you want to write code today

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
Thanks Ryan, it works nicely. So is it Security::hash() another function to encrypt password such as, md5() ? On Dec 22, 4:57 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Dec 21, 2010, at 12:02, Ryan Schmidt wrote: On Dec 21, 2010, at 11:42, John Maxim wrote:                    

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread Ryan Schmidt
On Dec 21, 2010, at 21:37, John Maxim wrote: So is it Security::hash() another function to encrypt password such as, md5() ? Security::hash() is CakePHP's wrapper around md5, sha1, sha256, and maybe other hash algorithms, with salt added. Check out the new CakePHP Questions site

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
Hi bujanga, Thanks for your complex password validation code, does it solve the problem for auto-fill password value if I used Auth ? On Dec 22, 11:16 am, bujanga buja...@gmail.com wrote: On Tue, Dec 21, 2010 at 2:57 PM, Ryan Schmidt google-2...@ryandesign.com wrote: I should add that

Re: Custom Function Password Match Always Triggered

2010-12-21 Thread John Maxim
Hi Ryan what is a wrapper ? Does it make it less secure ? but seeing that it has salted added doesn't sound like so. On Dec 22, 11:43 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Dec 21, 2010, at 21:37, John Maxim wrote: So is it Security::hash() another function to encrypt password