master3.3
Самоукин Алексей 14 years ago
parent 373124b072
commit 55dc92b2dc

@ -37,7 +37,7 @@ from cl_print import color_print
from cl_ldap import ldapUser
from client.progressbar import ProgressBar
from cl_utils import runOsCommand, getpathenv, getModeFile, removeDir, isMount,\
appendProgramToEnvFile, removeProgramToEnvFile
appendProgramToEnvFile, removeProgramToEnvFile, pathJoin
from _cl_keys import getKey, clearKey
from convertenv import convertEnv
from encrypt import encrypt
@ -2055,6 +2055,22 @@ you need to remove it from the previous domain"))
return False
return True
def copyHomeDirs(self):
cacheObj = userCache()
loginUsersData = cacheObj.getLoginDomainUsers()
if loginUsersData is False:
return False
previousHome = "/var/calculate/client-home"
for userName, x, uid, gid, gecos, directory, shell in loginUsersData:
srcDir = pathJoin(previousHome, directory)
destDir = directory
if os.path.exists(srcDir):
if not os.path.exists(destDir):
if not self.copyTemplateDir(srcDir, destDir):
return False
return True
def mountRemote(self):
"""Монтирование remote если компьютер в домене
@ -2105,6 +2121,8 @@ you need to remove it from the previous domain"))
return False
if not self.cAddCacheUsersFromSystem():
return False
if not self.copyHomeDirs():
return False
if beforeRemoteAuth != self.clVars.Get('os_remote_auth'):
self.restartDBus()
return True

@ -523,6 +523,14 @@ class userCache(color_print):
return False
return True
def getLoginDomainUsers(self):
'''Get all domain login users'''
cacheCreatePasswdObj = cacheCreatePasswd()
cacheListCreatePasswdData = cacheCreatePasswdObj.getData()
if cacheListCreatePasswdData is False:
return False
return cacheListCreatePasswdData
def addCacheUsersFromSystem(self):
'''Add cache users from system'''
cachePasswdObj = cachePasswd()
@ -533,7 +541,7 @@ class userCache(color_print):
passwdObj = passwd()
cacheCreatePasswdObj = cacheCreatePasswd()
cacheListCreatePasswdData = cacheCreatePasswdObj.getData()
if cacheListPasswdData is False:
if cacheListCreatePasswdData is False:
return False
# remove deleted users
cacheUsers = map(lambda x: x[0], cacheListPasswdData)

Loading…
Cancel
Save