fix(user-center): connect certification workflow
This commit is contained in:
1 parent
a7f3caec59
commit
d3bf75fbea
13 files changed
+97
-23
No files matched your search
@@ -525,7 +525,35 @@ class UsersMenus {
|
||||
echo '<td>' . esc_html((string) ($row['display_name'] ?? '')) . '</td>';
|
||||
echo '<td>' . esc_html((string) ($row['user_email'] ?? '')) . '</td>';
|
||||
echo '<td>' . esc_html($st) . '</td>';
|
||||
echo '<td>' . esc_html((string) ($row['verify_reason'] ?? '')) . '</td>';
|
||||
$apply = get_user_meta($uid, 'aksrt_user_verify_apply', true);
|
||||
$apply = is_array($apply) ? $apply : [];
|
||||
$type_labels = [];
|
||||
if (class_exists('\AKSRT\User\AuthApply')) {
|
||||
foreach ((array) \AKSRT\User\AuthApply::settings()['types'] as $type) {
|
||||
$type_labels[(string) ($type['slug'] ?? '')] = (string) ($type['label'] ?? '');
|
||||
}
|
||||
}
|
||||
echo '<td>';
|
||||
if ($apply) {
|
||||
$type_key = sanitize_key((string) ($apply['type'] ?? ''));
|
||||
echo '<strong>' . esc_html((string) ($apply['name'] ?? '')) . '</strong>';
|
||||
if ($type_key !== '') {
|
||||
echo '<div><span class="dashicons dashicons-id" aria-hidden="true"></span> ' . esc_html($type_labels[$type_key] ?? $type_key) . '</div>';
|
||||
}
|
||||
if (!empty($apply['desc'])) {
|
||||
echo '<div>' . esc_html((string) $apply['desc']) . '</div>';
|
||||
}
|
||||
if (!empty($apply['msg'])) {
|
||||
echo '<div class="description">' . esc_html((string) $apply['msg']) . '</div>';
|
||||
}
|
||||
foreach ((array) ($apply['img'] ?? []) as $image_url) {
|
||||
echo '<a href="' . esc_url((string) $image_url) . '" target="_blank" rel="noopener noreferrer"><img src="' . esc_url((string) $image_url) . '" alt="" style="width:56px;height:56px;object-fit:cover;margin:6px 6px 0 0;border-radius:4px;" /></a>';
|
||||
}
|
||||
}
|
||||
if (!empty($row['verify_reason'])) {
|
||||
echo '<div class="description">' . esc_html((string) $row['verify_reason']) . '</div>';
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td>';
|
||||
if ($st === 'pending') {
|
||||
foreach (['verified' => __('通过', 'aksrt'), 'rejected' => __('拒绝', 'aksrt')] as $action => $label) {
|
||||
|
||||
@@ -600,7 +600,6 @@ class SchemaUsers {
|
||||
['key' => 'user_verify_badge_text', 'label' => '认证徽标文案', 'type' => 'input', 'default' => '已认证'],
|
||||
]],
|
||||
['key' => 'workflow', 'title' => '审核流程', 'fields' => [
|
||||
['key' => 'user_verify_accept_email_verified', 'label' => '邮箱验证通过视为已认证', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_verify_require_manual_review', 'label' => '保留人工审核位', 'type' => 'switch', 'default' => false],
|
||||
['key' => 'user_verify_apply_option', 'label' => '申请类型选项', 'type' => 'textarea', 'default' => "real_name|实名认证\norganization|企业认证", 'desc' => '每行:slug|显示名称'],
|
||||
]],
|
||||
|
||||
@@ -189,6 +189,17 @@ trait UserControllerVerifyIntegrations {
|
||||
} elseif ($status === 'verified') {
|
||||
delete_user_meta($user_id, 'aksrt_user_verify_reason');
|
||||
}
|
||||
if ($status === 'verified') {
|
||||
$apply = get_user_meta($user_id, 'aksrt_user_verify_apply', true);
|
||||
if (is_array($apply)) {
|
||||
update_user_meta($user_id, 'aksrt_user_verify_info', [
|
||||
'name' => (string) ($apply['name'] ?? ''),
|
||||
'desc' => (string) ($apply['desc'] ?? ''),
|
||||
'type' => (string) ($apply['type'] ?? ''),
|
||||
'time' => current_time('Y-m-d H:i'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$log = get_option('aksrt_verify_review_log', []);
|
||||
if (!is_array($log)) {
|
||||
@@ -219,6 +230,8 @@ trait UserControllerVerifyIntegrations {
|
||||
$reviewer = $reviewer_id > 0 ? get_userdata($reviewer_id) : null;
|
||||
$status = sanitize_key((string) ($row['verify_status'] ?? 'pending'));
|
||||
$email_verified = (bool) get_user_meta($user_id, 'aksrt_email_verified', true);
|
||||
$application = get_user_meta($user_id, 'aksrt_user_verify_apply', true);
|
||||
$application = is_array($application) ? $application : [];
|
||||
|
||||
return [
|
||||
'user_id' => $user_id,
|
||||
@@ -229,6 +242,7 @@ trait UserControllerVerifyIntegrations {
|
||||
'requested_at' => (string) ($row['user_registered'] ?? ''),
|
||||
'reviewed_at' => (string) ($row['reviewed_at'] ?? ''),
|
||||
'email_verified' => $email_verified,
|
||||
'application' => $application,
|
||||
'reviewer' => $this->build_admin_user_summary($reviewer_id, $reviewer),
|
||||
'history_count' => count($this->get_verify_history_for_user($user_id)),
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user