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
login-form.php
251 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Login Form Template - Split Panel Design |
| 4 | * Modern two-column layout with decorative left panel |
| 5 | */ |
| 6 | |
| 7 | if(!defined('ABSPATH')) die(); |
| 8 | $logo = wpdm_valueof($params, 'logo'); |
| 9 | if(!$logo) $logo = get_site_icon_url(); |
| 10 | $site_name = get_bloginfo('name'); |
| 11 | |
| 12 | // Enqueue unified auth styles |
| 13 | wp_enqueue_style('wpdm-auth-forms', \WPDM\__\Template::locate_url('auth-forms.css', __DIR__), [], WPDM_VERSION); |
| 14 | ?> |
| 15 | |
| 16 | <div class="w3eden wpdm-auth-page" id="wpdmloginpage"> |
| 17 | <div class="wpdm-auth-split" id="wpdmlogin"> |
| 18 | <div class="wpdm-auth-panel"> |
| 19 | <!-- Left Panel - Decorative --> |
| 20 | <div class="wpdm-auth-left"> |
| 21 | <div class="wpdm-auth-grid"></div> |
| 22 | <div class="wpdm-auth-circles"> |
| 23 | <div class="wpdm-auth-circle"></div> |
| 24 | <div class="wpdm-auth-circle"></div> |
| 25 | <div class="wpdm-auth-circle"></div> |
| 26 | <div class="wpdm-auth-circle"></div> |
| 27 | </div> |
| 28 | |
| 29 | <div class="wpdm-auth-brand"> |
| 30 | <a href="<?php echo home_url(); ?>"> |
| 31 | <?php if($logo && !is_user_logged_in()){ ?> |
| 32 | <img src="<?php echo esc_attr($logo); ?>" alt="<?php echo esc_attr($site_name); ?>" /> |
| 33 | <?php } else { ?> |
| 34 | <div class="wpdm-auth-brand-icon"> |
| 35 | <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> |
| 36 | </div> |
| 37 | <?php } ?> |
| 38 | <span><?php echo esc_html($site_name); ?></span> |
| 39 | </a> |
| 40 | </div> |
| 41 | |
| 42 | <div class="wpdm-auth-welcome"> |
| 43 | <div class="wpdm-auth-welcome-sub"><?php _e("Nice to see you again", "download-manager"); ?></div> |
| 44 | <div class="wpdm-auth-welcome-title"><?php _e("WELCOME BACK", "download-manager"); ?></div> |
| 45 | <div class="wpdm-auth-welcome-line"></div> |
| 46 | <div class="wpdm-auth-welcome-text"> |
| 47 | <?php _e("Sign in to access your account, manage your downloads, and explore all the features available to you.", "download-manager"); ?> |
| 48 | </div> |
| 49 | </div> |
| 50 | </div> |
| 51 | |
| 52 | <!-- Right Panel - Form --> |
| 53 | <div class="wpdm-auth-right"> |
| 54 | |
| 55 | |
| 56 | <div class="wpdm-auth-form-header"> |
| 57 | <h1 class="wpdm-auth-form-title"><?php _e("Login Account", "download-manager"); ?></h1> |
| 58 | <p class="wpdm-auth-form-desc"><?php _e("Enter your credentials to access your account and continue where you left off.", "download-manager"); ?></p> |
| 59 | </div> |
| 60 | <?php do_action("wpdm_before_login_form"); ?> |
| 61 | <form name="loginform" id="loginform" action="" method="post"> |
| 62 | <input type="hidden" name="permalink" value="<?php the_permalink(); ?>" /> |
| 63 | |
| 64 | <!-- Alerts --> |
| 65 | <div id="__signin_msg"> |
| 66 | <?php |
| 67 | $wpdm_signup_success = \WPDM\__\Session::get('__wpdm_signup_success'); |
| 68 | if(isset($_GET['signedup'])){ |
| 69 | if($wpdm_signup_success == '') $wpdm_signup_success = apply_filters("wpdm_signup_success", __("Your account has been created successfully.", "download-manager")); |
| 70 | ?> |
| 71 | <div class="wpdm-auth-alert success"> |
| 72 | <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> |
| 73 | <span><?= $wpdm_signup_success; ?></span> |
| 74 | </div> |
| 75 | <?php |
| 76 | } |
| 77 | ?> |
| 78 | </div> |
| 79 | |
| 80 | <?php if(isset($params['note_before']) && $params['note_before'] !== '') { ?> |
| 81 | <div class="wpdm-auth-alert info"> |
| 82 | <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> |
| 83 | <span><?= esc_html($params['note_before']); ?></span> |
| 84 | </div> |
| 85 | <?php } ?> |
| 86 | |
| 87 | <!-- Email --> |
| 88 | <div class="wpdm-auth-field"> |
| 89 | <div class="wpdm-auth-input-wrap"> |
| 90 | <input type="text" name="wpdm_login[log]" id="user_login" class="wpdm-auth-input" required placeholder="<?php _e('Email ID', "download-manager"); ?>" autocomplete="username" /> |
| 91 | </div> |
| 92 | </div> |
| 93 | |
| 94 | <!-- Password --> |
| 95 | <div class="wpdm-auth-field"> |
| 96 | <div class="wpdm-auth-input-wrap"> |
| 97 | <input type="password" name="wpdm_login[pwd]" id="password" class="wpdm-auth-input has-toggle" required placeholder="<?php _e('Password', "download-manager"); ?>" autocomplete="current-password" /> |
| 98 | <button type="button" class="wpdm-auth-pwd-toggle" onclick="wpdmTogglePwd()" aria-label="Toggle password visibility"> |
| 99 | <svg id="wpdm-eye" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg> |
| 100 | <svg id="wpdm-eye-off" style="display:none" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg> |
| 101 | </button> |
| 102 | </div> |
| 103 | </div> |
| 104 | |
| 105 | <!-- Hidden hash --> |
| 106 | <?php $encrypted_params = \WPDM\__\Crypt::encrypt($params); ?> |
| 107 | <input type="hidden" name="__phash" id="__phash" value="<?php echo esc_attr($encrypted_params); ?>" /> |
| 108 | |
| 109 | <?php if(isset($params['note_after']) && $params['note_after'] !== '') { ?> |
| 110 | <div class="wpdm-auth-alert info"> |
| 111 | <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> |
| 112 | <span><?= esc_html($params['note_after']); ?></span> |
| 113 | </div> |
| 114 | <?php } ?> |
| 115 | |
| 116 | <?php do_action("wpdm_login_form"); ?> |
| 117 | <?php do_action("login_form"); ?> |
| 118 | |
| 119 | <!-- Remember & Forgot --> |
| 120 | <div class="wpdm-auth-meta"> |
| 121 | <label class="wpdm-auth-remember"> |
| 122 | <input type="checkbox" name="rememberme" id="rememberme" value="forever" /> |
| 123 | <span class="wpdm-auth-check"> |
| 124 | <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg> |
| 125 | </span> |
| 126 | <span><?php _e("Keep me signed in", "download-manager"); ?></span> |
| 127 | </label> |
| 128 | <a href="<?php echo wpdm_lostpassword_url(); ?>" class="wpdm-auth-forgot"><?php _e("Forgot password?", "download-manager"); ?></a> |
| 129 | </div> |
| 130 | |
| 131 | <!-- Submit --> |
| 132 | <button type="submit" name="wp-submit" id="loginform-submit" class="wpdm-auth-btn"> |
| 133 | <span><?php _e("Sign In", "download-manager"); ?></span> |
| 134 | </button> |
| 135 | |
| 136 | <!-- Register Link --> |
| 137 | <?php if(isset($regurl) && $regurl != ''){ ?> |
| 138 | <div class="wpdm-auth-link"> |
| 139 | <?php _e("Don't have an account?", "download-manager"); ?> |
| 140 | <a href="<?php echo esc_attr($regurl); ?>"><?php _e("Sign up", "download-manager"); ?></a> |
| 141 | </div> |
| 142 | <?php } ?> |
| 143 | |
| 144 | <input type="hidden" name="redirect_to" value="<?= esc_url($log_redirect); ?>" /> |
| 145 | </form> |
| 146 | |
| 147 | <!-- Social Login --> |
| 148 | <?php if(count($__wpdm_social_login) > 1) { ?> |
| 149 | <div class="wpdm-auth-divider"><?php echo isset($params['social_title']) ? esc_html($params['social_title']) : __("or continue with", "download-manager"); ?></div> |
| 150 | <div class="wpdm-auth-social"> |
| 151 | <?php if(isset($__wpdm_social_login['google'])): ?> |
| 152 | <button type="button" class="wpdm-auth-social-btn google" onclick="return _PopupCenter('<?php echo home_url('/?sociallogin=google'); ?>', 'Google', 400, 400);" title="Google"> |
| 153 | <svg viewBox="0 0 24 24" fill="currentColor"><path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/><path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/></svg> |
| 154 | </button> |
| 155 | <?php endif; ?> |
| 156 | <?php if(isset($__wpdm_social_login['facebook'])): ?> |
| 157 | <button type="button" class="wpdm-auth-social-btn facebook" onclick="return _PopupCenter('<?php echo home_url('/?sociallogin=facebook'); ?>', 'Facebook', 400, 400);" title="Facebook"> |
| 158 | <svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg> |
| 159 | </button> |
| 160 | <?php endif; ?> |
| 161 | <?php if(isset($__wpdm_social_login['twitter'])): ?> |
| 162 | <button type="button" class="wpdm-auth-social-btn twitter" onclick="return _PopupCenter('<?php echo home_url('/?sociallogin=twitter'); ?>', 'Twitter', 400, 400);" title="X"> |
| 163 | <svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg> |
| 164 | </button> |
| 165 | <?php endif; ?> |
| 166 | <?php if(isset($__wpdm_social_login['linkedin'])): ?> |
| 167 | <button type="button" class="wpdm-auth-social-btn linkedin" onclick="return _PopupCenter('<?php echo home_url('/?sociallogin=linkedin'); ?>', 'LinkedIn', 400, 400);" title="LinkedIn"> |
| 168 | <svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg> |
| 169 | </button> |
| 170 | <?php endif; ?> |
| 171 | </div> |
| 172 | <?php } ?> |
| 173 | |
| 174 | <?php do_action("wpdm_after_login_form"); ?> |
| 175 | </div> |
| 176 | </div> |
| 177 | </div> |
| 178 | </div> |
| 179 | |
| 180 | <script> |
| 181 | function wpdmTogglePwd() { |
| 182 | var pwd = document.getElementById('password'); |
| 183 | var eye = document.getElementById('wpdm-eye'); |
| 184 | var eyeOff = document.getElementById('wpdm-eye-off'); |
| 185 | if (pwd.type === 'password') { |
| 186 | pwd.type = 'text'; |
| 187 | eye.style.display = 'none'; |
| 188 | eyeOff.style.display = 'block'; |
| 189 | } else { |
| 190 | pwd.type = 'password'; |
| 191 | eye.style.display = 'block'; |
| 192 | eyeOff.style.display = 'none'; |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | jQuery(function ($) { |
| 197 | <?php if(!isset($params['form_submit_handler']) || $params['form_submit_handler'] !== false){ ?> |
| 198 | var $btn = $('#loginform-submit'); |
| 199 | var btnHtml = $btn.html(); |
| 200 | |
| 201 | $('#loginform').submit(function () { |
| 202 | $btn.html('<span class="wpdm-auth-spinner"></span><span><?php _e("Signing in...", "download-manager"); ?></span>').attr('disabled', 'disabled'); |
| 203 | |
| 204 | $(this).ajaxSubmit({ |
| 205 | error: function(error) { |
| 206 | if(typeof error.responseJSON !== 'undefined') { |
| 207 | showErr(error.responseJSON.messages || error.responseJSON.message); |
| 208 | $btn.html(btnHtml).removeAttr('disabled'); |
| 209 | <?php if((int)get_option('__wpdm_recaptcha_loginform', 0) === 1 && get_option('_wpdm_recaptcha_site_key') != ''){ ?> |
| 210 | try { grecaptcha.reset(); } catch (e) {} |
| 211 | <?php } ?> |
| 212 | } else { |
| 213 | setTimeout(function () { |
| 214 | location.href = "<?= esc_url($log_redirect); ?>"; |
| 215 | }, 1000); |
| 216 | } |
| 217 | }, |
| 218 | success: async function (res) { |
| 219 | if (!res.success) { |
| 220 | showErr(res.message); |
| 221 | $btn.html(btnHtml).removeAttr('disabled'); |
| 222 | <?php if((int)get_option('__wpdm_recaptcha_loginform', 0) === 1 && get_option('_wpdm_recaptcha_site_key') != ''){ ?> |
| 223 | try { grecaptcha.reset(); } catch (e) {} |
| 224 | <?php } ?> |
| 225 | } else { |
| 226 | let proceed = await WPDM.doAction("wpdm_user_login", res); |
| 227 | $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>' + res.message + '</span>'); |
| 228 | setTimeout(function () { |
| 229 | location.href = "<?= esc_url($log_redirect); ?>"; |
| 230 | }, 1000); |
| 231 | } |
| 232 | } |
| 233 | }); |
| 234 | return false; |
| 235 | }); |
| 236 | <?php } ?> |
| 237 | |
| 238 | function showErr(msg) { |
| 239 | $('#loginform .wpdm-auth-alert.error').remove(); |
| 240 | var html = '<div class="wpdm-auth-alert error">' + |
| 241 | '<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>' + |
| 242 | '<span>' + msg + '</span></div>'; |
| 243 | $('#loginform').prepend(html); |
| 244 | } |
| 245 | |
| 246 | $('body').on('click', '.wpdm-auth-alert.error', function(){ |
| 247 | $(this).slideUp(150, function() { $(this).remove(); }); |
| 248 | }); |
| 249 | }); |
| 250 | </script> |
| 251 |