При входе в домен вычисляется полное имя домена.

git-svn-id: http://svn.calculate.ru/calculate2/calculate-client/trunk@721 c91db197-33c1-4113-bf15-f8a5c547ca64
develop
asamoukin 16 years ago
parent 46298e979c
commit d6b4c838f1

@ -650,10 +650,16 @@ conjunction with the 'login' or 'logout'")
self.printOK(_("Computer removed from domain %s")%domain + " ...")
return True
def addDomain(self, domain):
def addDomain(self, domainName):
"""Вводим в домен"""
# Создаем объект переменных
self.createClVars()
netDomain = self.clVars.Get("os_net_domain")
# Получам имя сервера (домена)
if "." in domainName:
domain = domainName
else:
domain = "%s.%s" %(domainName,netDomain)
resPing = self.execProg("ping -c 2 -i 0.3 %s" %domain,False,False)
foudHost = False
foudHostSamba = False
@ -773,6 +779,9 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
self.printERROR(_("Can not mount Samba resource [remote]") + \
" ...")
return False
# Если пользователь в X сессии тогда не будем отмонтировать ресурсы
if self.isSessionUser(userName):
return True
# Подсоединяемся к серверу
domain = self.clVars.Get("cl_remote_host")
if not self.getLdapObjBind(domain):
@ -835,6 +844,9 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
domain = self.clVars.Get("cl_remote_host")
if not self.getLdapObjBind(domain):
return False
# Если пользователь в X сессии тогда не будем отмонтировать ресурсы
if self.isSessionUser(userName):
return True
# homeDir из LDAP
resLdap = self.getUserLdapInfo(userName)
if not resLdap:
@ -873,6 +885,18 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
self.printOK(_("Umount user %s resource") %userName + " ...")
return True
def isSessionUser(self, userName):
"""Проверка на вход пользователя в X"""
xSession = False
reFoundUser = re.compile("%s\s:\d+\s+"%(userName))
resWho = self.execProg("who",False,False)
if resWho and type(resWho) == types.ListType:
for string in resWho:
if reFoundUser.search(string):
xSession = True
break
return xSession
def isTwoSessionsUser(self, userName):
"""Проверка на повторный вход пользователя"""
xSession = 0

Loading…
Cancel
Save