mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- make WP native password reset;
- fixed password reset;
This commit is contained in:
@@ -1135,15 +1135,6 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set user's hash for password reset
|
||||
*/
|
||||
function password_reset_hash() {
|
||||
$this->profile['reset_pass_hash'] = UM()->validation()->generate();
|
||||
$this->update_usermeta_info('reset_pass_hash');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set user's hash
|
||||
*/
|
||||
@@ -1194,7 +1185,8 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
* Password reset email
|
||||
*/
|
||||
function password_reset() {
|
||||
$this->password_reset_hash();
|
||||
$userdata = get_userdata( um_user('ID') );
|
||||
get_password_reset_key( $userdata );
|
||||
UM()->mail()->send( um_user('user_email'), 'resetpw_email' );
|
||||
}
|
||||
|
||||
@@ -1227,11 +1219,13 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
delete_option( "um_cache_userdata_{$user_id}" );
|
||||
|
||||
if ( um_user('account_status') == 'awaiting_admin_review' ) {
|
||||
$this->password_reset_hash();
|
||||
$userdata = get_userdata( $user_id );
|
||||
get_password_reset_key( $userdata );
|
||||
UM()->mail()->send( um_user('user_email'), 'approved_email' );
|
||||
|
||||
} else {
|
||||
$this->password_reset_hash();
|
||||
$userdata = get_userdata( $user_id );
|
||||
get_password_reset_key( $userdata );
|
||||
UM()->mail()->send( um_user('user_email'), 'welcome_email');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user