feat(auth): rebuild the sign-in surfaces on the shared sign-card contract

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.
This commit is contained in:
kate522 committed 2026-11-04 16:04:24 +08:00
1 parent d40906b4a3
commit 41366e7fc4
15 files changed
+664 -281

No files matched your search

+54 -13
View File
@@ -30,14 +30,46 @@ if ($tab === 'signup' && class_exists('\Jio\Settings\Settings') && !\Jio\Setting
$tab = 'signin';
}
remove_action('wp_footer', 'jio_render_footer_tabbar', 20);
remove_action('wp_footer', 'jio_render_float_buttons', 30);
$ui = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::sign_page_ui() : [];
$images = $ui['background'] ?? [];
$background_id = $images ? (int) $images[array_rand($images)] : 0;
$background_url = $background_id > 0 ? (string) wp_get_attachment_image_url($background_id, 'full') : '';
// 主题模式由 Router 通过 jio_initial_theme_mode / jio_theme_mode_js_value 统一注入。
$theme_mode = (string) ($ui['theme_mode'] ?? 'no');
$position = (string) ($ui['card_position'] ?? 'right');
$show_header = !empty($ui['show_header']) && !$interim;
add_filter('document_title_parts', static function (array $parts): array {
$parts['title'] = __('登录 / 注册', 'jio');
unset($parts['tagline']);
return $parts;
});
$initial_theme_mode = '';
if ($theme_mode !== 'no' && class_exists('\Jio\Settings\Settings')) {
$initial_theme_mode = (string) apply_filters('jio_forced_theme_mode', '');
}
remove_action('wp_footer', 'jio_float_right');
$body_classes = ['page-template-user-sign', 'site-layout-1'];
if ($theme_mode !== 'no') {
$body_classes[] = $theme_mode;
}
if ($initial_theme_mode === 'dark') {
$body_classes[] = 'theme-dark';
$body_classes[] = 'dark-theme';
} elseif ($initial_theme_mode === 'light') {
$body_classes[] = 'white-theme';
}
$card_offset = ' col-md-offset-6';
if ($position === 'left') {
$card_offset = '';
} elseif ($position === 'center') {
$card_offset = ' col-md-offset-3';
}
$jio_auth_context = [
'surface' => 'page',
'tab' => $tab,
@@ -47,24 +79,33 @@ $jio_auth_context = [
];
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<html <?php language_attributes(); ?><?php echo $initial_theme_mode === 'dark' ? ' class="dark"' : ''; ?><?php echo $initial_theme_mode !== '' ? ' data-theme="' . esc_attr($initial_theme_mode) . '"' : ''; ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="noindex,nofollow">
<title><?php echo esc_html__('登录 / 注册', 'jio') . ' - ' . esc_html(get_bloginfo('name')); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
<meta name="robots" content="noindex, nofollow">
<?php wp_head(); ?>
</head>
<body <?php body_class('page-template-user-sign ' . ($theme_mode !== 'no' ? $theme_mode : '')); ?>>
<body <?php body_class($body_classes); ?><?php echo $initial_theme_mode !== '' ? ' data-theme="' . esc_attr($initial_theme_mode) . '"' : ''; ?>>
<?php wp_body_open(); ?>
<?php if ($background_url !== '') : ?><div class="sign-page-background" style="background-image:url('<?php echo esc_url($background_url); ?>')"></div><?php endif; ?>
<?php if (!empty($ui['show_header']) && !$interim) : ?><header class="sign-topbar"><a href="<?php echo esc_url(home_url('/')); ?>"><?php echo esc_html(get_bloginfo('name')); ?></a><a href="<?php echo esc_url(home_url('/')); ?>"><?php esc_html_e('返回首页', 'jio'); ?></a></header><?php endif; ?>
<main class="sign-page sign-card-position-<?php echo esc_attr($position); ?>">
<div class="sign-page-card">
<?php require get_template_directory() . '/templates/parts/auth-content.php'; ?>
<?php if ($background_url !== '') : ?>
<div class="fixed lazyload" data-bg="<?php echo esc_url($background_url); ?>" style="background-repeat:no-repeat;background-size:cover;background-position:center;"></div>
<?php endif; ?>
<?php if ($show_header && function_exists('jio_header')) { jio_header(); } ?>
<main role="main" class="container sign-page">
<div class="row sign-row gutters-5">
<div class="col-md-6<?php echo esc_attr($card_offset); ?> sign-col">
<div style="padding:20px 0 60px 0">
<?php require get_template_directory() . '/templates/parts/auth-content.php'; ?>
</div>
</div>
</div>
</main>
<?php if (!$interim) : ?><footer class="sign-page-footer"><?php echo !empty($ui['footer']) ? wp_kses_post((string) $ui['footer']) : '&copy; ' . esc_html(wp_date('Y')) . ' ' . esc_html(get_bloginfo('name')); ?></footer><?php endif; ?>
<?php if (!$interim) : ?>
<div class="sign-page-footer text-center blur-bg fixed px12 opacity8">
<?php echo !empty($ui['footer']) ? wp_kses_post((string) $ui['footer']) : '&copy; ' . esc_html(wp_date('Y')) . ' ' . esc_html(get_bloginfo('name')); ?>
</div>
<?php endif; ?>
<?php wp_footer(); ?>
</body>
</html>
+318 -82
View File
@@ -29,7 +29,7 @@ $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, 'label_html' => '', 'field_name' => 'agree_terms'];
$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'] ?? '');
@@ -46,106 +46,342 @@ foreach ($oauth_providers as $provider) {
}
}
$show_logo = !empty($jio_auth_context['show_logo']);
$oauth_large = $settings ? (bool) $settings::get_value('oauth_button_lg', false) : false;
$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-auth<?php echo $oauth_large ? ' oauth-button-lg' : ''; ?>" data-jio-auth data-surface="<?php echo esc_attr($unique); ?>" data-initial-tab="<?php echo esc_attr($auth_tab); ?>" data-passwordless-mode="<?php echo esc_attr($passwordless_mode); ?>" 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 ($show_logo) : ?>
<div class="sign-logo"><?php echo function_exists('jio_get_auth_sign_logo_html') ? jio_get_auth_sign_logo_html() : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<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; ?>
<section id="<?php echo esc_attr($unique); ?>-auth-panel-signin" class="sign-panel" role="tabpanel" data-auth-panel="signin" <?php echo $auth_tab !== 'signin' ? 'hidden' : ''; ?>>
<div class="sign-header"><h2><?php esc_html_e('登录', 'jio'); ?></h2><?php if ($registration_open) : ?><span><?php esc_html_e('没有账号?', 'jio'); ?> <button type="button" data-auth-tab="signup"><?php esc_html_e('立即注册', 'jio'); ?></button></span><?php endif; ?></div>
<div class="tab-content">
<?php if (!$close_signin) : ?>
<form class="sign-form" data-auth-form="login">
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-login-target" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-login-target"><?php echo ($passwordless || $signin_phone) ? esc_html__('邮箱 / 手机号 / 用户名', 'jio') : esc_html__('邮箱 / 用户名', 'jio'); ?></label></div>
<div data-auth-password-fields <?php echo $passwordless && $passwordless_mode !== 'pas' ? 'hidden' : ''; ?>>
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-login-password" autocomplete="current-password"><label for="<?php echo esc_attr($unique); ?>-login-password"><?php esc_html_e('密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
<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>
<?php if ($passwordless) : ?>
<div data-auth-code-fields <?php echo $passwordless_mode === 'pas' ? 'hidden' : ''; ?>>
<div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-login-code"><label for="<?php echo esc_attr($unique); ?>-login-code"><?php esc_html_e('验证码', 'jio'); ?></label><button type="button" class="send-code" data-send-code="login"><?php esc_html_e('发送验证码', 'jio'); ?></button></div>
<input type="hidden" name="channel" value="<?php echo esc_attr($passwordless_type === 'phone' ? 'phone' : ''); ?>">
<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 class="sign-options"><label><input type="checkbox" name="rememberme" value="1"> <?php esc_html_e('记住登录', 'jio'); ?></label><button type="button" data-auth-tab="resetpassword"><?php esc_html_e('忘记密码?', 'jio'); ?></button></div>
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('login'); } ?>
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>">
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('登录', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
<?php if ($passwordless && $passwordless_mode !== 'only_nopas') : ?><button type="button" class="sign-mode-switch" data-login-mode><?php echo $passwordless_mode === 'pas' ? esc_html__('使用验证码登录', 'jio') : esc_html__('使用账号密码登录', 'jio'); ?></button><?php endif; ?>
</form>
<?php else : ?><div class="sign-notice"><?php esc_html_e('当前已关闭账号密码登录,请使用第三方登录。', 'jio'); ?></div><?php endif; ?>
</section>
</div>
<?php endif; ?>
<?php if ($registration_open) : ?>
<section id="<?php echo esc_attr($unique); ?>-auth-panel-signup" class="sign-panel" role="tabpanel" data-auth-panel="signup" <?php echo $auth_tab !== 'signup' ? 'hidden' : ''; ?>>
<div class="sign-header"><h2><?php echo $is_oauth_bind ? esc_html__('注册并绑定', 'jio') : esc_html__('注册', 'jio'); ?></h2><span><?php esc_html_e('已有账号?', 'jio'); ?> <button type="button" data-auth-tab="<?php echo $is_oauth_bind ? 'bind' : 'signin'; ?>"><?php esc_html_e('立即登录', 'jio'); ?></button></span></div>
<form class="sign-form" data-auth-form="register">
<div class="floating-input"><input name="user_login" value="<?php echo esc_attr($oauth_name); ?>" id="<?php echo esc_attr($unique); ?>-register-name" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-register-name"><?php esc_html_e('用户名', 'jio'); ?></label></div>
<div class="floating-input"><input name="target" value="<?php echo esc_attr($oauth_email); ?>" id="<?php echo esc_attr($unique); ?>-register-target" autocomplete="<?php echo $signup_type === 'phone' ? 'tel' : 'email'; ?>" required><label for="<?php echo esc_attr($unique); ?>-register-target"><?php echo $signup_type === 'phone' ? esc_html__('手机号', 'jio') : ($signup_type === 'email_phone' ? esc_html__('邮箱 / 手机号', 'jio') : esc_html__('邮箱', 'jio')); ?></label></div>
<?php if ($signup_verify) : ?><div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-register-code" required><label for="<?php echo esc_attr($unique); ?>-register-code"><?php esc_html_e('验证码', 'jio'); ?></label><button type="button" class="send-code" data-send-code="register"><?php esc_html_e('发送验证码', 'jio'); ?></button></div><?php endif; ?>
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-register-password" autocomplete="new-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-register-password"><?php esc_html_e('密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
<?php if (!$omit_confirm) : ?><div class="floating-input has-action"><input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-register-confirm" autocomplete="new-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-register-confirm"><?php esc_html_e('重复密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div><?php endif; ?>
<?php if ($ref_mode !== 'hidden') : ?><div class="floating-input"><input name="ref" value="<?php echo esc_attr($ref_value); ?>" id="<?php echo esc_attr($unique); ?>-register-ref" <?php echo $ref_mode === 'required' ? 'required' : ''; ?>><label for="<?php echo esc_attr($unique); ?>-register-ref"><?php echo $ref_mode === 'required' ? esc_html__('推广码', 'jio') : esc_html__('推广码(选填)', 'jio'); ?></label></div><?php if ($ref_hint !== '') : ?><div class="sign-hint"><?php echo wp_kses_post($ref_hint); ?></div><?php endif; ?><?php endif; ?>
<?php if ($invite_mode !== 'hidden') : ?><div class="floating-input"><input name="invite_code" id="<?php echo esc_attr($unique); ?>-register-invite" data-invite-verify <?php echo $invite_mode === 'required' ? 'required' : ''; ?>><label for="<?php echo esc_attr($unique); ?>-register-invite"><?php echo $invite_mode === 'required' ? esc_html__('邀请码', 'jio') : esc_html__('邀请码(选填)', 'jio'); ?></label></div><small class="sign-hint" data-invite-feedback role="status" aria-live="polite" hidden></small><?php if ($invite_hint !== '') : ?><div class="sign-hint"><?php echo wp_kses_post($invite_hint); ?></div><?php endif; ?><?php endif; ?>
<?php if (!empty($agreement['enabled']) && !empty($agreement['required'])) : ?><label class="sign-agreement"><input type="checkbox" name="agree_terms" value="1" required><span><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span></label><?php elseif (!empty($agreement['enabled'])) : ?><div class="sign-agreement sign-agreement-implicit"><?php esc_html_e('注册即表示', 'jio'); ?><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?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; ?>
<button type="submit" class="sign-submit jb-green"><span><?php esc_html_e('注册', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
</form>
</section>
<?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>
<section id="<?php echo esc_attr($unique); ?>-auth-panel-resetpassword" class="sign-panel" role="tabpanel" data-auth-panel="resetpassword" <?php echo $auth_tab !== 'resetpassword' ? 'hidden' : ''; ?>>
<div class="sign-header"><h2><?php esc_html_e('找回密码', 'jio'); ?></h2><span><button type="button" data-auth-tab="signin"><?php esc_html_e('返回登录', 'jio'); ?></button></span></div>
<form class="sign-form" data-auth-form="reset-password">
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-reset-target" required><label for="<?php echo esc_attr($unique); ?>-reset-target"><?php echo $reset_type === 'phone' ? esc_html__('手机号', 'jio') : ($reset_type === 'email_phone' ? esc_html__('邮箱 / 手机号', 'jio') : esc_html__('邮箱', 'jio')); ?></label></div>
<div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-reset-code" required><label for="<?php echo esc_attr($unique); ?>-reset-code"><?php esc_html_e('验证码', 'jio'); ?></label><button type="button" class="send-code" data-send-code="resetpassword"><?php esc_html_e('发送验证码', 'jio'); ?></button></div>
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-reset-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-reset-password"><?php esc_html_e('新密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
<div class="floating-input has-action"><input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-reset-confirm" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-reset-confirm"><?php esc_html_e('重复新密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('lostpassword'); } ?>
<input type="hidden" name="channel" value="<?php echo esc_attr($reset_type === 'phone' ? 'phone' : ''); ?>">
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('重置密码', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
</form>
</section>
<?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; ?>
<section id="<?php echo esc_attr($unique); ?>-auth-panel-oauth" class="sign-panel" role="tabpanel" data-auth-panel="oauth" <?php echo $auth_tab !== 'oauth' ? 'hidden' : ''; ?>>
<div class="sign-header"><h2><?php esc_html_e('社交登录', 'jio'); ?></h2><span><button type="button" data-auth-tab="signin"><?php esc_html_e('返回登录', 'jio'); ?></button></span></div>
<?php if ($wechat_qr) : ?><div class="auth-qrcode" data-auth-qrcode><div data-auth-qr-content><i class="fa fab fa-weixin" aria-hidden="true"></i><span><?php esc_html_e('获取二维码中…', 'jio'); ?></span></div><p class="auth-qrcode-status screen-reader-text" data-auth-qr-status role="status" aria-live="polite" aria-atomic="true"><?php esc_html_e('正在获取二维码', 'jio'); ?></p></div><?php endif; ?>
</section>
<section id="<?php echo esc_attr($unique); ?>-auth-panel-bind" class="sign-panel" role="tabpanel" data-auth-panel="bind" <?php echo $auth_tab !== 'bind' ? 'hidden' : ''; ?>>
<div class="sign-header"><h2><?php esc_html_e('绑定账号', 'jio'); ?></h2><?php if ($is_oauth_bind && $registration_open) : ?><span><?php esc_html_e('没有账号?', 'jio'); ?> <button type="button" data-auth-tab="signup"><?php esc_html_e('立即注册', 'jio'); ?></button></span><?php endif; ?></div>
<?php if ($is_oauth_bind) : ?>
<div class="sign-notice"><?php printf(esc_html__('通过 %s 登录,请绑定已有账号。', 'jio'), esc_html($oauth_provider_name)); ?></div>
<form class="sign-form" data-auth-form="login">
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-bind-target" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-bind-target"><?php echo $signin_phone ? esc_html__('邮箱 / 手机号 / 用户名', 'jio') : esc_html__('邮箱 / 用户名', 'jio'); ?></label></div>
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-bind-password" autocomplete="current-password" required><label for="<?php echo esc_attr($unique); ?>-bind-password"><?php esc_html_e('密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></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); ?>">
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('登录并绑定', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
</form>
<?php else : ?><div class="sign-notice"><?php esc_html_e('绑定会话已过期,请重新使用第三方登录。', 'jio'); ?></div><?php endif; ?>
</section>
<?php if (!empty($oauth_providers) && !$is_oauth_bind) : ?>
<div class="social-login"><span><?php esc_html_e('其他登录方式', 'jio'); ?></span><div class="social-login-buttons">
<?php foreach ($oauth_providers as $provider) : ?><?php if (($provider['name'] ?? '') === 'weixingzh') continue; ?><?php $provider_label = (string) ($provider['label'] ?? $provider['name'] ?? ''); ?><a class="social-login-item <?php echo esc_attr((string) ($provider['name'] ?? '')); ?>" href="<?php echo esc_url((string) ($provider['url'] ?? '#')); ?>" data-provider="<?php echo esc_attr((string) ($provider['name'] ?? '')); ?>" aria-label="<?php echo esc_attr(sprintf(__('%s登录', 'jio'), $provider_label)); ?>" title="<?php echo esc_attr($provider_label); ?>"><?php echo $provider['icon'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><?php if ($oauth_large) : ?><span><?php printf(esc_html__('%s登录', 'jio'), esc_html($provider_label)); ?></span><?php endif; ?></a><?php endforeach; ?>
<?php if ($wechat_qr) : ?><button type="button" class="social-login-item weixingzh" data-auth-tab="oauth" aria-label="<?php esc_attr_e('微信扫码登录', 'jio'); ?>" title="<?php esc_attr_e('微信扫码登录', 'jio'); ?>"><i class="fa fab fa-weixin" aria-hidden="true"></i><?php if ($oauth_large) : ?><span><?php esc_html_e('微信登录', 'jio'); ?></span><?php endif; ?></button><?php endif; ?>
</div></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>
+5 -8
View File
@@ -17,7 +17,6 @@ $image_id = $images ? (int) $images[array_rand($images)] : 0;
$image_html = $image_id > 0 ? wp_get_attachment_image($image_id, 'full', false, [
'class' => 'fit-cover radius8',
'alt' => get_bloginfo('name'),
'loading' => 'lazy',
'decoding' => 'async',
]) : '';
$auto = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::sign_modal_auto() : ['enabled' => false, 'waiting' => 5, 'expires' => 1];
@@ -30,13 +29,11 @@ $jio_auth_context = [
'redirect_to' => home_url('/'),
];
?>
<div id="u_sign" class="jio-auth-modal<?php echo $image_html !== '' ? ' has-sign-img' : ''; ?>" aria-hidden="true" role="dialog" aria-modal="true" aria-labelledby="jio-auth-modal-title" tabindex="-1" data-auth-modal data-auto="<?php echo !empty($auto['enabled']) ? '1' : '0'; ?>" data-auto-wait="<?php echo esc_attr((string) $auto['waiting']); ?>" data-auto-expires="<?php echo esc_attr((string) $auto['expires']); ?>">
<h2 id="jio-auth-modal-title" class="screen-reader-text"><?php esc_html_e('账户登录与注册', 'jio'); ?></h2>
<div class="auth-modal-backdrop" data-auth-close></div>
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="auth-modal-close" data-auth-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><i class="fa fas fa-times"></i></button>
<?php if ($image_html !== '') : ?><div class="sign-img"><?php echo $image_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
<div id="u_sign" class="modal jio-auth-modal<?php echo $image_html !== '' ? ' has-sign-img' : ''; ?>" aria-hidden="true" role="dialog" aria-modal="true" aria-labelledby="jio-auth-modal-title" tabindex="-1" data-auth-modal data-auto="<?php echo !empty($auto['enabled']) ? '1' : '0'; ?>" data-auto-wait="<?php echo esc_attr((string) $auto['waiting']); ?>" data-auto-expires="<?php echo esc_attr((string) $auto['expires']); ?>">
<h2 id="jio-auth-modal-title" class="screen-reader-text"><?php esc_html_e('账户登录与注册', 'jio'); ?></h2>
<div class="modal-dialog" role="document">
<div class="sign-content">
<?php if ($image_html !== '') : ?><div class="sign-img absolute hide-sm"><?php echo $image_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
<?php require get_template_directory() . '/templates/parts/auth-content.php'; ?>
</div>
</div>