|
|
|
@ -2771,9 +2771,7 @@ class servMail(shareLdap):
|
|
|
|
|
if "@" in altMail:
|
|
|
|
|
mail = altMail
|
|
|
|
|
else:
|
|
|
|
|
mail = "%s@%s.%s" %(altMail,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
mail = "%s@%s" %(altMail,self.clVars.Get("sr_mail_host"))
|
|
|
|
|
if not primaryMail:
|
|
|
|
|
primaryMail = mail
|
|
|
|
|
if self.searchUserToMail(mail) or\
|
|
|
|
@ -2822,9 +2820,7 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
if "@" in altMail:
|
|
|
|
|
mail = altMail
|
|
|
|
|
else:
|
|
|
|
|
mail = "%s@%s.%s" %(altMail,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
mail = "%s@%s" %(altMail,self.clVars.Get("sr_mail_host"))
|
|
|
|
|
if self.searchUserToMail(mail) or\
|
|
|
|
|
self.searchGroupToMail(mail):
|
|
|
|
|
self.printERROR(
|
|
|
|
@ -2837,9 +2833,7 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
_("group name %s is found in Mail service")%\
|
|
|
|
|
str(groupName) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
mail = "%s@%s.%s" %(groupName,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
mail = "%s@%s" %(groupName,self.clVars.Get("sr_mail_host"))
|
|
|
|
|
if self.searchUserToMail(mail) or\
|
|
|
|
|
self.searchGroupToMail(mail):
|
|
|
|
|
self.printERROR(
|
|
|
|
@ -2930,9 +2924,8 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
if res[0][0][1].has_key('rfc822member'):
|
|
|
|
|
usersInGroup = res[0][0][1]['rfc822member']
|
|
|
|
|
for userName in usersNames:
|
|
|
|
|
userMail = "%s@%s.%s" %(userName,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
userMail = "%s@%s" %(userName,
|
|
|
|
|
self.clVars.Get("sr_mail_host"))
|
|
|
|
|
if userMail in usersInGroup:
|
|
|
|
|
findUsers.append(userName)
|
|
|
|
|
return findUsers
|
|
|
|
@ -3033,9 +3026,7 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
addUsers.append(user)
|
|
|
|
|
modAttrs = []
|
|
|
|
|
for userName in addUsers:
|
|
|
|
|
userMail = "%s@%s.%s" %(userName,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
userMail = "%s@%s" %(userName,self.clVars.Get("sr_mail_host"))
|
|
|
|
|
modAttrs.append((ldap.MOD_ADD, 'rfc822member', userMail))
|
|
|
|
|
if modAttrs:
|
|
|
|
|
groupDN = self.addDN("cn="+groupName, self.relGroupsDN)
|
|
|
|
@ -3070,9 +3061,7 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
if "@" in altMail:
|
|
|
|
|
mail = altMail
|
|
|
|
|
else:
|
|
|
|
|
mail = "%s@%s.%s" %(altMail,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
mail = "%s@%s" %(altMail,self.clVars.Get("sr_mail_host"))
|
|
|
|
|
if not primaryMail:
|
|
|
|
|
primaryMail = mail
|
|
|
|
|
if self.searchUserToMail(mail) or\
|
|
|
|
@ -3091,9 +3080,7 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
self.printERROR(_("User exists in Mail service"))
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
mail = "%s@%s.%s" %(userName,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
mail = "%s@%s" %(userName,self.clVars.Get("sr_mail_host"))
|
|
|
|
|
if self.searchUserToMail(mail) or\
|
|
|
|
|
self.searchGroupToMail(mail):
|
|
|
|
|
self.printERROR(
|
|
|
|
@ -3266,8 +3253,13 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
# Имя устанавливаемого сервиса
|
|
|
|
|
self.clVars.Set("cl_pass_service","mail")
|
|
|
|
|
self.clVars.Write("sr_mail_set","off")
|
|
|
|
|
# Cоздаем объект профиль устанавливая директорию mail для
|
|
|
|
|
# файлов профилей
|
|
|
|
|
# Почтовый ност
|
|
|
|
|
if options.has_key("mail-host"):
|
|
|
|
|
fullHostName = options['mail-host']
|
|
|
|
|
else:
|
|
|
|
|
fullHostName = "%s.%s"%(self.clVars.Get('os_net_hostname'),
|
|
|
|
|
self.clVars.Get('os_net_domain'))
|
|
|
|
|
self.clVars.Set("sr_mail_host",fullHostName,True)
|
|
|
|
|
if not self.applyProfilesFromService('mail'):
|
|
|
|
|
return False
|
|
|
|
|
# Проверим запущен ли ldap
|
|
|
|
@ -3330,10 +3322,10 @@ in Unix service ...") %str(primaryMail))
|
|
|
|
|
# Устанавливаем автозапуск демона
|
|
|
|
|
if not self.setDaemonAutostart("dovecot"):
|
|
|
|
|
return False
|
|
|
|
|
#запишем переменные для сервера
|
|
|
|
|
mailHost = self.clVars.Get("sr_mail_host")
|
|
|
|
|
self.clVars.Write("sr_mail_host",mailHost,True,"local")
|
|
|
|
|
#запишем переменные для клиента
|
|
|
|
|
fullHostName = "%s.%s"%(self.clVars.Get('os_net_hostname'),
|
|
|
|
|
self.clVars.Get('os_net_domain'))
|
|
|
|
|
self.clVars.Set("sr_mail_host",fullHostName,True)
|
|
|
|
|
self.clVars.Set("sr_mail_send_host",fullHostName)
|
|
|
|
|
clientVars = ["sr_mail_host","sr_mail_crypt", "sr_mail_port",
|
|
|
|
|
"sr_mail_type","sr_mail_send_crypt","sr_mail_send_port",
|
|
|
|
@ -3805,9 +3797,7 @@ class servJabber(shareLdap):
|
|
|
|
|
if checkSetup and not self.isServiceSetup("jabber"):
|
|
|
|
|
return False
|
|
|
|
|
#jabber id
|
|
|
|
|
jabberId = "%s@%s.%s" %(userName,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
jabberId = "%s@%s" %(userName,self.clVars.Get("sr_jabber_host"))
|
|
|
|
|
if self.searchUserToId(jabberId):
|
|
|
|
|
self.printERROR(_("User exists in Jabber service"))
|
|
|
|
|
return False
|
|
|
|
@ -3906,6 +3896,12 @@ class servJabber(shareLdap):
|
|
|
|
|
# Имя устанавливаемого сервиса
|
|
|
|
|
self.clVars.Set("cl_pass_service","jabber")
|
|
|
|
|
self.clVars.Write("sr_jabber_set","off")
|
|
|
|
|
if options.has_key("jabber-host"):
|
|
|
|
|
fullHostName = options['jabber-host']
|
|
|
|
|
else:
|
|
|
|
|
fullHostName = "%s.%s"%(self.clVars.Get('os_net_hostname'),
|
|
|
|
|
self.clVars.Get('os_net_domain'))
|
|
|
|
|
self.clVars.Set("sr_jabber_host",fullHostName,True)
|
|
|
|
|
# Cоздаем объект профиль устанавливая директорию jabber для
|
|
|
|
|
# файлов профилей
|
|
|
|
|
if not self.applyProfilesFromService('jabber'):
|
|
|
|
@ -3944,9 +3940,7 @@ class servJabber(shareLdap):
|
|
|
|
|
return False
|
|
|
|
|
# Администратор сервиса
|
|
|
|
|
adminName = "admin"
|
|
|
|
|
adminFullName = "%s@%s.%s" %(adminName,
|
|
|
|
|
self.clVars.Get("os_net_hostname"),
|
|
|
|
|
self.clVars.Get("os_net_domain"))
|
|
|
|
|
adminFullName = "%s@%s" %(adminName, self.clVars.Get("sr_jabber_host"))
|
|
|
|
|
print _("Enter the %s password" % adminFullName)
|
|
|
|
|
if not self.addUserJabberServer(adminName,{'p':""}, False):
|
|
|
|
|
return False
|
|
|
|
@ -3970,10 +3964,10 @@ class servJabber(shareLdap):
|
|
|
|
|
# Устанавливаем автозапуск демона
|
|
|
|
|
if not self.setDaemonAutostart("ejabberd"):
|
|
|
|
|
return False
|
|
|
|
|
#запишем переменные для сервера
|
|
|
|
|
jabberHost = self.clVars.Get("sr_jabber_host")
|
|
|
|
|
self.clVars.Write("sr_jabber_host",jabberHost,True,"local")
|
|
|
|
|
#запишем переменные для клиента
|
|
|
|
|
fullHostName = "%s.%s"%(self.clVars.Get('os_net_hostname'),
|
|
|
|
|
self.clVars.Get('os_net_domain'))
|
|
|
|
|
self.clVars.Set("sr_jabber_host",fullHostName,True)
|
|
|
|
|
clientVars = ["sr_jabber_host","sr_jabber_crypt","sr_jabber_port"]
|
|
|
|
|
if not self.saveVarsClient(clientVars):
|
|
|
|
|
return False
|
|
|
|
@ -4270,6 +4264,18 @@ class servSamba(shareLdap):
|
|
|
|
|
if not flagError and createDirLogon:
|
|
|
|
|
if not self.createUserDir(uid, gid, createDirLogon):
|
|
|
|
|
flagError = True
|
|
|
|
|
# cоздадим cmd файл для монтирования ресурсов в windows
|
|
|
|
|
if not flagError:
|
|
|
|
|
netbios = self.clVars.Get("sr_samba_netbios")
|
|
|
|
|
netbios = netbios.upper()
|
|
|
|
|
fileTxt="NET USE R: /D\r\nNET USE R: \\%s\share"\
|
|
|
|
|
%netbios
|
|
|
|
|
fileDirectory = os.path.join(createDirLogon,
|
|
|
|
|
"start.cmd")
|
|
|
|
|
print "FILE =", fileDirectory
|
|
|
|
|
if not self.createUserFile(fileDirectory,
|
|
|
|
|
fileTxt, uid, gid):
|
|
|
|
|
flagError = True
|
|
|
|
|
# Cоздаем директорию профиля win
|
|
|
|
|
if not flagError and createDirWinProfile:
|
|
|
|
|
if not self.createUserDir(uid,gid,createDirWinProfile):
|
|
|
|
@ -4357,7 +4363,6 @@ class servSamba(shareLdap):
|
|
|
|
|
self.printERROR(_("Can not add machine")+ " ...")
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def setupSambaServer(self, options):
|
|
|
|
|
"""Начальная настройка Samba сервиса"""
|
|
|
|
|
# Принудительная установка
|
|
|
|
@ -4501,13 +4506,21 @@ class servSamba(shareLdap):
|
|
|
|
|
self.printERROR(_("not created samba user 'client'"))
|
|
|
|
|
return False
|
|
|
|
|
# Если нет то создадим директорию /var/calculate/remote
|
|
|
|
|
remotePath = "/var/calculate/remote"
|
|
|
|
|
remoteEnvFile = self.clVars.Get("cl_env_path")[0]
|
|
|
|
|
remotePath = os.path.split(remoteEnvFile)[0]
|
|
|
|
|
if not os.path.exists(remotePath):
|
|
|
|
|
os.makedirs(remotePath)
|
|
|
|
|
# права и владелец /var/calculate/remote
|
|
|
|
|
if os.path.exists(remotePath):
|
|
|
|
|
os.chown(remotePath,int(clientUid),int(clientGid))
|
|
|
|
|
os.chmod(remotePath,0750)
|
|
|
|
|
os.chown(remotePath,0,int(clientGid))
|
|
|
|
|
os.chmod(remotePath,02750)
|
|
|
|
|
# изменяем владельца remote на client
|
|
|
|
|
if not os.path.exists(remoteEnvFile):
|
|
|
|
|
fd = os.open(remoteEnvFile, os.O_CREAT)
|
|
|
|
|
os.close(fd)
|
|
|
|
|
os.chmod(remoteEnvFile, 0640)
|
|
|
|
|
if os.path.exists(remoteEnvFile):
|
|
|
|
|
os.chown(remoteEnvFile,0,int(clientGid))
|
|
|
|
|
if not self.setDaemonAutostart("slapd"):
|
|
|
|
|
return False
|
|
|
|
|
# Устанавливаем автозапуск демона
|
|
|
|
@ -4524,6 +4537,9 @@ class servSamba(shareLdap):
|
|
|
|
|
gid = 0
|
|
|
|
|
if not self.createUserFile(fileDirectory, fileTxt, uid, gid):
|
|
|
|
|
return False
|
|
|
|
|
#запишем переменные для сервера
|
|
|
|
|
netbios = self.clVars.Get("sr_samba_netbios")
|
|
|
|
|
self.clVars.Write("sr_mail_host",netbios,True,"local")
|
|
|
|
|
#запишем переменные для клиента
|
|
|
|
|
fullHostName = "%s.%s"%(self.clVars.Get('os_net_hostname'),
|
|
|
|
|
self.clVars.Get('os_net_domain'))
|
|
|
|
@ -5746,6 +5762,18 @@ preferences and data (for users with uid<1000)")
|
|
|
|
|
'helpChapter':_("Samba service options"),
|
|
|
|
|
'help':_("workgroup, default 'Calculate'")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(6,),
|
|
|
|
|
'optVal':"HOST",
|
|
|
|
|
'longOption':"mail-host",
|
|
|
|
|
'helpChapter':_("Mail service options"),
|
|
|
|
|
'help':_("mail-host, default - hostname")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(6,),
|
|
|
|
|
'optVal':"HOST",
|
|
|
|
|
'longOption':"jabber-host",
|
|
|
|
|
'helpChapter':_("Jabber service options"),
|
|
|
|
|
'help':_("jabber-host, default - hostname")
|
|
|
|
|
},
|
|
|
|
|
# Опции cl-passwd
|
|
|
|
|
# LDAP пользователь
|
|
|
|
|
{'progAccess':(7,),
|
|
|
|
|