/** * Function that creates a generate new password form * * @param array $post_data $_POST * */ function wppb_create_recover_password_form($user, $post_data) { ?> <form enctype="multipart/form-data" method="post" id="wppb-recover-password" class="wppb-user-forms" action="<?php echo esc_url(add_query_arg('finalAction', 'yes', wppb_curpageurl())); ?> "> <ul> <?php if (!empty($post_data['passw1'])) { $passw_one = $post_data['passw1']; } else { $passw_one = ''; } if (!empty($post_data['passw2'])) { $passw_two = $post_data['passw2']; } else { $passw_two = ''; } $recover_inputPassword = '******' . __('Password', 'profile-builder') . '</label> <input class="password" name="passw1" type="password" id="passw1" value="' . $passw_one . '" autocomplete="off" title="' . wppb_password_length_text() . '"/> </li><!-- .passw1 --> <input type="hidden" name="userData" value="' . $user->ID . '"/> <li class="wppb-form-field passw2"> <label for="passw2">' . __('Repeat Password', 'profile-builder') . '</label> <input class="password" name="passw2" type="password" id="passw2" value="' . $passw_two . '" autocomplete="off" /> </li><!-- .passw2 -->'; /* if we have active the password strength checker */ $recover_inputPassword .= wppb_password_strength_checker_html(); echo apply_filters('wppb_recover_password_form_input', $recover_inputPassword, $passw_one, $passw_two, $user->ID); ?> </ul> <p class="form-submit"> <?php $button_name = __('Reset Password', 'profile-builder'); ?> <input name="recover_password2" type="submit" id="wppb-recover-password-button" class="submit button" value="<?php echo apply_filters('wppb_recover_password_button_name1', $button_name); ?> " /> <input name="action2" type="hidden" id="action2" value="recover_password2" /> </p><!-- .form-submit --> <?php wp_nonce_field('verify_true_password_recovery2_' . $user->ID, 'password_recovery_nonce_field2'); ?> </form><!-- #recover_password --> <?php }
function wppb_password_handler($output, $form_location, $field, $user_id, $field_check_errors, $request_data) { $item_title = apply_filters('wppb_' . $form_location . '_password_item_title', wppb_icl_t('plugin profile-builder-pro', 'default_field_' . $field['id'] . '_title_translation', $field['field-title'])); $item_description = wppb_icl_t('plugin profile-builder-pro', 'default_field_' . $field['id'] . '_description_translation', $field['description']); if ($form_location != 'back_end') { $error_mark = $field['required'] == 'Yes' ? '<span class="wppb-required" title="' . wppb_required_field_error($field["field-title"]) . '">*</span>' : ''; if (array_key_exists($field['id'], $field_check_errors)) { $error_mark = '<img src="' . WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . wppb_required_field_error($field["field-title"]) . '"/>'; } $output = ' <label for="passw1">' . $item_title . $error_mark . '</label> <input class="text-input" name="passw1" maxlength="' . apply_filters('wppb_maximum_character_length', 70) . '" type="password" id="passw1" value="" autocomplete="off" />'; if (!empty($item_description)) { $output .= '<span class="wppb-description-delimiter">' . $item_description . ' ' . wppb_password_length_text() . '</span>'; } else { $output .= '<span class="wppb-description-delimiter">' . wppb_password_length_text() . '</span>'; } /* if we have active the password strength checker */ $output .= wppb_password_strength_checker_html(); } return apply_filters('wppb_' . $form_location . '_password', $output, $form_location, $field, $user_id, $field_check_errors, $request_data); }