#7344 closed enhancement (fixed)
Retrieve Password Error Action
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.6.1 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | |
| Focuses: | 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 (1)
Change History (13)
#2
@
18 years ago
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?
#3
@
18 years ago
Oh, I forgot to pass the ID in the example. That can be added as an argument after "true".
#4
@
18 years ago
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
#5
@
18 years ago
adding the following filter would work wonders:
if ( is_wp_error( $allow = apply_filters('allow_password_reset', true, $user_data->ID) ) )
return $allow;
#10
@
18 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
There is a case issue - $user_data->id should be $user_data->ID
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;