upskill-event-manager/templates/community/login-form.php
bengizmo 4d986714b6
Some checks are pending
HVAC Plugin CI/CD Pipeline / Security Analysis (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Code Quality & Standards (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Unit Tests (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Integration Tests (push) Waiting to run
HVAC Plugin CI/CD Pipeline / Deploy to Staging (push) Blocked by required conditions
HVAC Plugin CI/CD Pipeline / Deploy to Production (push) Blocked by required conditions
HVAC Plugin CI/CD Pipeline / Notification (push) Blocked by required conditions
Security Monitoring & Compliance / Dependency Vulnerability Scan (push) Waiting to run
Security Monitoring & Compliance / Secrets & Credential Scan (push) Waiting to run
Security Monitoring & Compliance / WordPress Security Analysis (push) Waiting to run
Security Monitoring & Compliance / Static Code Security Analysis (push) Waiting to run
Security Monitoring & Compliance / Security Compliance Validation (push) Waiting to run
Security Monitoring & Compliance / Security Summary Report (push) Blocked by required conditions
Security Monitoring & Compliance / Security Team Notification (push) Blocked by required conditions
fix(login): Point register link to trainer registration page
Co-Authored-By: Ben Reed <ben@tealmaker.com>
2026-02-20 12:23:22 -04:00

104 lines
No EOL
4.2 KiB
PHP

<?php
/**
* HVAC Community Events: Custom Login Form Template
*
* This template provides the structure for the custom login page,
* integrating with the Astra theme's styling.
*
* @version 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Get Astra theme layout settings if needed, e.g., container width
// $container_class = astra_get_content_layout(); // Example
?>
<div class="hvac-community-login-wrapper"> <?php // Custom wrapper for potential styling ?>
<div class="ast-container"> <?php // Astra theme container ?>
<div class="hvac-login-form-card"> <?php // Card styling based on design reference ?>
<div class="hvac-login-form-header">
<h2><?php esc_html_e('Trainer Login', 'hvac-community-events'); ?></h2>
<p><?php esc_html_e('Sign in to access your trainer dashboard', 'hvac-community-events'); ?></p>
</div>
<?php
// Display login errors if any
if ( isset( $_GET['login'] ) && $_GET['login'] === 'failed' ) {
echo '<div class="login-error">Invalid username or password. Please try again.</div>';
}
if ( isset( $_GET['loggedout'] ) && $_GET['loggedout'] === 'true' ) {
echo '<div class="login-success">You have been successfully logged out.</div>';
}
?>
<?php
// Custom login form with password show/hide toggle
$redirect_to = isset($_REQUEST['redirect_to']) ? esc_url($_REQUEST['redirect_to']) : '';
?>
<form name="hvac_community_loginform" id="hvac_community_loginform" action="<?php echo esc_url(site_url('wp-login.php', 'login_post')); ?>" method="post" class="hvac-login-form">
<div class="hvac-login-form-group">
<label for="user_login" class="hvac-login-form-label">
<?php esc_html_e('Username or Email Address', 'hvac-community-events'); ?>
</label>
<div class="hvac-input-group">
<input type="text" name="log" id="user_login" class="hvac-login-form-input" value="" size="20" autocapitalize="off" autocomplete="username" required />
<span class="hvac-input-icon">👤</span>
</div>
</div>
<div class="hvac-login-form-group">
<label for="user_pass" class="hvac-login-form-label">
<?php esc_html_e('Password', 'hvac-community-events'); ?>
</label>
<div class="hvac-input-group hvac-password-group">
<input type="password" name="pwd" id="user_pass" class="hvac-login-form-input hvac-password-input" value="" size="20" autocomplete="current-password" required />
<span class="hvac-input-icon">🔒</span>
<button type="button" class="hvac-password-toggle" aria-label="<?php esc_attr_e('Show password', 'hvac-community-events'); ?>">
<span class="hvac-password-toggle-icon">👁️</span>
</button>
</div>
</div>
<div class="hvac-remember-group">
<input name="rememberme" type="checkbox" id="rememberme" value="forever" class="hvac-remember-checkbox" />
<label for="rememberme" class="hvac-remember-label">
<?php esc_html_e('Remember Me', 'hvac-community-events'); ?>
</label>
</div>
<?php if (!empty($redirect_to)): ?>
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
<?php endif; ?>
<!-- Add hidden field to identify this as coming from custom login page -->
<input type="hidden" name="hvac_custom_login" value="1" />
<?php wp_nonce_field('hvac_login', 'hvac_login_nonce'); ?>
<button type="submit" name="wp-submit" id="wp-submit" class="hvac-login-submit">
<span class="hvac-login-submit-text"><?php esc_html_e('Log In', 'hvac-community-events'); ?></span>
<span class="hvac-login-spinner" style="display: none;"></span>
</button>
</form>
<div class="hvac-login-links">
<?php if ( get_option( 'users_can_register' ) ) : ?>
<a class="hvac-register-link" href="<?php echo esc_url( home_url( '/trainer/registration/' ) ); ?>">
<?php esc_html_e( 'Register', 'hvac-community-events' ); ?>
</a> |
<?php endif; ?>
<a class="hvac-lostpassword-link" href="<?php echo esc_url( wp_lostpassword_url() ); ?>">
<?php esc_html_e( 'Lost your password?', 'hvac-community-events' ); // Task 2.4 ?>
</a>
</div>
</div> <?php // .hvac-login-form-card ?>
</div> <?php // .ast-container ?>
</div> <?php // .hvac-community-login-wrapper ?>