footer.php
5 years ago
header.php
2 years ago
loginAfterRestore.php
2 years ago
loginForm.php
2 years ago
wordfence-2fa.php
2 years ago
loginForm.php
74 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Login form template |
| 4 | * |
| 5 | * @var bool $showNotice |
| 6 | * @var string $notice |
| 7 | * @var array $args |
| 8 | * @var bool $isCustomLogin2faEnabled |
| 9 | */ |
| 10 | |
| 11 | /* When 'wpstg_user_logged_in_status' is true, it means the credentials are correct, but login might be blocked by a security plugin or active OTP or 2FA authentication */ |
| 12 | $isLoginCredentialsVerified = get_transient('wpstg_user_logged_in_status'); |
| 13 | ?> |
| 14 | <main class="wp-staging-login" > |
| 15 | <div class="wpstg-text-center"> |
| 16 | <img width="220" src="<?php echo esc_url(apply_filters('wpstg_login_form_logo', WPSTG_PLUGIN_URL . 'assets/img/logo.svg')); ?>" alt="WP Staging Login" /> |
| 17 | </div> |
| 18 | <form class="wp-staging-form" name="<?php echo esc_attr($args['form_id']); ?>" id="<?php echo esc_attr($args['form_id']); ?>" action="" method="post"> |
| 19 | <?php if ($showNotice) { ?> |
| 20 | <div class="wpstg-alert wpstg-alert-info wpstg-text-justify"> |
| 21 | <p><?php echo esc_html($notice); ?></p> |
| 22 | </div> |
| 23 | <?php } ?> |
| 24 | <div class="form-group login-username"> |
| 25 | <label for="<?php echo esc_attr($args['id_username']); ?>"><?php echo esc_html($args['label_username']); ?></label> |
| 26 | <input type="text" name="wpstg-username" id="<?php echo esc_attr($args['id_username']); ?>" class="input form-control" value="<?php echo esc_attr($args['value_username']); ?>" size="20" /> |
| 27 | </div> |
| 28 | <div class="form-group login-password"> |
| 29 | <label for="<?php echo esc_attr($args['id_password']); ?>"><?php echo esc_html($args['label_password']); ?></label> |
| 30 | <input type="password" name="wpstg-pass" id="<?php echo esc_attr($args['id_password']); ?>" class="input form-control" value="" size="20" /> |
| 31 | </div> |
| 32 | |
| 33 | <?php if ($args['remember']) { ?> |
| 34 | <div class="form-group login-remember"><label><input name="rememberme" type="checkbox" id="<?php echo esc_attr($args['id_remember']); ?>" value="forever"<?php echo ( $args['value_remember'] ? ' checked="checked"' : '' ); ?> /> <span><?php echo esc_html($args['label_remember']); ?></span></label></div> |
| 35 | <?php } ?> |
| 36 | |
| 37 | <div class="login-submit"> |
| 38 | <button type="submit" name="wpstg-submit" id="<?php echo esc_attr($args['id_submit']); ?>" class="btn" value="<?php echo esc_attr($args['label_log_in']); ?>"><?php esc_html_e('Login', 'wp-staging') ?></button> |
| 39 | <input type="hidden" name="redirect_to" value="<?php echo esc_url($args['redirect']); ?>" /> |
| 40 | </div> |
| 41 | <?php if (!$isLoginCredentialsVerified) : ?> |
| 42 | <p class="wpstg-default-login-link"> |
| 43 | <?php |
| 44 | echo sprintf( |
| 45 | esc_html__('If login is not possible, please use the %s.', 'wp-staging'), |
| 46 | '<a href="' . esc_url(wp_login_url()) . '">' . esc_html__('default login form', 'wp-staging') . '</a>' |
| 47 | ); |
| 48 | ?> |
| 49 | </p> |
| 50 | <?php endif;?> |
| 51 | <?php if ($isLoginCredentialsVerified) : ?> |
| 52 | <p class="error-msg"> |
| 53 | <?php |
| 54 | echo sprintf( |
| 55 | esc_html__('Login not possible! it might happen due to using a security plugin, having OTP or 2FA authentication active, Please use the %s instead.', 'wp-staging'), |
| 56 | '<a href="' . esc_url(wp_login_url()) . '">' . esc_html__('default login form', 'wp-staging') . '</a>' |
| 57 | ); |
| 58 | ?> |
| 59 | </p> |
| 60 | <?php endif;?> |
| 61 | <div class="password-lost"> |
| 62 | <a href="<?php echo esc_url($args['lost_password_url']); ?>"><?php esc_html_e('Lost your password?', 'wp-staging') ?></a> |
| 63 | </div> |
| 64 | |
| 65 | <p class="error-msg"> |
| 66 | <?php echo wp_kses_post($this->error); ?> |
| 67 | </p> |
| 68 | <?php |
| 69 | if ($isCustomLogin2faEnabled) { |
| 70 | include_once(trailingslashit(WPSTG_PLUGIN_DIR) . 'Frontend/views/wordfence-2fa.php'); |
| 71 | } |
| 72 | ?> |
| 73 | </form> |
| 74 | </main> |