|
|
|
@ -254,7 +254,7 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
bindPw = self.clVars.Get("ld_bind_pw")
|
|
|
|
|
if not (bindDn or bindPw):
|
|
|
|
|
if printError:
|
|
|
|
|
self.printERROR(_("not found LDAP bind DN or password") +\
|
|
|
|
|
self.printERROR(_("Not found LDAP bind DN or password") +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
|
ldapObj = cl_utils2.ldapFun(bindDn, bindPw, host)
|
|
|
|
@ -449,7 +449,7 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
# uid и gid и mail из passwd
|
|
|
|
|
uidGid = self.getUserPasswdInfo(userName)
|
|
|
|
|
if not uidGid:
|
|
|
|
|
self.printERROR(_(" Not found user uid and gid"))
|
|
|
|
|
self.printERROR(_("Not found user uid and gid"))
|
|
|
|
|
return False
|
|
|
|
|
uid = int(uidGid[0])
|
|
|
|
|
gid = int(uidGid[1])
|
|
|
|
@ -460,14 +460,18 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
self.clVars.Set('cl_root_path',homeDir,True)
|
|
|
|
|
homeExists = os.path.exists(homeDir)
|
|
|
|
|
|
|
|
|
|
if homeExists and set(os.listdir(homeDir))-set(["Home","Disks"]):
|
|
|
|
|
self.printWARNING(_("home dir %s exists")%homeDir)
|
|
|
|
|
alwProfilePath = self.getAlwaysProfilePath()
|
|
|
|
|
if not alwProfilePath:
|
|
|
|
|
return True
|
|
|
|
|
if homeExists:
|
|
|
|
|
self.printWARNING(_("Home dir %s exists")%homeDir)
|
|
|
|
|
if set(os.listdir(homeDir))-set(["Home","Disks"]):
|
|
|
|
|
# Получаем пути к профилям постоянного наложения
|
|
|
|
|
alwProfilePath = self.getAlwaysProfilePath()
|
|
|
|
|
if not alwProfilePath:
|
|
|
|
|
return True
|
|
|
|
|
# Записываем пути к профилям постоянного наложения
|
|
|
|
|
#в переменную
|
|
|
|
|
self.printSUCCESS(_("Apply always profiles") + " ...")
|
|
|
|
|
self.clVars.Set('cl_profile_path',alwProfilePath, True)
|
|
|
|
|
|
|
|
|
|
self.printSUCCESS(_("apply always profiles") + " ...")
|
|
|
|
|
self.clVars.Set('cl_profile_path',alwProfilePath, True)
|
|
|
|
|
if not os.path.exists(homeDir):
|
|
|
|
|
self.createUserDir(uid, gid, homeDir)
|
|
|
|
|
# Записываем переменную логин
|
|
|
|
@ -481,8 +485,8 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
return False
|
|
|
|
|
self.chownR(homeDir, uid, gid, dirsAndFiles)
|
|
|
|
|
if not homeExists:
|
|
|
|
|
self.printSUCCESS(_("created home dir %s")%homeDir + " ...")
|
|
|
|
|
self.printSUCCESS(_("User Profile is configured") + " ...")
|
|
|
|
|
self.printSUCCESS(_("Created home dir %s")%homeDir + " ...")
|
|
|
|
|
self.printSUCCESS(_("User account is configured") + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def isDomain(self):
|
|
|
|
@ -567,7 +571,8 @@ cl_remote_pw") + " ...")
|
|
|
|
|
pathHome = "/var/calculate/home"
|
|
|
|
|
foundMountRemote =self.isMount(pathRemote ,"cifs")
|
|
|
|
|
foundMountHome =self.isMount(pathHome ,"none",False)
|
|
|
|
|
if not self.clVars.Get("cl_remote_host"):
|
|
|
|
|
domain = self.clVars.Get("cl_remote_host")
|
|
|
|
|
if not domain:
|
|
|
|
|
self.printWARNING("The computer is not in domain")
|
|
|
|
|
return True
|
|
|
|
|
if foundMountRemote:
|
|
|
|
@ -587,7 +592,7 @@ cl_remote_pw") + " ...")
|
|
|
|
|
self.execProg("calculate -P install/6intranet")
|
|
|
|
|
self.clVars.Delete("cl_remote_host","local")
|
|
|
|
|
self.clVars.Delete("cl_remote_pw","local")
|
|
|
|
|
self.printOK(_("Deleted in domain") + " ...")
|
|
|
|
|
self.printOK(_("Computer removed from domain %s")%domain + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def addDomain(self, domain):
|
|
|
|
@ -672,7 +677,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
--set-ldap_root=%s --set-ldap_bind=%s --set-ldap_bindpw=%s -P \
|
|
|
|
|
install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
|
|
|
|
|
self.execProg(execStr)
|
|
|
|
|
self.printOK(_("Added in domain %s")%domain + " ...")
|
|
|
|
|
self.printOK(_("Computer added to domain %s")%domain + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def umountUserRes(self, userName):
|
|
|
|
@ -826,7 +831,8 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
|
|
|
|
|
--exclude="*~" --exclude="/Home" --exclude="/Disks" \
|
|
|
|
|
-a -b --delete -x %s/ %s/'%(userHome,homeProfile)
|
|
|
|
|
else:
|
|
|
|
|
self.printERROR(_("Method syncUser: option sync incorrect"))
|
|
|
|
|
self.printERROR(_("Method syncUser: option sync=%s incorrect")\
|
|
|
|
|
%str(sync))
|
|
|
|
|
return False
|
|
|
|
|
if execStr:
|
|
|
|
|
textLine = self.execProg(execStr)
|
|
|
|
|