The login/register page and the auth modal had drifted into a parallel system: floating-input fields, a sign-page-card shell and a bespoke jio-auth-modal wrapper that none of the theme's own sign CSS targeted. The reference card rules (.sign, .sign-img, .sign-content, .line-form-input, .scale-placeholder, .social_loginbar, .title-h-left, #u_sign .modal-dialog, .qrcode-signin-container) have been in main.css all along, so the fix is to render the reference DOM instead of re-styling a second one. auth-content.php now emits one .sign.jio-panel.blur-bg.relative card with a .tab-content of #tab-sign-in / #tab-sign-up / #tab-resetpassword / #tab-qrcode-signin / #tab-bind panes. Each pane opens with a .title-h-left.fa-2x heading plus a .muted-color.px12 link, fields are .relative.line-form.mb10 > .line-form-input + .scale-placeholder + .line-form-line, the verification trigger is the .yztx.abs-right captchsubmit button, and submits are .but.radius.jb-blue|jb-green.padding-lg.btn-block. Social entries come from the shared render_social_buttons() separator + .social_loginbar, and the OAuth bind pane uses the oauth-data-box avatar card. The modal shell is #u_sign.modal > .modal-dialog > .sign-content > .sign-img.absolute.hide-sm + .sign, and the page shell is the reference .container.sign-page > .row.sign-row.gutters-5 > .col-md-6(.col-md-offset-6/ .col-md-offset-3).sign-col with a .fixed.lazyload background and a blurred fixed footer. auth.js drives .in instead of .is-open, toggles the new password/signin-mode/invite-gate controls and no longer touches the retired markup. The page also drops two footer-hook removals that targeted functions which no longer exist, and opts out of the fixed-nav offset. The sign page's custom theme setting now actually applies: Router answers jio_forced_theme_mode, jioData.themeForced wins over the stored cookie in theme.js, theme-toggle positions are suppressed, and the page marks html/body dark or white accordingly. sign.css shrinks from ~114 lines of bespoke component styling to a thin positioning layer, and the retired classes are gone rather than kept. Verification: php -l on every changed PHP file, node --check on both JS files, node --test across widget-system, navigation and front-submit (873 passing), and tools/audit-psr4-paths.php / audit-admin-contracts.php both at 0 errors. assets/js/runtime/main.min.js was rebuilt because theme.js gained the forced theme branch.
388 lines
32 KiB
PHP
388 lines
32 KiB
PHP
<?php
|
|
/**
|
|
* Shared authentication renderer for the modal and /sign/ page.
|
|
*
|
|
* @package Jio
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$jio_auth_context = isset($jio_auth_context) && is_array($jio_auth_context) ? $jio_auth_context : [];
|
|
$auth_tab = sanitize_key((string) ($jio_auth_context['tab'] ?? 'signin'));
|
|
$allowed_tabs = ['signin', 'signup', 'resetpassword', 'bind', 'oauth'];
|
|
$auth_tab = in_array($auth_tab, $allowed_tabs, true) ? $auth_tab : 'signin';
|
|
$is_modal = ($jio_auth_context['surface'] ?? '') === 'modal';
|
|
$settings = class_exists('\Jio\Settings\Settings') ? '\Jio\Settings\Settings' : null;
|
|
$obk = sanitize_text_field((string) ($jio_auth_context['obk'] ?? ''));
|
|
$oauth_bind_data = $obk !== '' && class_exists('\Jio\Auth\Service') ? \Jio\Auth\Service::get_oauth_bind_context($obk) : null;
|
|
$is_oauth_bind = is_array($oauth_bind_data);
|
|
$registration_open = $is_oauth_bind
|
|
? ($settings ? $settings::oauth_registration_enabled() : (bool) get_option('users_can_register'))
|
|
: ($settings ? $settings::registration_enabled() : (bool) get_option('users_can_register'));
|
|
$close_signin = $settings ? $settings::close_signin() : false;
|
|
$signin_phone = $settings ? $settings::signin_phone_enabled() : false;
|
|
$passwordless = $settings ? $settings::passwordless_login_enabled() : false;
|
|
$passwordless_type = $settings ? $settings::passwordless_login_type() : 'email';
|
|
$passwordless_mode = $settings ? $settings::nopas_active_mode() : 'pas';
|
|
$signup_verify = $settings ? $settings::signup_verification_enabled() : false;
|
|
$signup_type = $settings ? $settings::signup_verification_type() : 'email';
|
|
$signup_type = $signup_verify ? $signup_type : 'email';
|
|
$reset_type = $settings ? $settings::reset_password_verification_type() : 'email';
|
|
$omit_confirm = $signup_verify && ($settings ? $settings::signup_omit_password_confirmation() : false);
|
|
$agreement = function_exists('jio_get_auth_agreement_view') ? jio_get_auth_agreement_view() : ['enabled' => false, 'required' => false, 'links_html' => '', 'label_html' => '', 'field_name' => 'agree_terms'];
|
|
$referral = $settings ? $settings::get_referral_registration_settings() : ['enabled' => false, 'register_field' => 'hidden'];
|
|
$ref_mode = !empty($referral['enabled']) ? (string) ($referral['register_field'] ?? 'hidden') : 'hidden';
|
|
$ref_hint = $ref_mode === 'required' ? (string) ($referral['required_desc'] ?? '') : (string) ($referral['open_desc'] ?? '');
|
|
$ref_value = !empty($_GET['ref']) ? sanitize_key(wp_unslash((string) $_GET['ref'])) : (!empty($_COOKIE['jio_referral']) ? sanitize_key(wp_unslash((string) $_COOKIE['jio_referral'])) : '');
|
|
$invite_code_settings = $settings ? $settings::get_invite_code_registration_settings() : ['enabled' => false, 'register_field' => 'hidden', 'open_desc' => '', 'required_desc' => ''];
|
|
$invite_mode = !empty($invite_code_settings['enabled']) ? (string) ($invite_code_settings['register_field'] ?? 'hidden') : 'hidden';
|
|
$invite_hint = $invite_mode === 'required' ? (string) ($invite_code_settings['required_desc'] ?? '') : (string) ($invite_code_settings['open_desc'] ?? '');
|
|
$oauth_providers = class_exists('\Jio\Auth\OAuth') ? \Jio\Auth\OAuth::get_instance()->get_auth_providers_data() : [];
|
|
$wechat_qr = false;
|
|
foreach ($oauth_providers as $provider) {
|
|
if (($provider['name'] ?? '') === 'weixingzh') {
|
|
$wechat_qr = true;
|
|
break;
|
|
}
|
|
}
|
|
$show_logo = !empty($jio_auth_context['show_logo']);
|
|
$redirect_to = esc_url_raw((string) ($jio_auth_context['redirect_to'] ?? home_url('/')));
|
|
$unique = $is_modal ? 'modal' : 'page';
|
|
$oauth_user_data = $is_oauth_bind && !empty($oauth_bind_data['user_data']) && is_array($oauth_bind_data['user_data']) ? $oauth_bind_data['user_data'] : [];
|
|
$oauth_name = sanitize_user((string) ($oauth_user_data['name'] ?? $oauth_user_data['nickname'] ?? $oauth_user_data['login'] ?? ''), true);
|
|
$oauth_email = sanitize_email((string) ($oauth_user_data['email'] ?? ''));
|
|
$oauth_avatar = esc_url_raw((string) ($oauth_user_data['avatar'] ?? ''));
|
|
if ($oauth_avatar === '' && function_exists('jio_get_default_avatar_url')) {
|
|
$oauth_avatar = jio_get_default_avatar_url();
|
|
}
|
|
$oauth_provider_name = $is_oauth_bind ? \Jio\Auth\Service::get_oauth_provider_name((string) ($oauth_bind_data['provider'] ?? '')) : '';
|
|
$oauth_intent = sanitize_key((string) ($jio_auth_context['oauth_intent'] ?? ($_GET['oauth_intent'] ?? 'login')));
|
|
$oauth_intent = $oauth_intent === 'bind' ? 'bind' : 'login';
|
|
$oauth_bind_pass = $oauth_intent === 'bind'
|
|
? sanitize_text_field((string) ($jio_auth_context['bind_pass'] ?? ($_GET['bind_pass'] ?? '')))
|
|
: '';
|
|
|
|
$initial_tab = $auth_tab;
|
|
if ($initial_tab === 'signin' && $close_signin && $registration_open) {
|
|
$initial_tab = 'signup';
|
|
}
|
|
if ($initial_tab === 'signup' && !$registration_open) {
|
|
$initial_tab = 'signin';
|
|
}
|
|
if ($initial_tab === 'oauth' && !$wechat_qr) {
|
|
$initial_tab = 'signin';
|
|
}
|
|
if ($initial_tab === 'bind' && !$is_oauth_bind) {
|
|
$initial_tab = 'signin';
|
|
}
|
|
|
|
$show_nopas = $passwordless;
|
|
$show_pas = !$passwordless || $passwordless_mode !== 'only_nopas';
|
|
$nopas_active = $show_nopas && $passwordless_mode !== 'pas';
|
|
$signin_user_hint = ($passwordless || $signin_phone) ? __('用户名/手机号/邮箱', 'jio') : __('用户名或邮箱', 'jio');
|
|
$social_html = '';
|
|
if (!$is_oauth_bind && !$close_signin && !empty($oauth_providers) && class_exists('\Jio\Auth\OAuth')) {
|
|
$social_html = \Jio\Auth\OAuth::get_instance()->render_social_buttons(__('社交账号登录', 'jio'));
|
|
}
|
|
$ref_tooltip = $ref_hint !== '' ? wp_strip_all_tags($ref_hint) : '';
|
|
$invite_tooltip = ($invite_mode === 'optional' && $invite_hint !== '') ? wp_strip_all_tags($invite_hint) : '';
|
|
?>
|
|
<div class="sign jio-panel blur-bg relative jio-auth" data-jio-auth data-surface="<?php echo esc_attr($unique); ?>" data-initial-tab="<?php echo esc_attr($initial_tab); ?>" data-redirect-to="<?php echo esc_attr($redirect_to); ?>" data-oauth-intent="<?php echo esc_attr($oauth_intent); ?>" data-bind-pass="<?php echo esc_attr($oauth_bind_pass); ?>">
|
|
<?php if ($is_modal) : ?>
|
|
<button type="button" class="close" data-auth-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><?php echo function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button>
|
|
<?php endif; ?>
|
|
<?php if ($show_logo && function_exists('jio_get_auth_sign_logo_html')) : ?>
|
|
<?php echo jio_get_auth_sign_logo_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
<?php endif; ?>
|
|
|
|
<div class="tab-content">
|
|
<?php if (!$close_signin) : ?>
|
|
<div class="tab-pane fade<?php echo $initial_tab === 'signin' ? ' active in' : ''; ?>" id="<?php echo esc_attr($unique); ?>-tab-sign-in" role="tabpanel" data-auth-panel="signin" <?php echo $initial_tab !== 'signin' ? 'hidden' : ''; ?>>
|
|
<div class="box-body">
|
|
<div class="title-h-left fa-2x"><?php esc_html_e('登录', 'jio'); ?></div>
|
|
<?php if ($registration_open) : ?><a class="muted-color px12" href="#<?php echo esc_attr($unique); ?>-tab-sign-up" data-auth-tab="signup"><?php esc_html_e('没有账号?立即注册', 'jio'); ?><i class="em12 ml3 fa fas fa-angle-right" aria-hidden="true"></i></a><?php endif; ?>
|
|
</div>
|
|
<div id="sign-in">
|
|
<?php if ($show_nopas) : ?>
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade<?php echo $nopas_active ? ' active in' : ''; ?>" id="<?php echo esc_attr($unique); ?>-tab-signin-nopas" data-signin-panel="nopas" <?php echo $nopas_active ? '' : 'hidden'; ?>>
|
|
<form data-auth-form="login">
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="target" id="<?php echo esc_attr($unique); ?>-nopas-target" class="line-form-input" autocomplete="username" tabindex="1" placeholder="" required>
|
|
<div class="scale-placeholder"><?php echo $passwordless_type === 'phone' ? esc_html__('手机号', 'jio') : ($passwordless_type === 'email_phone' ? esc_html__('手机号或邮箱', 'jio') : esc_html__('邮箱', 'jio')); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('login'); } ?>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="code" id="<?php echo esc_attr($unique); ?>-nopas-code" class="line-form-input" inputmode="numeric" maxlength="6" autocomplete="one-time-code" tabindex="2" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div>
|
|
<span class="yztx abs-right"><button type="button" form-action="login" class="but c-blue captchsubmit" data-send-code="login"><?php esc_html_e('发送验证码', 'jio'); ?></button></span>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<input type="hidden" name="channel" value="<?php echo esc_attr($passwordless_type === 'phone' ? 'phone' : ''); ?>">
|
|
<div class="relative line-form mb10 em09">
|
|
<span class="muted-color form-checkbox"><input type="checkbox" id="<?php echo esc_attr($unique); ?>-nopas-remember" name="rememberme" value="1" checked="checked"><label for="<?php echo esc_attr($unique); ?>-nopas-remember" class="ml3"><?php esc_html_e('记住登录', 'jio'); ?></label></span>
|
|
<span class="pull-right muted-2-color">
|
|
<?php if ($show_pas) : ?><a class="muted-2-color" href="#<?php echo esc_attr($unique); ?>-tab-signin-pas" data-signin-mode="pas"><?php esc_html_e('账号密码登录', 'jio'); ?></a><?php endif; ?>
|
|
</span>
|
|
</div>
|
|
<div class="box-body">
|
|
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>">
|
|
<button type="submit" class="but radius jb-blue padding-lg btn-block"><i class="fa fas fa-sign-in-alt mr10" aria-hidden="true"></i><span data-submit-label><?php esc_html_e('登录', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden aria-hidden="true"></i></button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<?php if ($show_pas) : ?>
|
|
<div class="tab-pane fade<?php echo $nopas_active ? '' : ' active in'; ?>" id="<?php echo esc_attr($unique); ?>-tab-signin-pas" data-signin-panel="pas" <?php echo $nopas_active ? 'hidden' : ''; ?>>
|
|
<form data-auth-form="login">
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="target" id="<?php echo esc_attr($unique); ?>-login-target" class="line-form-input" autocomplete="username" tabindex="1" placeholder="" required>
|
|
<div class="scale-placeholder"><?php echo esc_html($signin_user_hint); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<div class="relative line-form mb10">
|
|
<input type="password" name="password" id="<?php echo esc_attr($unique); ?>-login-password" class="line-form-input" autocomplete="current-password" tabindex="2" placeholder="">
|
|
<div class="scale-placeholder"><?php esc_html_e('登录密码', 'jio'); ?></div>
|
|
<button type="button" class="abs-right sign-passw muted-2-color" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye" aria-hidden="true"></i></button>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('login'); } ?>
|
|
<div class="relative line-form mb10 em09">
|
|
<span class="muted-color form-checkbox"><input type="checkbox" id="<?php echo esc_attr($unique); ?>-remember" name="rememberme" value="1" checked="checked"><label for="<?php echo esc_attr($unique); ?>-remember" class="ml3"><?php esc_html_e('记住登录', 'jio'); ?></label></span>
|
|
<span class="pull-right muted-2-color">
|
|
<a class="muted-2-color" href="#<?php echo esc_attr($unique); ?>-tab-resetpassword" data-auth-tab="resetpassword"><?php esc_html_e('找回密码', 'jio'); ?></a>
|
|
<?php if ($show_nopas) : ?><span class="opacity5"> | </span><a class="muted-2-color" href="#<?php echo esc_attr($unique); ?>-tab-signin-nopas" data-signin-mode="nopas"><?php esc_html_e('免密登录', 'jio'); ?></a><?php endif; ?>
|
|
</span>
|
|
</div>
|
|
<div class="box-body">
|
|
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>">
|
|
<button type="submit" class="but radius jb-blue padding-lg btn-block"><i class="fa fas fa-sign-in-alt mr10" aria-hidden="true"></i><span data-submit-label><?php esc_html_e('登录', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden aria-hidden="true"></i></button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php else : ?>
|
|
<form data-auth-form="login">
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="target" id="<?php echo esc_attr($unique); ?>-login-target" class="line-form-input" autocomplete="username" tabindex="1" placeholder="" required>
|
|
<div class="scale-placeholder"><?php echo esc_html($signin_user_hint); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<div class="relative line-form mb10">
|
|
<input type="password" name="password" id="<?php echo esc_attr($unique); ?>-login-password" class="line-form-input" autocomplete="current-password" tabindex="2" placeholder="">
|
|
<div class="scale-placeholder"><?php esc_html_e('登录密码', 'jio'); ?></div>
|
|
<button type="button" class="abs-right sign-passw muted-2-color" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye" aria-hidden="true"></i></button>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('login'); } ?>
|
|
<div class="relative line-form mb10 em09">
|
|
<span class="muted-color form-checkbox"><input type="checkbox" id="<?php echo esc_attr($unique); ?>-remember" name="rememberme" value="1" checked="checked"><label for="<?php echo esc_attr($unique); ?>-remember" class="ml3"><?php esc_html_e('记住登录', 'jio'); ?></label></span>
|
|
<span class="pull-right muted-2-color"><a class="muted-2-color" href="#<?php echo esc_attr($unique); ?>-tab-resetpassword" data-auth-tab="resetpassword"><?php esc_html_e('找回密码', 'jio'); ?></a></span>
|
|
</div>
|
|
<div class="box-body">
|
|
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>">
|
|
<button type="submit" class="but radius jb-blue padding-lg btn-block"><i class="fa fas fa-sign-in-alt mr10" aria-hidden="true"></i><span data-submit-label><?php esc_html_e('登录', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden aria-hidden="true"></i></button>
|
|
</div>
|
|
</form>
|
|
<?php endif; ?>
|
|
<?php echo $social_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
<?php if ($social_html !== '' && !empty($agreement['enabled'])) : ?><div class="muted-color mt10 text-center px12 opacity8"><?php esc_html_e('使用社交账号登录即表示同意', 'jio'); ?><?php echo $agreement['links_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($registration_open) : ?>
|
|
<div class="tab-pane fade<?php echo $initial_tab === 'signup' ? ' active in' : ''; ?>" id="<?php echo esc_attr($unique); ?>-tab-sign-up" role="tabpanel" data-auth-panel="signup" <?php echo $initial_tab !== 'signup' ? 'hidden' : ''; ?>>
|
|
<div class="box-body">
|
|
<div class="title-h-left fa-2x"><?php echo $is_oauth_bind ? esc_html__('创建新账号', 'jio') : esc_html__('注册', 'jio'); ?></div>
|
|
<a class="muted-color px12" href="#<?php echo esc_attr($unique); ?>-tab-sign-in" data-auth-tab="<?php echo $is_oauth_bind ? 'bind' : 'signin'; ?>"><?php esc_html_e('已有账号,立即登录', 'jio'); ?><i class="em12 ml3 fa fas fa-angle-right" aria-hidden="true"></i></a>
|
|
</div>
|
|
<?php
|
|
$register_fields = function () use ($unique, $oauth_name, $oauth_email, $signup_type, $signup_verify, $omit_confirm, $ref_mode, $ref_value, $ref_tooltip, $invite_mode, $invite_tooltip, $agreement, $is_oauth_bind, $obk) {
|
|
?>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="user_login" id="<?php echo esc_attr($unique); ?>-register-name" class="line-form-input" value="<?php echo esc_attr($oauth_name); ?>" autocomplete="username" tabindex="1" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('设置用户名', 'jio'); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="target" id="<?php echo esc_attr($unique); ?>-register-target" class="line-form-input" value="<?php echo esc_attr($oauth_email); ?>" autocomplete="<?php echo $signup_type === 'phone' ? 'tel' : 'email'; ?>" tabindex="2" placeholder="" required>
|
|
<div class="scale-placeholder"><?php echo $signup_type === 'phone' ? esc_html__('手机号', 'jio') : ($signup_type === 'email_phone' ? esc_html__('手机号或邮箱', 'jio') : esc_html__('邮箱', 'jio')); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php if ($signup_verify) : ?>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="code" id="<?php echo esc_attr($unique); ?>-register-code" class="line-form-input" inputmode="numeric" maxlength="6" autocomplete="one-time-code" tabindex="3" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div>
|
|
<span class="yztx abs-right"><button type="button" form-action="register" class="but c-blue captchsubmit" data-send-code="register"><?php esc_html_e('发送验证码', 'jio'); ?></button></span>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="relative line-form mb10">
|
|
<input type="password" name="password" id="<?php echo esc_attr($unique); ?>-register-password" class="line-form-input" autocomplete="new-password" minlength="6" tabindex="4" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('设置密码', 'jio'); ?></div>
|
|
<button type="button" class="abs-right sign-passw muted-2-color" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye" aria-hidden="true"></i></button>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php if (!$omit_confirm) : ?>
|
|
<div class="relative line-form mb10">
|
|
<input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-register-confirm" class="line-form-input" autocomplete="new-password" minlength="6" tabindex="5" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('重复密码', 'jio'); ?></div>
|
|
<button type="button" class="abs-right sign-passw muted-2-color" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye" aria-hidden="true"></i></button>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if ($ref_mode !== 'hidden') : ?>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="ref" id="<?php echo esc_attr($unique); ?>-register-ref" class="line-form-input" value="<?php echo esc_attr($ref_value); ?>" tabindex="6" placeholder="" <?php echo $ref_mode === 'required' ? 'required' : ''; ?>>
|
|
<div class="scale-placeholder"><?php echo $ref_mode === 'required' ? esc_html__('推广码', 'jio') : esc_html__('推广码(选填)', 'jio'); ?></div>
|
|
<?php if ($ref_tooltip !== '') : ?><div class="abs-right muted-2-color" data-toggle="tooltip" title="<?php echo esc_attr($ref_tooltip); ?>"><i class="fa fas fa-question-circle" aria-hidden="true"></i></div><?php endif; ?>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if ($invite_mode === 'optional') : ?>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="invite_code" id="<?php echo esc_attr($unique); ?>-register-invite" class="line-form-input" data-invite-verify tabindex="7" placeholder="">
|
|
<div class="scale-placeholder"><?php esc_html_e('邀请码(选填)', 'jio'); ?></div>
|
|
<?php if ($invite_tooltip !== '') : ?><div class="abs-right muted-2-color" data-toggle="tooltip" title="<?php echo esc_attr($invite_tooltip); ?>"><i class="fa fas fa-question-circle" aria-hidden="true"></i></div><?php endif; ?>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<small class="muted-2-color px12" data-invite-feedback role="status" aria-live="polite" hidden></small>
|
|
<?php elseif ($invite_mode === 'required') : ?>
|
|
<input type="hidden" name="invite_code" value="" data-invite-value>
|
|
<?php endif; ?>
|
|
<?php if (!empty($agreement['enabled'])) : ?>
|
|
<?php if (!empty($agreement['required'])) : ?>
|
|
<div class="form-checkbox muted-color mt10 text-center px12 opacity8"><input type="checkbox" name="agree_terms" value="1" id="<?php echo esc_attr($unique); ?>-register-agree" required><label for="<?php echo esc_attr($unique); ?>-register-agree" class="px12 ml6" style="font-weight:normal;"><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></label></div>
|
|
<?php else : ?>
|
|
<div class="muted-color mt10 text-center px12 opacity8"><?php esc_html_e('注册即表示同意', 'jio'); ?><?php echo $agreement['links_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('register'); } ?>
|
|
<input type="hidden" name="channel" value="<?php echo esc_attr($signup_type === 'phone' ? 'phone' : ''); ?>">
|
|
<input type="hidden" name="user_email" value="">
|
|
<?php if ($is_oauth_bind) : ?><input type="hidden" name="obk" value="<?php echo esc_attr($obk); ?>"><?php endif; ?>
|
|
<div class="box-body">
|
|
<button type="submit" class="but radius jb-green padding-lg btn-block"><?php echo function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-signup', 'icon mr10') : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><span data-submit-label><?php echo $is_oauth_bind ? esc_html__('绑定注册', 'jio') : esc_html__('注册', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden aria-hidden="true"></i></button>
|
|
</div>
|
|
<?php
|
|
};
|
|
?>
|
|
<?php if ($invite_mode === 'required') : ?>
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade active in" data-invite-gate-panel>
|
|
<div class="mb10 flex jc" style="min-height:72px;"><div class="text-center"><?php echo wp_kses_post($invite_hint); ?></div></div>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="invite_code" id="<?php echo esc_attr($unique); ?>-invite-gate" class="line-form-input" data-invite-verify data-invite-gate-input autocomplete="off" tabindex="1" placeholder="">
|
|
<div class="scale-placeholder"><?php esc_html_e('请填写邀请码', 'jio'); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<small class="muted-2-color px12" data-invite-feedback role="status" aria-live="polite" hidden></small>
|
|
<div class="box-body"><button type="button" class="but radius jb-blue padding-lg btn-block" data-invite-gate><?php esc_html_e('继续', 'jio'); ?><i class="em12 ml3 fa fas fa-angle-right" aria-hidden="true"></i></button></div>
|
|
</div>
|
|
<div class="tab-pane fade" data-invite-form-panel hidden>
|
|
<form id="sign-up" data-auth-form="register"><?php $register_fields(); ?></form>
|
|
</div>
|
|
</div>
|
|
<?php else : ?>
|
|
<form id="sign-up" data-auth-form="register"><?php $register_fields(); ?></form>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="tab-pane fade<?php echo $initial_tab === 'resetpassword' ? ' active in' : ''; ?>" id="<?php echo esc_attr($unique); ?>-tab-resetpassword" role="tabpanel" data-auth-panel="resetpassword" <?php echo $initial_tab !== 'resetpassword' ? 'hidden' : ''; ?>>
|
|
<div class="box-body">
|
|
<div class="title-h-left fa-2x"><?php esc_html_e('找回密码', 'jio'); ?></div>
|
|
<a class="muted-color px12" href="#<?php echo esc_attr($unique); ?>-tab-sign-in" data-auth-tab="signin"><?php esc_html_e('登录', 'jio'); ?></a><i class="icon-spot"></i><?php if ($registration_open) : ?><a class="muted-color px12" href="#<?php echo esc_attr($unique); ?>-tab-sign-up" data-auth-tab="signup"><?php esc_html_e('注册', 'jio'); ?></a><?php endif; ?>
|
|
</div>
|
|
<form data-auth-form="reset-password">
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="target" id="<?php echo esc_attr($unique); ?>-reset-target" class="line-form-input" autocomplete="username" tabindex="1" placeholder="" required>
|
|
<div class="scale-placeholder"><?php echo $reset_type === 'phone' ? esc_html__('手机号', 'jio') : ($reset_type === 'email_phone' ? esc_html__('手机号或邮箱', 'jio') : esc_html__('邮箱', 'jio')); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('lostpassword'); } ?>
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="code" id="<?php echo esc_attr($unique); ?>-reset-code" class="line-form-input" inputmode="numeric" maxlength="6" autocomplete="one-time-code" tabindex="2" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div>
|
|
<span class="yztx abs-right"><button type="button" form-action="resetpassword" class="but c-blue captchsubmit" data-send-code="resetpassword"><?php esc_html_e('发送验证码', 'jio'); ?></button></span>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<div class="relative line-form mb10">
|
|
<input type="password" name="password" id="<?php echo esc_attr($unique); ?>-reset-password" class="line-form-input" autocomplete="new-password" minlength="6" tabindex="3" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('设置新密码', 'jio'); ?></div>
|
|
<button type="button" class="abs-right sign-passw muted-2-color" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye" aria-hidden="true"></i></button>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<div class="relative line-form mb10">
|
|
<input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-reset-confirm" class="line-form-input" autocomplete="new-password" minlength="6" tabindex="4" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('重复密码', 'jio'); ?></div>
|
|
<button type="button" class="abs-right sign-passw muted-2-color" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye" aria-hidden="true"></i></button>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<input type="hidden" name="channel" value="<?php echo esc_attr($reset_type === 'phone' ? 'phone' : ''); ?>">
|
|
<div class="box-body">
|
|
<button type="submit" class="but radius jb-green padding-lg btn-block"><i class="fa fas fa-unlock-alt mr10" aria-hidden="true"></i><span data-submit-label><?php esc_html_e('确认提交', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden aria-hidden="true"></i></button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<?php if ($wechat_qr) : ?>
|
|
<div class="tab-pane fade<?php echo $initial_tab === 'oauth' ? ' active in' : ''; ?>" id="<?php echo esc_attr($unique); ?>-tab-qrcode-signin" role="tabpanel" data-auth-panel="oauth" <?php echo $initial_tab !== 'oauth' ? 'hidden' : ''; ?>>
|
|
<div class="box-body">
|
|
<div class="title-h-left fa-2x"><?php esc_html_e('扫码登录', 'jio'); ?></div>
|
|
<span class="muted-3-color px12"><?php esc_html_e('使用', 'jio'); ?><a class="muted-color" href="#<?php echo esc_attr($unique); ?>-tab-sign-in" data-auth-tab="signin"><?php esc_html_e('其它方式登录', 'jio'); ?></a><?php echo $registration_open ? esc_html__('或', 'jio') . '<a class="muted-color" href="#' . esc_attr($unique) . '-tab-sign-up" data-auth-tab="signup">' . esc_html__('注册', 'jio') . '</a>' : ''; ?></span>
|
|
</div>
|
|
<div class="qrcode-signin-container box-body text-center" data-auth-qrcode>
|
|
<div data-auth-qr-content><p class="placeholder" style="height:180px;width:180px;margin:auto;"></p><p class="placeholder" style="height:27px;width:200px;margin:15px auto 0;"></p></div>
|
|
<p class="screen-reader-text" data-auth-qr-status role="status" aria-live="polite" aria-atomic="true"><?php esc_html_e('正在获取二维码', 'jio'); ?></p>
|
|
</div>
|
|
<?php if (!empty($agreement['enabled'])) : ?><div class="muted-color mt10 text-center px12 opacity8"><?php esc_html_e('扫码登录即表示同意', 'jio'); ?><?php echo $agreement['links_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="tab-pane fade<?php echo $initial_tab === 'bind' ? ' active in' : ''; ?>" id="<?php echo esc_attr($unique); ?>-tab-bind" role="tabpanel" data-auth-panel="bind" <?php echo $initial_tab !== 'bind' ? 'hidden' : ''; ?>>
|
|
<?php if ($is_oauth_bind) : ?>
|
|
<div class="oauth-data-box">
|
|
<div class="muted-box">
|
|
<div class="user-info flex ac relative">
|
|
<span class="avatar-img mr6"><img alt="<?php esc_attr_e('头像', 'jio'); ?>" src="<?php echo esc_url($oauth_avatar); ?>" class="avatar"></span>
|
|
<div class="flex1 ml10"><b><?php printf(esc_html__('您好!%s', 'jio'), esc_html($oauth_name !== '' ? $oauth_name : $oauth_provider_name)); ?></b><div class="mt6 px12 muted-2-color"><?php printf(esc_html__('您首次使用此%1$s账号登录', 'jio'), '<b class="badg badg-sm c-blue">' . esc_html($oauth_provider_name) . '</b>'); ?><br><?php esc_html_e('请先绑定已有账号或创建新账号', 'jio'); ?></div></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box-body">
|
|
<div class="title-h-left em14"><?php esc_html_e('绑定账号', 'jio'); ?></div>
|
|
<?php if ($registration_open) : ?><a class="muted-color px12" href="#<?php echo esc_attr($unique); ?>-tab-sign-up" data-auth-tab="signup"><?php esc_html_e('没有账号?创建新账号', 'jio'); ?><i class="em12 ml3 fa fas fa-angle-right" aria-hidden="true"></i></a><?php endif; ?>
|
|
</div>
|
|
<form data-auth-form="login">
|
|
<div class="relative line-form mb10">
|
|
<input type="text" name="target" id="<?php echo esc_attr($unique); ?>-bind-target" class="line-form-input" autocomplete="username" tabindex="1" placeholder="" required>
|
|
<div class="scale-placeholder"><?php echo esc_html($signin_user_hint); ?></div>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<div class="relative line-form mb10">
|
|
<input type="password" name="password" id="<?php echo esc_attr($unique); ?>-bind-password" class="line-form-input" autocomplete="current-password" tabindex="2" placeholder="" required>
|
|
<div class="scale-placeholder"><?php esc_html_e('登录密码', 'jio'); ?></div>
|
|
<button type="button" class="abs-right sign-passw muted-2-color" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye" aria-hidden="true"></i></button>
|
|
<i class="line-form-line"></i>
|
|
</div>
|
|
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('bind'); } ?>
|
|
<input type="hidden" name="obk" value="<?php echo esc_attr($obk); ?>">
|
|
<input type="hidden" name="rememberme" value="1">
|
|
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>">
|
|
<div class="box-body">
|
|
<button type="submit" class="but radius jb-blue padding-lg btn-block"><i class="fa fas fa-sign-in-alt mr10" aria-hidden="true"></i><span data-submit-label><?php esc_html_e('绑定登录', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden aria-hidden="true"></i></button>
|
|
</div>
|
|
</form>
|
|
<?php else : ?>
|
|
<div class="box-body">
|
|
<div class="title-h-left fa-2x"><?php esc_html_e('绑定账号', 'jio'); ?></div>
|
|
</div>
|
|
<div class="box-body"><div class="c-red px12"><i class="fa fas fa-info-circle mr6" aria-hidden="true"></i><?php esc_html_e('绑定会话已过期,请重新使用第三方登录。', 'jio'); ?></div></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|