mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-10-04 22:29:06 +00:00
api: users: use public regex directly to parse out realm
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
525a931b98
commit
d658d04acb
@ -10,6 +10,7 @@ use PVE::JSONSchema qw(get_standard_option register_standard_option);
|
|||||||
use PVE::SafeSyslog;
|
use PVE::SafeSyslog;
|
||||||
|
|
||||||
use PVE::AccessControl;
|
use PVE::AccessControl;
|
||||||
|
use PVE::Auth::Plugin;
|
||||||
use PVE::TokenConfig;
|
use PVE::TokenConfig;
|
||||||
|
|
||||||
use PVE::RESTHandler;
|
use PVE::RESTHandler;
|
||||||
@ -197,9 +198,9 @@ __PACKAGE__->register_method ({
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
my (undef, undef, $realm) = PVE::AccessControl::verify_username($user, 1);
|
if ($user =~ /($PVE::Auth::Plugin::realm_regex)$/) {
|
||||||
if (defined($realm) && exists($domainids->{$realm})) {
|
my $realm = $1;
|
||||||
$entry->{'realm-type'} = $domainids->{$realm}->{type};
|
$entry->{'realm-type'} = $domainids->{$realm}->{type} if exists $domainids->{$realm};
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry->{userid} = $user;
|
$entry->{userid} = $user;
|
||||||
|
Loading…
Reference in New Issue
Block a user