diff options
author | Pavel Zuna <pzuna@redhat.com> | 2009-06-16 13:16:03 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-07-02 13:33:00 -0400 |
commit | 4b993782e6c171ffd159c8ed8489fcb787886322 (patch) | |
tree | 74dff5891f5b47ff3daff3b8543e015fb297fa8b /ipalib/plugins/passwd.py | |
parent | 9352d2fc10dde6ed8cc57f2acee3e27ed7e340c2 (diff) | |
download | freeipa-4b993782e6c171ffd159c8ed8489fcb787886322.tar.gz freeipa-4b993782e6c171ffd159c8ed8489fcb787886322.tar.xz freeipa-4b993782e6c171ffd159c8ed8489fcb787886322.zip |
Delete plugins using old LDAP backend.
Diffstat (limited to 'ipalib/plugins/passwd.py')
-rw-r--r-- | ipalib/plugins/passwd.py | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/ipalib/plugins/passwd.py b/ipalib/plugins/passwd.py deleted file mode 100644 index 06b60fd72..000000000 --- a/ipalib/plugins/passwd.py +++ /dev/null @@ -1,71 +0,0 @@ -# Authors: -# Rob Crittenden <rcritten@redhat.com> -# -# Copyright (C) 2008 Red Hat -# see file 'COPYING' for use and warranty information -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; version 2 only -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -""" -Frontend plugins for password changes. -""" - -from ipalib import api, errors, util -from ipalib import Command # Plugin base classes -from ipalib import Str, Password # Parameter types - - -class passwd(Command): - 'Change a user password.' - - takes_args = ( - Str('principal', - cli_name='user', - primary_key=True, - autofill=True, - create_default=lambda **kw: util.get_current_principal(), - ), - Password('password'), - ) - - def execute(self, principal, password): - """ - Execute the passwd operation. - - The dn should not be passed as a keyword argument as it is constructed - by this method. - - Returns the entry - - :param principal: The login name or principal of the user - :param password: the new password - """ - if principal.find('@') > 0: - u = principal.split('@') - if len(u) > 2: - raise errors.MalformedUserPrincipal(principal=principal) - else: - principal = principal+"@"+self.api.env.realm - dn = self.Backend.ldap.find_entry_dn( - "krbprincipalname", - principal, - "posixAccount" - ) - return self.Backend.ldap.modify_password(dn, newpass=password) - - def output_for_cli(self, textui, result, principal, password): - assert password is None - textui.print_plain('Changed password for "%s"' % principal) - -api.register(passwd) |