Fixed password changed email template

This commit is contained in:
champsupertramp
2016-01-18 20:04:18 +08:00
parent 5e3aa8d713
commit 2827291f95
4 changed files with 36 additions and 7 deletions
+2
View File
@@ -9,6 +9,8 @@
if ( $_POST['user_password'] && $_POST['confirm_user_password'] ) {
$changes['user_pass'] = $_POST['user_password'];
add_filter('send_password_change_email','um_send_password_change_email');
}
foreach( $_POST as $k => $v ) {
+22 -6
View File
@@ -34,14 +34,16 @@
add_action('um_change_password_process_hook','um_change_password_process_hook');
function um_change_password_process_hook( $args ) {
global $ultimatemember;
extract( $args );
wp_set_password( $args['user_password'], $args['user_id'] );
delete_user_meta( $args['user_id'], 'reset_pass_hash');
delete_user_meta( $args['user_id'], 'reset_pass_hash_token');
do_action('um_after_changing_user_password', $args['user_id'] );
if ( is_user_logged_in() ) {
wp_logout();
}
@@ -50,17 +52,31 @@
}
/**
* Overrides password changed notification
*
*/
function um_send_password_change_email( $args ){
global $ultimatemember;
um_fetch_user( $user_id );
$ultimatemember->user->password_changed();
um_reset_user();
return false;
}
/***
*** @This is executed after changing password
***/
add_action('um_after_changing_user_password','um_after_changing_user_password');
function um_after_changing_user_password( $user_id ) {
global $ultimatemember;
um_fetch_user( $user_id );
$ultimatemember->mail->send( um_user('user_email'), 'changedpw_email' );
um_reset_user();
}
/***
+3 -1
View File
@@ -610,7 +610,8 @@ function um_profile_id() {
***/
function um_requesting_password_change() {
global $post, $ultimatemember;
if ( um_is_core_page('password-reset') && isset( $_POST['_um_password_change'] ) == 1 )
if ( um_is_core_page('account') && isset( $_POST['_um_account'] ) == 1 )
return true;
return false;
}
@@ -1353,3 +1354,4 @@ function um_user( $data, $attrs = null ) {
}
}
+9
View File
@@ -434,6 +434,15 @@ class UM_User {
$this->password_reset_hash();
$ultimatemember->mail->send( um_user('user_email'), 'resetpw_email' );
}
/***
*** @password changed email
***/
function password_changed(){
global $ultimatemember;
$ultimatemember->mail->send( um_user('user_email'), 'changedpw_email' );
}
/**
* @function approve()