Browse Source

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

tags/3.5.0_alpha1
parent
commit
9bddbaf72d
3 changed files with 10 additions and 4 deletions
  1. +8
    -2
      pym/unix/unix.py
  2. +1
    -1
      pym/unix/utils/cl_unix_passwd.py
  3. +1
    -1
      pym/unix/utils/cl_unix_usermod.py

+ 8
- 2
pym/unix/unix.py View File

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


+ 1
- 1
pym/unix/utils/cl_unix_passwd.py View File

@@ -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)'
},
]

+ 1
- 1
pym/unix/utils/cl_unix_usermod.py View File

@@ -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,'


Loading…
Cancel
Save