|
|
|
@ -373,7 +373,7 @@ class UnixUsers(object):
|
|
|
|
|
return flag == "1"
|
|
|
|
|
|
|
|
|
|
def modify_user(self, username, pw=None, gid=None, shell=None, visible=None,
|
|
|
|
|
lock=None, comment=None):
|
|
|
|
|
lock=None, comment=None, homedir=None):
|
|
|
|
|
attributes = []
|
|
|
|
|
if pw is not None:
|
|
|
|
|
attributes.append((ldap.MOD_REPLACE, 'userPassword', str(pw)))
|
|
|
|
@ -383,6 +383,8 @@ class UnixUsers(object):
|
|
|
|
|
attributes.append((ldap.MOD_REPLACE, 'loginShell', shell))
|
|
|
|
|
if comment is not None:
|
|
|
|
|
attributes.append((ldap.MOD_REPLACE, 'cn', comment))
|
|
|
|
|
if homedir is not None:
|
|
|
|
|
attributes.append((ldap.MOD_REPLACE, 'homeDirectory', homedir))
|
|
|
|
|
if visible is not None:
|
|
|
|
|
attributes.append(
|
|
|
|
|
(ldap.MOD_REPLACE, 'shadowFlag',
|
|
|
|
@ -556,7 +558,7 @@ class Unix(Ldap):
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def modify_user(self, login, pw, pw_delete, gid, shell, visible, lock,
|
|
|
|
|
comment):
|
|
|
|
|
comment,homedir):
|
|
|
|
|
""""
|
|
|
|
|
Изменить параметры пользователя в LDAP
|
|
|
|
|
"""
|
|
|
|
@ -574,6 +576,10 @@ class Unix(Ldap):
|
|
|
|
|
params['comment'] = comment
|
|
|
|
|
self.printSUCCESS(
|
|
|
|
|
_("Changed comment for user %s") % user.username)
|
|
|
|
|
if homedir is not None and user.homedir != homedir:
|
|
|
|
|
params['homedir'] = homedir
|
|
|
|
|
self.printSUCCESS(
|
|
|
|
|
_("Changed home directory for user %s") % user.username)
|
|
|
|
|
if pw != UnixUsers.DeletedPassword or pw_delete:
|
|
|
|
|
params['pw'] = pw
|
|
|
|
|
if pw_delete:
|
|
|
|
|