Добавлен доступ к FTP

git-svn-id: http://svn.calculate.ru/calculate2/calculate-client/trunk@660 c91db197-33c1-4113-bf15-f8a5c547ca64
develop
asamoukin 16 years ago
parent 0c75731c22
commit 43b11ff95e

@ -513,7 +513,7 @@ conjunction with the 'login' or 'logout'")
if homeExists:
self.printWARNING(_("Home dir %s exists")%homeDir)
if set(os.listdir(homeDir))-set(["Home","Disks"]):
if set(os.listdir(homeDir))-set(["Home","Disks","FTP"]):
if not applyAlways:
# Получаем пути к профилям постоянного наложения
alwProfilePath = self.getAlwaysProfilePath()
@ -790,6 +790,9 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
pathRemote.append((os.path.join(homeDir,"Home"), "homes"))
# Удаленный ресурс share
pathRemote.append((os.path.join(homeDir,"Disks"), "share"))
# Удаленный ресурс ftp
if self.clVars.Get("cl_remote_ftp"):
pathRemote.append((os.path.join(homeDir,"FTP"), "ftp"))
self.moveHomeDir(homeDir)
# Синхронизируем настройки
if not self.syncUser(userName, homeDir, "logout"):
@ -845,6 +848,9 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
pathRemote.append((os.path.join(homeDir,"Home"), "homes"))
# Удаленный ресурс share
pathRemote.append((os.path.join(homeDir,"Disks"), "share"))
# Удаленный ресурс ftp
if self.clVars.Get("cl_remote_ftp"):
pathRemote.append((os.path.join(homeDir,"FTP"), "ftp"))
flagError = False
self.moveHomeDir(homeDir)
for path, res in pathRemote:
@ -911,6 +917,9 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
pathRemote.append((os.path.join(homeDir,"Home"), "homes"))
# Удаленный ресурс share
pathRemote.append((os.path.join(homeDir,"Disks"), "share"))
if self.clVars.Get("cl_remote_ftp"):
# Удаленный ресурс ftp
pathRemote.append((os.path.join(homeDir,"FTP"), "ftp"))
flagError = False
i = 0
for path, res in pathRemote:
@ -929,7 +938,7 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
# Проверяем на монтирование директории
if self.isMount(path, 'cifs'):
continue
if i==3:
if i>=3:
# Монтируем директории c uid
mountStr="mount -t cifs -o user=%s,password=%s,uid=%s,gid=%s"\
%(userName,userPwd,uid,gid) + " " +\
@ -968,7 +977,7 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
movedLink = os.path.join('Moved')
movedPath = os.path.join('Home',"Moved")
filesAndDir = filter(lambda x: not ('.' in x[0] or x in\
['Disks','Home','Moved']), os.listdir('.'))
['Disks','Home','Moved','FTP']), os.listdir('.'))
filesDir = []
for fd in filesAndDir:
if os.path.islink(fd):
@ -1028,16 +1037,16 @@ install/6intranet" %(domain,servDn,unixDN,bindDn,bindPw)
os.path.exists(homeProfile):
execStr = '/usr/bin/rsync --delete-excluded --delete \
--exclude="/.googleearth" --exclude="/Home" --exclude="/Disks" --exclude="*~" \
--filter="P /.googleearth" --filter="P /Home" --filter="P /Disks" -a -x \
%s/ %s/' %(homeProfile,userHome)
--exclude="/FTP" --filter="P /.googleearth" --filter="P /Home" \
--filter="P /Disks" --filter="P /FTP" -a -x %s/ %s/' %(homeProfile,userHome)
elif sync == "logout":
if os.path.exists(userHome) and os.listdir(userHome) and\
os.path.exists(homeProfile):
execStr = '/usr/bin/rsync --delete-excluded --delete \
--exclude="/.googleearth" --exclude="/Home" --exclude="/Disks" --exclude="*~" \
--exclude="/.kde4/cache-*" --exclude="/.kde4/tmp-*" \
--exclude="/.googleearth" --exclude="/Home" --exclude="/Disks" --exclude="/FTP"\
--exclude="*~" --exclude="/.kde4/cache-*" --exclude="/.kde4/tmp-*" \
--exclude="/.kde4/socket-*" --filter="P /.googleearth" --filter="P /Home" \
--filter="P /Disks" -a -x %s/ %s/'%(userHome,homeProfile)
--filter="P /Disks" --filter="P /FTP" -a -x %s/ %s/'%(userHome,homeProfile)
else:
self.printERROR(_("Method syncUser: option sync=%s incorrect")\
%str(sync))

Loading…
Cancel
Save