On 04/25/2012 04:41 PM, Martin Kosek wrote:
Password policy plugin sorts password policies by its COS priority.
However, when the pwpolicy-find command is run with --pkey-only,
the resulting entries do not contain COS priority and the sort
function crashes.

This patch makes sure that cospriority is present in the time
of the result sorting process and removes the cospriority again
when the sorting is done. This way, the entries are sorted properly
both with and without --pkey-only flag.

Previous entries_sortfn member attribute of LDAPSearch class
containing custom user sorting function was replaced just with
a flag indicating if a sorting in LDAPSearch shall be done at all.
This change makes it possible to sort entries in a custom
post_callback which is much more powerful (and essential for
sorting like in pwpolicy plugin) approach than a plain sorting


Attaching patch which disables paging in password policy page. More details in patch description.
Petr Vobornik
From 7eb92076c92be146efbb729eadd92e019e51bab7 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Thu, 26 Apr 2012 08:54:25 +0200
Subject: [PATCH] Paging disable for password policies

Password policies are sorted by priority. When paging is enabled, table facet uses pwpolicy-find --pkey-only to get all pwpolicies keys. Those keys are sorted on server by priority but table facet sorts them again. This breaks the priority sorting.

This patch disables the paging in passord policy serch page so the keys are sorted by priority.

TODO: we should inspect sorting in table facet more deeply and disable it if it don't break anything.

 install/ui/policy.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/install/ui/policy.js b/install/ui/policy.js
index d48cacc493bf02d50c378af59ba0e61ef1084c73..604664f1263e97a7e0007b26b392372fb87b0923 100644
--- a/install/ui/policy.js
+++ b/install/ui/policy.js
@@ -33,7 +33,9 @@ IPA.pwpolicy.entity = function(spec) {
-            columns:['cn','cospriority']}).
+            pagination: false,
+            columns:['cn','cospriority']
+        }).

Freeipa-devel mailing list

Reply via email to