Ticket #7344 (closed enhancement: fixed)

Opened 5 months ago

Last modified 4 months ago

Retrieve Password Error Action

Reported by: axelseaa Assigned to: ryan
Priority: normal Milestone: 2.6.1
Component: General Version:
Severity: normal Keywords:
Cc:

Description

I am the wpmu ldap plugin author - and I am working on a way to better handle the lost password function. The ldap plugin now supports local and ldap users, so the trick is how to handle the both of them. See the attached patch for my proposed changes. This would then allow me to run the following function:

function ldapRetrievePassword($userID,$pass_error) {

$ldap_login = get_usermeta($userID, 'ldap_login');

if ($ldap_login == true) {

// get the configurable error message: $pass_error = get_site_option('ldapGetPasswordMessage');

}

} add_action('retrieve_password_error', 'ldapRetrievePassword',10,2);

Attachments

wp-login-diff.txt (0.9 kB) - added by axelseaa on 07/18/08 15:29:07.

Change History

07/18/08 15:29:07 changed by axelseaa

  • attachment wp-login-diff.txt added.

07/18/08 18:40:19 changed by ryan

So you want to disabled password reset if the user is using LDAP? How about we add a filter called 'allow_password_reset'?

if ( is_wp_error( $allow = apply_filters('allow_password_reset', true) ) )
   return $allow;

07/18/08 20:09:04 changed by axelseaa

If the user is using ldap, I want to disable the password reset and print out an error message. But if its a local user, they should be allow to continue with the password reset process.

The filter would work if I can get at the current userid from my filter function to check a user meta value, is that possible?

07/18/08 20:11:22 changed by ryan

Oh, I forgot to pass the ID in the example. That can be added as an argument after "true".

07/18/08 20:22:45 changed by axelseaa

Can you show me an example of how I would call such a filter? So far i can't find any documentation, and what I've tried from reading the function declaration is not working correctly

07/21/08 13:38:52 changed by axelseaa

adding the following filter would work wonders:

if ( is_wp_error( $allow = apply_filters('allow_password_reset', true, $user_data->ID) ) ) return $allow;

07/21/08 17:54:06 changed by ryan

  • owner changed from anonymous to ryan.

07/22/08 19:15:43 changed by ryan

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

(In [8400]) Allow disabling password reset per user. Props axelseaa. fixes #7344 for trunk

07/22/08 19:16:10 changed by ryan

(In [8401]) Allow disabling password reset per user. Props axelseaa. fixes #7344 for 2.6

07/22/08 21:49:16 changed by axelseaa

woot! thanks ryan!

07/23/08 13:19:43 changed by axelseaa

  • status changed from closed to reopened.
  • resolution deleted.

There is a case issue - $user_data->id should be $user_data->ID

07/23/08 16:36:11 changed by ryan

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

(In [8411]) Fix case. fixes #7344 for trunk

07/23/08 16:36:37 changed by ryan

(In [8412]) Fix case. fixes #7344 for 2.6