Login Retreive lost passwordRegister
Search

Forum Index / General / checkPassword()

[ This topic is solved ]

  Arian Stolwijk 24 July 08 / 20:04  
Changed at 25 July 08 / 10:58
I think i've found a bug in the checkPassword() method.

I used it just like in the manual
<?php
// ...
// create 2 passfields 
$form->PassField("Password""password"FH_PASSWORD); 
$form->PassField("Confirm password""re_password"); 

$form->checkPassword("password""re_password");
// ...
?>


and it didn't work, so i looked at the method and i saw it checks if $this->edit is true, but this property is never set unless you use dbFormhandler...

I solved this to add one line of code at the begin of the method:
$this->edit = $setEditMsg;

i don't really know if this 'bug' is already fixed becouse didn't use the newest version of FH, but i didn't saw it in the changelog, so i suppose it isn't changed.

I understand that he checkes if $this->edit is true with the db version. But i don't use the db version and i do have some edit forms where i have to use this method...

  Johan Wiegel (Admin) 24 July 08 / 20:12  
Just tested it with the latest release and it is working as it is.
(No modifications needed)

  Arian Stolwijk 24 July 08 / 20:20  
Strange, i've just downloaded the latest version, and it doesn't work here.

When i leave the fields blank, i get the message: 'De opgegeven waarde is ongeldig!'

He should submit the form.
When i fill two different passwords it works fine, and when i fill in the passwords correctly, it works fine too.

I also don't get the message 'Deze velden alleen invullen als u uw oude wachtwoord wilt wijzigen' while the thirth parameter is true..

  Johan Wiegel (Admin) 24 July 08 / 20:34  
That is what I think it should do, since in a non db formhandler there is no edit mode.

It doesn't allow empty password fields.
Which is correct.

Since there is no editmode you have to program the edit part yourself.

For now I say it works as it should. I will discuss this with my collegue tommorow

  Arian Stolwijk 24 July 08 / 20:47  
Changed at 24 July 08 / 21:58
Oke, i want to use this functionality too if i just create some form, without an edit part or something.

maybe you could create an extra parameter so you can use this always.

For example: when i want to create a form where the password fields are not required, but when the user fills in the password fields, they must be the same.
For example when the user can choose for a password or not.

  Johan Wiegel (Admin) 25 July 08 / 12:21  
We discussed this at PHP-GLOBE HQ and we decided to keep it as it is.

We suggest you write your own validator.

  Top


powered by PHP-GLOBE   © 2004 - 2008 FormHandler. All rights reserved.   -   Open source license