From: Dietmar Maurer Date: Wed, 11 Jan 2012 11:30:58 +0000 (+0100) Subject: allow to filter enabled/disabled user X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=commitdiff_plain;h=cb6f2f93ed18ee259ff2aae4434974fddcc53c57 allow to filter enabled/disabled user --- diff --git a/Makefile b/Makefile index 44bb5bc..9b4c4d0 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ RELEASE=2.0 VERSION=1.0 PACKAGE=libpve-access-control -PKGREL=5 +PKGREL=6 DESTDIR= PREFIX=/usr diff --git a/PVE/API2/User.pm b/PVE/API2/User.pm index 0637f76..6272cad 100644 --- a/PVE/API2/User.pm +++ b/PVE/API2/User.pm @@ -38,7 +38,13 @@ __PACKAGE__->register_method ({ description => "User index.", parameters => { additionalProperties => 0, - properties => {}, + properties => { + enabled => { + type => 'boolean', + description => "Optional filter for enable property.", + optional => 1, + } + }, }, returns => { type => 'array', @@ -59,8 +65,14 @@ __PACKAGE__->register_method ({ foreach my $user (keys %{$usercfg->{users}}) { next if $user eq 'root'; - + my $entry = &$extract_user_data($usercfg->{users}->{$user}); + + if (defined($param->{enabled})) { + next if $entry->{enable} && !$param->{enabled}; + next if !$entry->{enable} && $param->{enabled}; + } + $entry->{userid} = $user; push @$res, $entry; } diff --git a/changelog.Debian b/changelog.Debian index d928c01..bc7426c 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -1,3 +1,9 @@ +libpve-access-control (1.0-6) unstable; urgency=low + + * API change: allow to filter enabled/disabled users. + + -- Proxmox Support Team Wed, 11 Jan 2012 12:30:37 +0100 + libpve-access-control (1.0-5) unstable; urgency=low * add a way to return file changes (diffs): set_result_changes()