Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!$user_ID){
- if(isset($_POST['op_classiera']) ){
- if($_POST['submit'] == 'Reset'){
- // First, make sure the email address is set
- if ( isset( $_POST['email'] ) && ! empty( $_POST['email'] ) ) {
- // Next, sanitize the data
- $email_addr = trim( strip_tags( stripslashes( $_POST['email'] ) ) );
- $user = get_user_by( 'email', $email_addr );
- $user_ID = $user->ID;
- if( !empty($user_ID)) {
- $new_password = wp_generate_password( 12, false );
- if ( isset($new_password) ) {
- wp_set_password( $new_password, $user_ID );
- $message = "Check your email for new password.";
- $from = get_option('admin_email');
- $headers = 'From: '.$from . "rn";
- $subject = "Password reset!";
- $msg = "Reset password.nYour login detailsnNew Password: $new_password";
- wp_mail( $email_addr, $subject, $msg, $headers );
- $resetSuccess = 1;
- }
- } else {
- $message = "There is no user available for this email.";
- } // end if/else
- } else {
- $message = "Email should not be empty.";
- }
- }
Add Comment
Please, Sign In to add comment