Исправлена смена домашней директории

legacy27
bovenliggende 7fd4f635e1
commit 9bddbaf72d

@ -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:

@ -58,6 +58,6 @@ class ClUnixPasswdAction(Action):
{'name': 'user_change',
'method': 'Unix.modify_user(ur_unix_login,ur_unix_hash,'
'ur_unix_pw_delete_set,'
'None,None,None,ur_unix_lock_set, None)'
'None,None,None,ur_unix_lock_set,None,None)'
},
]

@ -59,7 +59,7 @@ class ClUnixUsermodAction(Action):
'method': 'Unix.modify_user(ur_unix_login,ur_unix_hash,'
'ur_unix_pw_delete_set,ur_unix_gid,'
'ur_unix_shell,ur_unix_visible_set,ur_unix_lock_set,'
'ur_unix_comment)',
'ur_unix_comment,ur_unix_home_path)',
},
{'name': 'remove_groups',
'method': 'Unix.remove_user_from_groups(unix.ur_unix_login,'

Laden…
Annuleren
Opslaan