Отмена опции '-s' у cl_client

git-svn-id: http://svn.calculate.ru/calculate2/calculate-client/trunk@626 c91db197-33c1-4113-bf15-f8a5c547ca64
develop
asamoukin 16 years ago
parent 7eca4a2029
commit 1b16fb56f6

@ -156,7 +156,7 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
'longOption':"vars",
'optVal':_("TYPE_VAR"),
'helpChapter':_("Common options"),
'help':_("print variables (TYPE_VAR=all' - print full var)")
'help':_("print variables (TYPE_VAR - all:full var)")
},
{'progAccess':(0,1,2),
'longOption':"color",
@ -176,12 +176,6 @@ WHEN may be 'never', 'always', or 'auto'")
'helpChapter':_("Common options"),
'help':_("mount [remote] resource for Samba (calculate-server)")
},
{'progAccess':(0,),
'shortOption':"s",
'longOption':"save",
'helpChapter':_("Common options"),
'help':_("save passwords domain, if you run with option '-r'")
},
{'progAccess':(2,),
'longOption':"login",
'helpChapter':_("Common options"),
@ -492,12 +486,8 @@ conjunction with the 'login' or 'logout'")
self.createClVars()
uidGid = False
# Подсоединяемся к серверу
domain = False
domain = self.clVars.Get("cl_remote_host")
connectLdap = False
foundMountRemote = self.isMount("/var/calculate/remote" ,"cifs")
foundMountHome = self.isMount("/var/calculate/home" ,"none", False)
if foundMountRemote and foundMountHome:
domain = self.clVars.Get("cl_remote_host")
if domain:
if not self.getLdapObjBind(domain):
return False
@ -555,10 +545,10 @@ conjunction with the 'login' or 'logout'")
def isDomain(self):
"""Находится ли компьютер в домене"""
self.createClVars(self.clVars)
foundMountRemote = self.isMount("/var/calculate/remote" ,"cifs")
foundMountHome = self.isMount("/var/calculate/home" ,"none", False)
foundMountRemote =self.isMount("/var/calculate/remote" ,"cifs")
foundMountHome =self.isMount("/var/calculate/home" ,"none", False)
if not (self.clVars.Get("cl_remote_host") and foundMountRemote and\
foundMountHome):
foundMountHome):
self.printERROR("The computer is not in domain")
return False
return (foundMountRemote,foundMountHome)
@ -628,7 +618,7 @@ cl_remote_pw") + " ...")
" ...")
return True
def delDomain(self, removePwd=True):
def delDomain(self):
"""выводим из домена"""
self.createClVars()
pathRemote = "/var/calculate/remote"
@ -654,12 +644,8 @@ cl_remote_pw") + " ...")
" ...")
return False
self.execProg("calculate -P install/6intranet")
if removePwd:
self.clVars.Delete("cl_remote_host","local")
self.clVars.Delete("cl_remote_pw","local")
else:
self.printWARNING(_("remote domain address and remote password \
are not removed"))
self.clVars.Delete("cl_remote_host","local")
self.clVars.Delete("cl_remote_pw","local")
self.printOK(_("Computer removed from domain %s")%domain + " ...")
return True
@ -691,24 +677,17 @@ are not removed"))
if not foudHostSamba:
self.printERROR(_("Not found Samba server in %s")%domain)
return False
userPwd = False
if self.clVars.Get("cl_remote_host") and \
self.clVars.Get("cl_remote_host") != domain:
if not self.delDomain():
return False
# Создаем объект переменных (обновление переменных)
self.createClVars()
pwd = self.clVars.Get("cl_remote_pw")
if pwd:
userPwd = pwd
foundMountRemote =self.isMount("/var/calculate/remote" ,"cifs")
foundMountHome =self.isMount("/var/calculate/home" ,"none", False)
if foundMountRemote:
self.printWARNING(_("Samba resource [remote] mount") + \
" ...")
else:
if not userPwd:
userPwd=self.getUserPassword("Domain password for the desktop")
userPwd = self.getUserPassword("Domain password for the desktop")
pathRemote = "/var/calculate/remote"
pwdRemote = userPwd
if not os.path.exists(pathRemote):
@ -767,9 +746,7 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
"""Отмонтирование пользовательских ресурсов и синхронизация настроек"""
self.createClVars()
# В случае компьютера вне домена
foundMountRemote = self.isMount("/var/calculate/remote" ,"cifs")
foundMountHome = self.isMount("/var/calculate/home" ,"none", False)
if not (foundMountRemote and foundMountHome):
if not self.clVars.Get("cl_remote_host"):
self.printSUCCESS(_("To be used by local profile."))
return True
connectDomain = self.isDomain()
@ -829,9 +806,7 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
без синхронизации настроек"""
self.createClVars(self.clVars)
# В случае компьютера вне домена
foundMountRemote = self.isMount("/var/calculate/remote" ,"cifs")
foundMountHome = self.isMount("/var/calculate/home" ,"none", False)
if not (foundMountRemote and foundMountHome):
if not self.clVars.Get("cl_remote_host"):
self.printSUCCESS(_("To be used by local profile."))
return True
# Подсоединяемся к серверу
@ -876,9 +851,7 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
"""Монтирование пользовательских ресурсов и синхронизация настроек"""
self.createClVars()
# В случае компьютера вне домена
foundMountRemote = self.isMount("/var/calculate/remote" ,"cifs")
foundMountHome = self.isMount("/var/calculate/home" ,"none", False)
if not (foundMountRemote and foundMountHome):
if not self.clVars.Get("cl_remote_host"):
self.printSUCCESS(_("To be used by local profile."))
return True
# Проверим что компьютер в домене и смонтирован [remote]

@ -50,18 +50,12 @@ if __name__ == "__main__":
cl_client.cl_client,object),
{})
ldapObj = newClass("cl-client")
if optObj.opt.has_key('s') and not optObj.opt.has_key('r'):
optObj.handlerErrOpt()
sys.exit(1)
if optObj.params.has_key('user'):
if not optObj.opt.has_key('r') or not optObj.opt.has_key('mount'):
domain = optObj.params['user']
if not ldapObj.addDomain(domain):
flagError = True
elif optObj.opt.has_key('r') and optObj.opt.has_key('r'):
if not ldapObj.delDomain(False):
flagError = True
elif optObj.opt.has_key('r'):
if optObj.opt.has_key('r'):
if not ldapObj.delDomain():
flagError = True
elif optObj.opt.has_key('mount'):

Loading…
Cancel
Save