| @@ -1,63 +1,50 @@ | ||
| 1 | -<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> | |
| 1 | +<?php if (!defined('ABSPATH')) { exit;} // Exit if accessed directly ?> | |
| 2 | +<?php | |
| 3 | +/** @var array $settings @var array $defaults @var array $hiddenFields @var string $redirect */ | |
| 4 | +$fluentCommunitySettings = $settings ?? []; | |
| 5 | +$fluentCommunityDefaults = $defaults ?? []; | |
| 6 | +$fluentCommunityHiddenFields = $hiddenFields ?? []; | |
| 7 | +$fluentCommunityRedirect = $redirect ?? ''; | |
| 8 | +?> | |
| 2 | 9 | <div id="fcom_user_onboard_wrap" class="fcom_user_onboard"> |
| 10 | + <?php do_action('fluent_community/before_auth_form_header', 'login'); ?> | |
| 3 | 11 | <div class="fcom_onboard_header"> |
| 4 | 12 | <div class="fcom_onboard_header_title"> |
| 5 | - <h2><?php echo esc_html($title); ?></h2> | |
| 6 | - <p><?php echo esc_html($description); ?></p> | |
| 13 | + <h2> | |
| 14 | + <?php echo esc_html($fluentCommunitySettings['title']); ?> | |
| 15 | + </h2> | |
| 16 | + <p> | |
| 17 | + <?php echo wp_kses_post($fluentCommunitySettings['description']); ?> | |
| 18 | + </p> | |
| 7 | 19 | </div> |
| 8 | 20 | </div> |
| 9 | 21 | <div class="fcom_onboard_body"> |
| 10 | 22 | <div class="fcom_onboard_form"> |
| 11 | - <form method="post" id="fcom_user_login_form"> | |
| 12 | - <div id="fcom_group_log" class="fcom_form-group"> | |
| 13 | - <input type="hidden" name="action" value="fcom_user_login_form" /> | |
| 14 | - <?php if(!empty($redirect_to)): ?> | |
| 15 | - <input type="hidden" name="redirect_to" value="<?php echo esc_url_raw($redirect_to); ?>" /> | |
| 16 | - <?php endif; ?> | |
| 17 | - <?php foreach ($hiddenFields as $key => $value): ?> | |
| 18 | - <input type="hidden" name="<?php echo esc_attr($key); ?>" value="<?php echo esc_attr($value); ?>" /> | |
| 19 | - <?php endforeach; ?> | |
| 20 | - <div class="fcom_form_label"> | |
| 21 | - <label for="fcom_user_email"> | |
| 22 | - <?php echo _e('Email Address', 'fluent-community'); ?> | |
| 23 | - </label> | |
| 24 | - </div> | |
| 25 | - <div class="fcom_form_input"> | |
| 26 | - <input value="<?php echo esc_attr(\FluentCommunity\Framework\Support\Arr::get($defaults, 'email')); ?>" type="text" id="fcom_user_email" name="log" placeholder="<?php _e('Your account email address', 'fluent-community'); ?>"/> | |
| 27 | - </div> | |
| 28 | - </div> | |
| 29 | - <div id="fcom_group_pwd" class="fcom_form-group"> | |
| 30 | - <div class="fcom_form_label"> | |
| 31 | - <label for="fcom_user_pwd"> | |
| 32 | - <?php echo _e('Password', 'fluent-community'); ?> | |
| 33 | - </label> | |
| 34 | - </div> | |
| 35 | - <div class="fcom_form_input"> | |
| 36 | - <input type="password" id="fcom_user_pwd" name="pwd" placeholder="<?php _e('Your account password', 'fluent-community'); ?>"/> | |
| 37 | - </div> | |
| 38 | - </div> | |
| 39 | - <div class="fcom_form-group"> | |
| 40 | - <div class="fcom_form_input"> | |
| 41 | - <button type="submit" class="fcom_btn fcom_btn_primary"> | |
| 42 | - <?php _e('Login', 'fluent-community'); ?> | |
| 43 | - </button> | |
| 44 | - </div> | |
| 45 | - </div> | |
| 46 | - </form> | |
| 47 | 23 | |
| 24 | + <?php | |
| 25 | + \FluentCommunity\Modules\Auth\AuthHelper::nativeLoginForm([ | |
| 26 | + 'echo' => true, | |
| 27 | + 'form_id' => 'fcom_user_login_form', | |
| 28 | + 'value_remember' => true, | |
| 29 | + 'redirect' => !empty($redirect_to) ? $redirect_to : '', | |
| 30 | + 'value_username' => $fluentCommunityDefaults ? \FluentCommunity\Framework\Support\Arr::get($fluentCommunityDefaults, 'email') : '', | |
| 31 | + 'label_log_in' => $fluentCommunitySettings['button_label'], | |
| 32 | + ], $fluentCommunityHiddenFields); | |
| 33 | + ?> | |
| 34 | + | |
| 48 | 35 | <div class="fcom_spaced_divider"> |
| 49 | 36 | <?php if (!empty($signupUrl)): ?> |
| 50 | 37 | <div class="fcom_alt_auth_text"> |
| 51 | - <?php _e('Don\'t have an account?', 'fluent-community'); ?> | |
| 38 | + <?php esc_html_e('Don\'t have an account?', 'fluent-community'); ?> | |
| 52 | 39 | <a href="<?php echo esc_url($signupUrl); ?>"> |
| 53 | - <?php _e('Signup', 'fluent-community'); ?> | |
| 40 | + <?php esc_html_e('Signup', 'fluent-community'); ?> | |
| 54 | 41 | </a> |
| 55 | 42 | </div> |
| 56 | 43 | <?php endif; ?> |
| 57 | 44 | <p class="fcom_reset_pass_text"> |
| 58 | - <a href="<?php echo wp_lostpassword_url($redirect) ?>"> | |
| 59 | - <?php _e('Lost your password?', 'fluent-community'); ?> | |
| 45 | + <a href="<?php echo esc_url(wp_lostpassword_url($fluentCommunityRedirect)); ?>"> | |
| 46 | + <?php esc_html_e('Lost your password?', 'fluent-community'); ?> | |
| 60 | 47 | </a> |
| 61 | 48 | </p> |
| 62 | 49 | </div> |
| 63 | 50 | </div> |