|
|
|
@ -289,15 +289,15 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
{
|
|
|
|
|
'progAccess':(2,),
|
|
|
|
|
'helpChapter':"Function",
|
|
|
|
|
'help':_("Mounting directories and synchronize the user preferences")
|
|
|
|
|
'help':_("Mounting resources and synchronize the user preferences")
|
|
|
|
|
},
|
|
|
|
|
# Examples
|
|
|
|
|
{
|
|
|
|
|
'progAccess':(0,),
|
|
|
|
|
'helpChapter':_("Examples"),
|
|
|
|
|
'help':pcs( " cl-client 192.168.0.1", self.column_width,
|
|
|
|
|
"# " + _("Adds settings for connecting to domain \
|
|
|
|
|
(ip 192.168.0.1)"),
|
|
|
|
|
"# " + _("Adds settings for connecting to domain") + \
|
|
|
|
|
" (ip 192.168.0.1)",
|
|
|
|
|
self.consolewidth-self.column_width )
|
|
|
|
|
},
|
|
|
|
|
# Options
|
|
|
|
@ -314,18 +314,18 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
|
'shortOption':"r",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("Removes the settings for connecting to a domain")
|
|
|
|
|
'help':_("remove the settings for connecting to a domain")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(2,),
|
|
|
|
|
'longOption':'progress',
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("Show progress bar for kde startup (works only with options \
|
|
|
|
|
'help':_("show progress bar for kde startup (works only with options \
|
|
|
|
|
--login)")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(1,),
|
|
|
|
|
'longOption':'progress',
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("Show progress bar for kde startup")
|
|
|
|
|
'help':_("show progress bar for kde startup")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,1,2),
|
|
|
|
|
'longOption':"vars",
|
|
|
|
@ -337,7 +337,7 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
'longOption':"color",
|
|
|
|
|
'optVal':_("WHEN"),
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("control whether color is used to distinguish file types. \
|
|
|
|
|
'help':_("control whether color is used. \
|
|
|
|
|
WHEN may be 'never', 'always', or 'auto'")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(1,),
|
|
|
|
@ -349,13 +349,13 @@ WHEN may be 'never', 'always', or 'auto'")
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
|
'longOption':"install",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("Adds use of scripts this package for window manager")
|
|
|
|
|
'help':_("add use of scripts this package for window manager")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
|
'longOption':"uninstall",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("Remove use of scripts this package for window manager and, \
|
|
|
|
|
if necessary, disconnects domain")
|
|
|
|
|
'help':_("remove use of scripts this package for window manager and, \
|
|
|
|
|
if necessary, removes from domain")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
|
'longOption':"mount",
|
|
|
|
@ -760,7 +760,7 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
self.printERROR(_("ERROR") + ": " + execStr)
|
|
|
|
|
self.printERROR(_("Not deleted from default runlevel"))
|
|
|
|
|
self.printERROR(_("Can not delete from default runlevel"))
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def createHome(self, userName, applyAlways=False, progress=False):
|
|
|
|
@ -829,7 +829,7 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
if not dirsAndFiles:
|
|
|
|
|
# Отмонтируем пользовательские ресурсы в случае ошибки
|
|
|
|
|
self.errorAndUnmountUserRes = True
|
|
|
|
|
self.printERROR(_("Not apply user profile"))
|
|
|
|
|
self.printERROR(_("Can not apply user profile"))
|
|
|
|
|
return False
|
|
|
|
|
self.chownR(homeDir, uid, gid, dirsAndFiles)
|
|
|
|
|
if not homeExists:
|
|
|
|
@ -930,12 +930,12 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
# Наложим профили
|
|
|
|
|
dirsAndFiles = self.applyProfilesFromSystem()
|
|
|
|
|
if not dirsAndFiles:
|
|
|
|
|
self.printERROR(_("Not apply 'install/domain' profiles"))
|
|
|
|
|
self.printERROR(_("Can not apply 'install/domain' profiles"))
|
|
|
|
|
return False
|
|
|
|
|
if hostAuth == "local":
|
|
|
|
|
self.printOK(_("Set profiles in local mode"))
|
|
|
|
|
self.printOK(_("Set profiles of local mode"))
|
|
|
|
|
else:
|
|
|
|
|
self.printOK(_("Set profiles in network mode"))
|
|
|
|
|
self.printOK(_("Set profiles of network mode"))
|
|
|
|
|
currentVersion = self.clVars.Get("cl_ver")
|
|
|
|
|
self.clVars.Write("os_remote_client", currentVersion)
|
|
|
|
|
self.clVars.Write("os_remote_auth", hostAuth)
|
|
|
|
@ -963,7 +963,7 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
return True
|
|
|
|
|
pathHome = "/var/calculate/client-home"
|
|
|
|
|
if foundMountRemote:
|
|
|
|
|
self.printWARNING(_("Samba resource [remote] is mount") + \
|
|
|
|
|
self.printWARNING(_("Samba resource [%s] is mount")%"remote" + \
|
|
|
|
|
" ...")
|
|
|
|
|
if foundMountHome:
|
|
|
|
|
self.printWARNING(str(pathHome) + " " +_("is mount")+
|
|
|
|
@ -980,7 +980,8 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
pathRemote = "/var/calculate/remote"
|
|
|
|
|
pwdRemote = self.clVars.Get("cl_remote_pw")
|
|
|
|
|
if not (domain and pwdRemote):
|
|
|
|
|
self.printERROR(_("Not found vaiable: cl_remote_pw") + " ...")
|
|
|
|
|
self.printERROR(_("Not found variable")+\
|
|
|
|
|
": cl_remote_pw ...")
|
|
|
|
|
return False
|
|
|
|
|
if not os.path.exists(pathRemote):
|
|
|
|
|
os.makedirs(pathRemote)
|
|
|
|
@ -990,8 +991,8 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
//%s/remote %s" %(escPwdRemote,domain,pathRemote)
|
|
|
|
|
textLine = self.execProg(mountStr)
|
|
|
|
|
if not (textLine == None):
|
|
|
|
|
self.printWARNING(_("Can not mount Samba resource [remote]") +\
|
|
|
|
|
" ...")
|
|
|
|
|
self.printWARNING(_("Can not mount Samba resource [%s]")%\
|
|
|
|
|
"remote" + " ...")
|
|
|
|
|
flagLocalProfile = True
|
|
|
|
|
# Если профили не актуальны накладываем новую версию профилей
|
|
|
|
|
if not self.applyRelevanceProfiles("local"):
|
|
|
|
@ -1003,8 +1004,8 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
self.printERROR(_("Can not unmount") + " /home")
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
self.printSUCCESS(_("Mount Samba resource [remote]") +\
|
|
|
|
|
" ...")
|
|
|
|
|
self.printSUCCESS(_("Mount Samba resource [%s]") % "remote" +\
|
|
|
|
|
" ...")
|
|
|
|
|
if (not foundMountHome) and (not flagLocalProfile):
|
|
|
|
|
if not os.path.exists(pathHome):
|
|
|
|
|
os.makedirs(pathHome)
|
|
|
|
@ -1062,7 +1063,7 @@ conjunction with the 'login' or 'logout'")
|
|
|
|
|
# Наложим профили
|
|
|
|
|
dirsAndFiles = self.applyProfilesFromSystem()
|
|
|
|
|
if not dirsAndFiles:
|
|
|
|
|
self.printERROR(_("Not apply 'install/domain' profiles"))
|
|
|
|
|
self.printERROR(_("Can not apply 'install/domain' profiles"))
|
|
|
|
|
return False
|
|
|
|
|
if not self.delDaemonAutostart("client"):
|
|
|
|
|
return False
|
|
|
|
@ -1100,7 +1101,7 @@ manager") + " ..."
|
|
|
|
|
# Наложим профили
|
|
|
|
|
dirsAndFiles = self.applyProfilesFromSystem()
|
|
|
|
|
if not dirsAndFiles:
|
|
|
|
|
self.printERROR(_("Not apply 'install/client' profiles"))
|
|
|
|
|
self.printERROR(_("Can not apply 'install/client' profiles"))
|
|
|
|
|
return False
|
|
|
|
|
remoteHost = clVars.Get("cl_remote_host")
|
|
|
|
|
if remoteHost:
|
|
|
|
@ -1132,7 +1133,7 @@ manager") + " ..."
|
|
|
|
|
# Наложим профили
|
|
|
|
|
dirsAndFiles = self.applyProfilesFromSystem()
|
|
|
|
|
if not dirsAndFiles:
|
|
|
|
|
self.printERROR(_("Not apply 'install/client' profiles"))
|
|
|
|
|
self.printERROR(_("Can not apply 'install/client' profiles"))
|
|
|
|
|
return False
|
|
|
|
|
if printSuccess:
|
|
|
|
|
self.printOK(messageOk)
|
|
|
|
@ -1187,8 +1188,8 @@ manager") + " ..."
|
|
|
|
|
foundMountRemote =self.isMount("/var/calculate/remote" ,"cifs")
|
|
|
|
|
foundMountHome =self.isMount("/var/calculate/client-home","none",False)
|
|
|
|
|
if foundMountRemote:
|
|
|
|
|
self.printWARNING(_("Samba resource [remote] mount") + \
|
|
|
|
|
" ...")
|
|
|
|
|
self.printWARNING(_("Samba resource [%s] is mount")%\
|
|
|
|
|
"remote" + " ...")
|
|
|
|
|
else:
|
|
|
|
|
if pwd:
|
|
|
|
|
userPwd = pwd
|
|
|
|
@ -1204,11 +1205,11 @@ manager") + " ..."
|
|
|
|
|
//%s/remote %s" %(escPwdRemote,domain,pathRemote)
|
|
|
|
|
textLine = self.execProg(mountStr)
|
|
|
|
|
if not (textLine == None):
|
|
|
|
|
self.printERROR(_("Can not mount Samba resource [remote]") + \
|
|
|
|
|
" ...")
|
|
|
|
|
self.printERROR(_("Can not mount Samba resource [%s]")%\
|
|
|
|
|
"remote" + " ...")
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
self.printSUCCESS(_("Mount Samba resource [remote]") + \
|
|
|
|
|
self.printSUCCESS(_("Mount Samba resource [%s]")%"remote" + \
|
|
|
|
|
" ...")
|
|
|
|
|
self.clVars.Write("cl_remote_host", domain, False, "local")
|
|
|
|
|
self.clVars.Write("cl_remote_pw", userPwd, False, "local")
|
|
|
|
@ -1235,7 +1236,7 @@ manager") + " ..."
|
|
|
|
|
bindPw = self.clVars.Get("ld_bind_pw")
|
|
|
|
|
# запишем их
|
|
|
|
|
if not (servDn and unixDN and bindDn and bindPw):
|
|
|
|
|
self.printERROR(_("Not found variables:"))
|
|
|
|
|
self.printERROR(_("Not found variables") + ":")
|
|
|
|
|
self.printERROR("ld_services_dn or ld_unix_dn \
|
|
|
|
|
or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
return False
|
|
|
|
@ -1252,7 +1253,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
# Наложим профили
|
|
|
|
|
dirsAndFiles = self.applyProfilesFromSystem()
|
|
|
|
|
if not dirsAndFiles:
|
|
|
|
|
self.printERROR(_("Not apply 'install/domain' profiles"))
|
|
|
|
|
self.printERROR(_("Can not apply 'install/domain' profiles"))
|
|
|
|
|
return False
|
|
|
|
|
# Рестартуем dbus
|
|
|
|
|
self.restartDBus()
|
|
|
|
@ -1312,7 +1313,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
self.createClVars()
|
|
|
|
|
# В случае компьютера вне домена
|
|
|
|
|
if not self.clVars.Get("cl_remote_host"):
|
|
|
|
|
self.printSUCCESS(_("To be used by local profile."))
|
|
|
|
|
self.printSUCCESS(_("To be used local profile."))
|
|
|
|
|
return True
|
|
|
|
|
connectDomain = self.isDomain()
|
|
|
|
|
if not connectDomain:
|
|
|
|
@ -1320,7 +1321,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
self.errorAndUnmountUserRes = True
|
|
|
|
|
return False
|
|
|
|
|
elif not connectDomain[0]:
|
|
|
|
|
self.printERROR(_("Can not mount Samba resource [remote]") + \
|
|
|
|
|
self.printERROR(_("Can not mount Samba resource [%s]")%"remote"+\
|
|
|
|
|
" ...")
|
|
|
|
|
# Отмонтируем пользовательские ресурсы в случае ошибки
|
|
|
|
|
self.errorAndUnmountUserRes = True
|
|
|
|
@ -1459,10 +1460,10 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
if flagError:
|
|
|
|
|
# Отмонтируем пользовательские ресурсы в случае ошибки
|
|
|
|
|
self.errorAndUnmountUserRes = True
|
|
|
|
|
self.printERROR(_("Can not keep a user profile in the domain"))
|
|
|
|
|
self.printERROR(_("Can not save a user profile in the domain"))
|
|
|
|
|
return False
|
|
|
|
|
self.printSUCCESS(_("Keep a user profile in the domain"))
|
|
|
|
|
self.printOK(_("Umount user resource in domain") + " ...")
|
|
|
|
|
self.printSUCCESS(_("Saved a user profile in the domain"))
|
|
|
|
|
self.printOK(_("Umounted user resource in domain") + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def umountUserResNoSync(self, userName, printError=True, printSuccess=True,
|
|
|
|
@ -1481,7 +1482,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
# В случае компьютера вне домена
|
|
|
|
|
if not self.clVars.Get("cl_remote_host"):
|
|
|
|
|
if printSuccess:
|
|
|
|
|
self.printSUCCESS(_("To be used by local profile."))
|
|
|
|
|
self.printSUCCESS(_("To be used local profile."))
|
|
|
|
|
return True
|
|
|
|
|
# Подсоединяемся к серверу
|
|
|
|
|
domain = self.clVars.Get("cl_remote_host")
|
|
|
|
@ -1536,7 +1537,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
self.printERROR(_("Can not unmount user %s resource")%userName)
|
|
|
|
|
return False
|
|
|
|
|
if printSuccess:
|
|
|
|
|
self.printOK(_("Umount user %s resources") %userName + " ...")
|
|
|
|
|
self.printOK(_("Umounted user %s resources") %userName + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def isSessionUser(self, userName):
|
|
|
|
@ -1652,7 +1653,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
self.createClVars()
|
|
|
|
|
# В случае компьютера вне домена
|
|
|
|
|
if not self.clVars.Get("cl_remote_host"):
|
|
|
|
|
self.printSUCCESS(_("To be used by local profile."))
|
|
|
|
|
self.printSUCCESS(_("To be used local profile."))
|
|
|
|
|
return True
|
|
|
|
|
# Проверим что компьютер в домене и смонтирован [remote]
|
|
|
|
|
connectDomain = self.isDomain()
|
|
|
|
@ -1661,7 +1662,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
self.errorAndUnmountUserRes = True
|
|
|
|
|
return False
|
|
|
|
|
elif not connectDomain[0]:
|
|
|
|
|
self.printERROR(_("Can not mount Samba resource [remote]") + \
|
|
|
|
|
self.printERROR(_("Can not mount Samba resource [%s]")%"remote"+ \
|
|
|
|
|
" ...")
|
|
|
|
|
# Отмонтируем пользовательские ресурсы в случае ошибки
|
|
|
|
|
self.errorAndUnmountUserRes = True
|
|
|
|
@ -1930,8 +1931,8 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
else:
|
|
|
|
|
self.createUserFile(logOutFile,"SUCCESS", uid, gid)
|
|
|
|
|
|
|
|
|
|
self.printSUCCESS(_("Mount user resource in domain"))
|
|
|
|
|
self.printOK(_("Get a user profile in the domain") + " ...")
|
|
|
|
|
self.printSUCCESS(_("Mounted user resource of the domain"))
|
|
|
|
|
self.printOK(_("Get a user profile from the domain") + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def mountSleepRes(self,userName,userPwd,uid,gid,res,path):
|
|
|
|
@ -2000,13 +2001,13 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
execStr = "cp -r '%s' '%s'" %(fd, movedPath)
|
|
|
|
|
textLine = self.execProg(execStr)
|
|
|
|
|
if not (textLine == None):
|
|
|
|
|
self.printERROR(_("Can not exec ") + " " + str(execStr) +\
|
|
|
|
|
self.printERROR(_("Can not exec") + " " + str(execStr) +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
|
execStr = "rm -rf '%s'" %fd
|
|
|
|
|
textLine = self.execProg(execStr)
|
|
|
|
|
if not (textLine == None):
|
|
|
|
|
self.printERROR(_("Can not exec ") + " " + str(execStr) +\
|
|
|
|
|
self.printERROR(_("Can not exec") + " " + str(execStr) +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
|
os.chdir(pathProg)
|
|
|
|
@ -2230,7 +2231,7 @@ or ld_bind_dn or ld_bind_pw")
|
|
|
|
|
os.chown(configFileName,uid,gid)
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
self.printERROR(_("Can not rsync") + " " + str(sync) +\
|
|
|
|
|
self.printERROR(_("Can not execute rsync") + " " + str(sync) +\
|
|
|
|
|
" ...")
|
|
|
|
|
flagError = True
|
|
|
|
|
else:
|
|
|
|
|