dashboard
5 months ago
profile-cards
5 years ago
profile-header
6 months ago
already-logged-in.php
5 months ago
auth-forms.css
5 months ago
auth-forms.min.css
5 months ago
clean.php
5 years ago
login-form.php
5 months ago
lost-password-form.php
5 months ago
members.php
6 months ago
modal-login-form.php
4 days ago
public-profile.php
6 months ago
reg-form.php
4 days ago
reset-password-form.php
5 months ago
review-user-status.php
1 week ago
user-favourites.php
5 years ago
lost-password-form.php
126 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Lost Password Form Template - Split Panel Design |
| 4 | * Modern two-column layout with decorative left panel |
| 5 | */ |
| 6 | |
| 7 | if(!defined("ABSPATH")) die(); |
| 8 | $logo = get_site_icon_url(); |
| 9 | $site_name = get_bloginfo('name'); |
| 10 | |
| 11 | // Enqueue unified auth styles |
| 12 | wp_enqueue_style('wpdm-auth-forms', \WPDM\__\Template::locate_url('auth-forms.css', __DIR__), [], WPDM_VERSION); |
| 13 | ?> |
| 14 | |
| 15 | <div class="w3eden wpdm-auth-page" id="wpdmlostpasspage"> |
| 16 | <div class="wpdm-auth-split"> |
| 17 | <div class="wpdm-auth-panel wpdm-auth-panel--short"> |
| 18 | <!-- Left Panel - Decorative --> |
| 19 | <div class="wpdm-auth-left"> |
| 20 | <div class="wpdm-auth-grid"></div> |
| 21 | <div class="wpdm-auth-circles"> |
| 22 | <div class="wpdm-auth-circle"></div> |
| 23 | <div class="wpdm-auth-circle"></div> |
| 24 | <div class="wpdm-auth-circle"></div> |
| 25 | <div class="wpdm-auth-circle"></div> |
| 26 | </div> |
| 27 | |
| 28 | <div class="wpdm-auth-brand"> |
| 29 | <?php if($logo){ ?> |
| 30 | <img src="<?php echo esc_attr($logo); ?>" alt="<?php echo esc_attr($site_name); ?>" /> |
| 31 | <?php } else { ?> |
| 32 | <div class="wpdm-auth-brand-icon"> |
| 33 | <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg> |
| 34 | </div> |
| 35 | <?php } ?> |
| 36 | <span><?php echo esc_html($site_name); ?></span> |
| 37 | </div> |
| 38 | |
| 39 | <div class="wpdm-auth-welcome"> |
| 40 | <div class="wpdm-auth-welcome-sub"><?php _e("Forgot your password?", "download-manager"); ?></div> |
| 41 | <div class="wpdm-auth-welcome-title"><?php _e("RESET PASSWORD", "download-manager"); ?></div> |
| 42 | <div class="wpdm-auth-welcome-line"></div> |
| 43 | <div class="wpdm-auth-welcome-text"> |
| 44 | <?php _e("No worries! Enter your email address and we'll send you a link to reset your password.", "download-manager"); ?> |
| 45 | </div> |
| 46 | </div> |
| 47 | </div> |
| 48 | |
| 49 | <!-- Right Panel - Form --> |
| 50 | <div class="wpdm-auth-right"> |
| 51 | <div class="wpdm-auth-form-header"> |
| 52 | <h1 class="wpdm-auth-form-title"><?php _e("Reset Password", "download-manager"); ?></h1> |
| 53 | <p class="wpdm-auth-form-desc"><?php _e("Enter your email address below and we'll send you instructions to reset your password.", "download-manager"); ?></p> |
| 54 | </div> |
| 55 | |
| 56 | <form name="resetPassword" id="resetPassword" action="<?php echo admin_url('/admin-ajax.php?action=resetPassword'); ?>" method="post"> |
| 57 | <?php wp_nonce_field(NONCE_KEY, '__wpdm_reset_pass'); ?> |
| 58 | |
| 59 | <div id="__reset_msg"></div> |
| 60 | |
| 61 | <div class="wpdm-auth-field"> |
| 62 | <div class="wpdm-auth-input-wrap"> |
| 63 | <input type="text" name="user_login" id="user_login" class="wpdm-auth-input" required placeholder="<?php _e('Enter your email address', "download-manager"); ?>" autocomplete="username" /> |
| 64 | </div> |
| 65 | </div> |
| 66 | |
| 67 | <button type="submit" name="wp-submit" id="resetPassword-submit" class="wpdm-auth-btn"> |
| 68 | <span><?php _e("Send Reset Link", "download-manager"); ?></span> |
| 69 | </button> |
| 70 | |
| 71 | <div class="wpdm-auth-back"> |
| 72 | <a href="<?php the_permalink(); ?>"> |
| 73 | <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m15 18-6-6 6-6"/></svg> |
| 74 | <span><?php _e("Back to sign in", "download-manager"); ?></span> |
| 75 | </a> |
| 76 | </div> |
| 77 | </form> |
| 78 | </div> |
| 79 | </div> |
| 80 | </div> |
| 81 | </div> |
| 82 | |
| 83 | <script> |
| 84 | jQuery(function ($) { |
| 85 | var $btn = $('#resetPassword-submit'); |
| 86 | var btnHtml = $btn.html(); |
| 87 | var sent = 0; |
| 88 | |
| 89 | $('#resetPassword').submit(function (e) { |
| 90 | e.preventDefault(); |
| 91 | if (sent === 1) return false; |
| 92 | |
| 93 | $btn.html('<span class="wpdm-auth-spinner"></span><span><?php _e("Sending...", "download-manager"); ?></span>').attr('disabled', 'disabled'); |
| 94 | |
| 95 | $(this).ajaxSubmit({ |
| 96 | success: function (res) { |
| 97 | if (res.match(/error/)) { |
| 98 | showMsg('error', '<?php _e("Account not found. Please check your email address.", "download-manager"); ?>'); |
| 99 | $btn.html(btnHtml).removeAttr('disabled'); |
| 100 | } else { |
| 101 | sent = 1; |
| 102 | showMsg('success', '<?php _e("Reset link sent! Check your inbox.", "download-manager"); ?>'); |
| 103 | $btn.html('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg><span><?php _e("Link Sent!", "download-manager"); ?></span>'); |
| 104 | } |
| 105 | }, |
| 106 | error: function() { |
| 107 | showMsg('error', '<?php _e("Something went wrong. Please try again.", "download-manager"); ?>'); |
| 108 | $btn.html(btnHtml).removeAttr('disabled'); |
| 109 | } |
| 110 | }); |
| 111 | return false; |
| 112 | }); |
| 113 | |
| 114 | function showMsg(type, msg) { |
| 115 | var icon = type === 'success' |
| 116 | ? '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>' |
| 117 | : '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'; |
| 118 | $('#__reset_msg').html('<div class="wpdm-auth-alert ' + type + '">' + icon + '<span>' + msg + '</span></div>'); |
| 119 | } |
| 120 | |
| 121 | $('body').on('click', '.wpdm-auth-alert.error', function() { |
| 122 | $(this).slideUp(150, function() { $(this).remove(); }); |
| 123 | }); |
| 124 | }); |
| 125 | </script> |
| 126 |