Development

#3231 (change custom `check password` method arguments)

You must first sign up to be able to contribute.

Ticket #3231 (closed task: fixed)

Opened 7 months ago

Last modified 5 months ago

change custom `check password` method arguments

Reported by: a.alexandrov Assigned to: fabien
Priority: minor Milestone:
Component: sfGuardPlugin Version: 1.0.12
Keywords: custom check password Cc:
Qualification: Unreviewed

Description

Hi,

i'm currently struggling with the following task:

I want to change the check password function from the original (<ha> stands for the defined hash algorithm)

$password_stored = <ha>($salt.$password_clean);

to

$password_stored = <ha>($salt.<ha>($password_clean));

The easiest way to do this is to define a custom check password function performing the modified comparison. The problem is that currently custom functions only receive the username and the password as arguments,

call_user_func_array($callable, array($this->getUsername(), $password));

so I need to load the user from the database again in order go get the salt value. It would be much better if you modify the custom function call to:

call_user_func_array($callable, array($this, $password)); // sfGuardUser.php#line 59

The username would still be accessible vie the getter, and so will be the salt and all the other relevant user fields.

Change History

03/29/08 02:09:16 changed by a.alexandrov

  • milestone set to 1.0.13.

I upgraded to the last 1.1.13 version and saw that some refactoring was made.

the line

call_user_func_array($callable, array($this, $password));

Has now moved to PluginsfGuardUser?. Of course, I can now easily override the function im my version of the sfGuardUser.php but I still recommend the change.

Cheers!

03/29/08 08:04:13 changed by fabien

  • milestone deleted.

05/26/08 21:06:40 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [9291]) added the user object as a third parameter when calling the app_sf_guard_plugin_check_password_callable callable (closes #3231)