|
|
@ -1862,7 +1862,7 @@ This command is not allowed."))
|
|
|
|
# Создаем сертификат для Postfix
|
|
|
|
# Создаем сертификат для Postfix
|
|
|
|
if not self.createCertificate(sslOrganization="Postfix IMAP Server",
|
|
|
|
if not self.createCertificate(sslOrganization="Postfix IMAP Server",
|
|
|
|
userName="postfix", groupName="postfix",
|
|
|
|
userName="postfix", groupName="postfix",
|
|
|
|
certFile="/etc/ssl/postfix/server.pem",
|
|
|
|
certFile="/etc/ssl/postfix/server.crt",
|
|
|
|
keyFile="/etc/ssl/postfix/server.key"):
|
|
|
|
keyFile="/etc/ssl/postfix/server.key"):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
return True
|
|
|
@ -1901,7 +1901,10 @@ This command is not allowed."))
|
|
|
|
if not os.path.exists(rndFile):
|
|
|
|
if not os.path.exists(rndFile):
|
|
|
|
self.printERROR(_("Can not create %s")%rndFile)
|
|
|
|
self.printERROR(_("Can not create %s")%rndFile)
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
textLine = self.execProg("%s gendh -rand %s 512 >> %s"\
|
|
|
|
self.printOK(
|
|
|
|
|
|
|
|
_("Generating DH. This is going to take a long time")
|
|
|
|
|
|
|
|
+ " ...", printBR=False)
|
|
|
|
|
|
|
|
textLine = self.execProg("%s dhparam -dsaparam -rand %s 4096 >> %s"\
|
|
|
|
%(sslFile, rndFile, dhFile))
|
|
|
|
%(sslFile, rndFile, dhFile))
|
|
|
|
if textLine == False:
|
|
|
|
if textLine == False:
|
|
|
|
self.printERROR(_("Can not create DH certificate %s")%certFile)
|
|
|
|
self.printERROR(_("Can not create DH certificate %s")%certFile)
|
|
|
@ -1971,7 +1974,10 @@ nsCertType = %s
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
# Создание DH
|
|
|
|
# Создание DH
|
|
|
|
if genDH:
|
|
|
|
if genDH:
|
|
|
|
textLine = self.execProg("%s gendh -rand %s 512 >> %s"\
|
|
|
|
self.printOK(
|
|
|
|
|
|
|
|
_("Generating DH. This is going to take a long time")
|
|
|
|
|
|
|
|
+ " ...", printBR=False)
|
|
|
|
|
|
|
|
textLine = self.execProg("%s dhparam -dsaparam -rand %s 4096 >> %s"\
|
|
|
|
%(sslFile, rndFile, certFile))
|
|
|
|
%(sslFile, rndFile, certFile))
|
|
|
|
if textLine == False:
|
|
|
|
if textLine == False:
|
|
|
|
self.printERROR(_("Can not create DH certificate %s")%certFile)
|
|
|
|
self.printERROR(_("Can not create DH certificate %s")%certFile)
|
|
|
@ -5284,6 +5290,7 @@ in Jabber service"))
|
|
|
|
# Изменяемые аттрибуты пользователя
|
|
|
|
# Изменяемые аттрибуты пользователя
|
|
|
|
modAttrs = []
|
|
|
|
modAttrs = []
|
|
|
|
# Изменяем Jabber ID
|
|
|
|
# Изменяем Jabber ID
|
|
|
|
|
|
|
|
jabber_hosts = self.get_jabber_hosts()
|
|
|
|
if options.has_key('j'):
|
|
|
|
if options.has_key('j'):
|
|
|
|
# Изменяем JID
|
|
|
|
# Изменяем JID
|
|
|
|
jabberId = options['j']
|
|
|
|
jabberId = options['j']
|
|
|
@ -5293,6 +5300,10 @@ in Jabber service"))
|
|
|
|
if len(jabberId.split("@")) != 2:
|
|
|
|
if len(jabberId.split("@")) != 2:
|
|
|
|
self.printERROR(_("JID %s incorrect") %jabberId)
|
|
|
|
self.printERROR(_("JID %s incorrect") %jabberId)
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
if jabberId.rpartition('@')[2] not in jabber_hosts:
|
|
|
|
|
|
|
|
self.printERROR(
|
|
|
|
|
|
|
|
_("JID %s not supported on this jabber hosts") %jabberId)
|
|
|
|
|
|
|
|
return False
|
|
|
|
searchUser = self.searchUserToId(jabberId)
|
|
|
|
searchUser = self.searchUserToId(jabberId)
|
|
|
|
if searchUser:
|
|
|
|
if searchUser:
|
|
|
|
foundUserName = searchUser[0][0][1]['uid'][0]
|
|
|
|
foundUserName = searchUser[0][0][1]['uid'][0]
|
|
|
@ -5552,10 +5563,16 @@ in Unix service") %str(jabberId))
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_jabber_hosts(self):
|
|
|
|
|
|
|
|
jabber_host = self.clVars.Get('sr_jabber_host')
|
|
|
|
|
|
|
|
jabber_hosts = self.clVars.Get('sr_jabber_hosts').split(',')
|
|
|
|
|
|
|
|
jabber_hosts.append(jabber_host)
|
|
|
|
|
|
|
|
return list(set(jabber_hosts))
|
|
|
|
|
|
|
|
|
|
|
|
@adminConnectLdap
|
|
|
|
@adminConnectLdap
|
|
|
|
def addUserJabberServer(self, userName, options, checkSetup=True):
|
|
|
|
def addUserJabberServer(self, userName, options, checkSetup=True):
|
|
|
|
"""Добавляет jabber пользователя"""
|
|
|
|
"""Добавляет jabber пользователя"""
|
|
|
|
|
|
|
|
jabber_hosts = self.get_jabber_hosts()
|
|
|
|
# Проверим установлен ли сервис jabber
|
|
|
|
# Проверим установлен ли сервис jabber
|
|
|
|
if checkSetup and not self.initialChecks("jabber"):
|
|
|
|
if checkSetup and not self.initialChecks("jabber"):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
@ -5570,6 +5587,10 @@ in Unix service") %str(jabberId))
|
|
|
|
if len(jabberId.split("@")) != 2:
|
|
|
|
if len(jabberId.split("@")) != 2:
|
|
|
|
self.printERROR(_("JID %s incorrect") %jabberId)
|
|
|
|
self.printERROR(_("JID %s incorrect") %jabberId)
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
if jabberId.rpartition('@')[2] not in jabber_hosts:
|
|
|
|
|
|
|
|
self.printERROR(
|
|
|
|
|
|
|
|
_("JID %s not supported on this jabber hosts") %jabberId)
|
|
|
|
|
|
|
|
return False
|
|
|
|
# добавляем jabberID в Unix
|
|
|
|
# добавляем jabberID в Unix
|
|
|
|
if self.isServiceSetup("unix",False):
|
|
|
|
if self.isServiceSetup("unix",False):
|
|
|
|
if not self.servUnixObj.setUserJabberID(userName, jabberId):
|
|
|
|
if not self.servUnixObj.setUserJabberID(userName, jabberId):
|
|
|
|