From bd227b356280f54f48bc01901275833a51f87fd7 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 16 Sep 2011 15:08:17 -0400 Subject: Require current password when using passwd to change your own password. Add a new required parameter, current_password. In order to ask this first I added a new parameter option, sortorder. The lower the value the earlier it will be prompted for. I also changed the way autofill works. It will attempt to get the default and if it doesn't get anything will continue prompting interactively. Since current_password is required I'm passing a magic value that means changing someone else's password. We need to pass something since current_password is required. The python-ldap passwd command doesn't seem to use the old password at all so I do a simple bind to validate it. https://fedorahosted.org/freeipa/ticket/1808 --- ipalib/frontend.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ipalib/frontend.py') diff --git a/ipalib/frontend.py b/ipalib/frontend.py index c2ae4e744..61e7f493f 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -777,6 +777,8 @@ class Command(HasParam): self._create_param_namespace('options') def get_key(p): if p.required: + if p.sortorder < 0: + return p.sortorder if p.default_from is None: return 0 return 1 -- cgit