feat: use primary identity display name in switcher dropdown
The account switcher dropdown previously showed the IMAP username (typically the email address) for the primary account. Now it falls back to the identity's display name when available, matching the behavior of secondary accounts which use their custom label. Priority order: global_alias session var > primary identity display name > IMAP username.
This commit is contained in:
@@ -188,7 +188,9 @@ class ident_switch extends rcube_plugin
|
||||
$iid = intval($iid_s);
|
||||
}
|
||||
|
||||
$accNames = [$_SESSION['global_alias'] ?? $rc->user->data['username']];
|
||||
$primaryIdentity = $rc->user->get_identity();
|
||||
$primaryName = !empty($primaryIdentity['name']) ? $primaryIdentity['name'] : null;
|
||||
$accNames = [$_SESSION['global_alias'] ?? $primaryName ?? $rc->user->data['username']];
|
||||
$accValues = [-1];
|
||||
$accSelected = -1;
|
||||
$iidMap = [0 => -1]; // primary account: iid 0 → select value -1
|
||||
|
||||
Reference in New Issue
Block a user