query($wpdb->prepare("UPDATE $wpdb->users SET user_pass='".$newpass."',user_activation_key='' WHERE (user_login='".$usernameemail."' OR user_email='".$usernameemail."') AND user_activation_key='".$kkey."' ")); echo "Your password has been reset.
Log in
"; } if( (isset($_REQUEST['update'])) AND ($_REQUEST['update']=='update')){ $username_email=$_POST['uemail']; $Qry = $wpdb->get_results("SELECT user_login,user_email FROM $wpdb->users WHERE user_login='".$username_email."' OR user_email='".$username_email."'"); if($Qry[0]->user_login != '' && $Qry[0]->user_email != ''){ $email = $Qry[0]->user_email; $user = $Qry[0]->user_login; $homeurll=home_url('/'); $autogenerate_key =crypt($username_email); $wpdb->query($wpdb->prepare("UPDATE $wpdb->users SET user_pass='".$newpass."',user_activation_key='".$autogenerate_key."' WHERE (user_login='".$username_email."' OR user_email='".$username_email."') ")); $mailmsg="Someone requested that the password be reset for the following account:\n$homeurll.\n\nUsername: $user\n\nIf this was a mistake, just ignore this email and nothing will happen.\n\nTo reset your password, visit the following address:\n$homeurll/forgot-password/?action=rp&key=$autogenerate_key&login=$user"; mail($email,'[The Pacifico Partnership] Password Reset',$mailmsg); echo "Check your e-mail for the confirmation link."; }else{ echo "Username or Email is not found."; $notfound="errror"; } } ?>