Support personal profile LinkedIn posting
- OAuth callback fetches /v2/userinfo to store member_id + name, auto-creates a 'profile' personal page on first connect - Page modal adds type selector (personal/org), hides org ID for personal - renderLinkedinPages shows 'Personal' badge instead of org ID - botconfig saves type field; personal pages omit organization_id Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9b5bf89d11
commit
09e3406847
4 changed files with 47 additions and 6 deletions
|
|
@ -169,10 +169,10 @@ if ($action === 'add_linkedin_page' || $action === 'save_linkedin_page') {
|
|||
}
|
||||
if (!isset($config['linkedin'])) $config['linkedin'] = [];
|
||||
if (!isset($config['linkedin']['pages'])) $config['linkedin']['pages'] = [];
|
||||
$config['linkedin']['pages'][$name] = [
|
||||
'label' => trim($data['label'] ?? $name),
|
||||
'organization_id' => trim($data['organization_id'] ?? ''),
|
||||
];
|
||||
$type = in_array($data['type'] ?? '', ['personal', 'organization']) ? $data['type'] : 'organization';
|
||||
$entry = ['label' => trim($data['label'] ?? $name), 'type' => $type];
|
||||
if ($type === 'organization') $entry['organization_id'] = trim($data['organization_id'] ?? '');
|
||||
$config['linkedin']['pages'][$name] = $entry;
|
||||
write_config($config_path, $config);
|
||||
Audit::log($db, 'botconfig_linkedin_page_' . ($action === 'add_linkedin_page' ? 'add' : 'save'), $pid, $name);
|
||||
echo json_encode(['ok' => true]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue