|
|
|
@ -781,6 +781,9 @@ class shareLdap(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
|
|
|
|
|
for fileRm in scanObjs[0].files:
|
|
|
|
|
# Удаляем файлы
|
|
|
|
|
os.remove(fileRm)
|
|
|
|
|
for socketRm in scanObjs[0].sockets:
|
|
|
|
|
# Удаляем сокеты
|
|
|
|
|
os.remove(socketRm)
|
|
|
|
|
for linkRm in scanObjs[0].links:
|
|
|
|
|
# Удаляем ссылки
|
|
|
|
|
os.unlink(linkRm[1])
|
|
|
|
@ -5044,38 +5047,41 @@ outdated. If the backup is obsolete, use cl-backup."))
|
|
|
|
|
# Создаем переменные
|
|
|
|
|
self.createClVars()
|
|
|
|
|
# Настройка почты
|
|
|
|
|
if options.has_key("t"):
|
|
|
|
|
mailType = options['t']
|
|
|
|
|
if mailType:
|
|
|
|
|
if not set(mailType.split(",")) <= set(["imap","pop3"]):
|
|
|
|
|
if serviceUpdate in ["all","mail"]:
|
|
|
|
|
if options.has_key("t"):
|
|
|
|
|
mailType = options['t']
|
|
|
|
|
if mailType:
|
|
|
|
|
if not set(mailType.split(",")) <= set(["imap","pop3"]):
|
|
|
|
|
self.printERROR(\
|
|
|
|
|
_("Мail type not 'imap' or 'pop3' or 'pop3,imap'"))
|
|
|
|
|
return False
|
|
|
|
|
if len(mailType.split(",")) == 2:
|
|
|
|
|
mailType = "all"
|
|
|
|
|
else:
|
|
|
|
|
self.printERROR(_("Мail type incorrect"))
|
|
|
|
|
return False
|
|
|
|
|
self.clVars.Set("sr_mail_type", mailType)
|
|
|
|
|
if options.has_key("c"):
|
|
|
|
|
mailCrypt = options['c']
|
|
|
|
|
if not mailCrypt in ["none", "tls"]:
|
|
|
|
|
self.printERROR(_("Мail encryption not 'none' or 'tls'"))
|
|
|
|
|
return False
|
|
|
|
|
if mailCrypt == "none":
|
|
|
|
|
mailCrypt = ""
|
|
|
|
|
self.clVars.Set("sr_mail_crypt", mailCrypt, True)
|
|
|
|
|
# Настройка jabber cервиса
|
|
|
|
|
if serviceUpdate in ["all","jabber"]:
|
|
|
|
|
# История для jabber
|
|
|
|
|
if options.has_key("history"):
|
|
|
|
|
history = options["history"].strip()
|
|
|
|
|
if history in ("on", "off"):
|
|
|
|
|
self.clVars.Set("sr_jabber_history", history)
|
|
|
|
|
else :
|
|
|
|
|
self.printERROR(\
|
|
|
|
|
_("Мail type not 'imap' or 'pop3' or 'pop3,imap'"))
|
|
|
|
|
_("Command line incorrect, \
|
|
|
|
|
'history=%s' - error, to use 'history on' or 'history off'")\
|
|
|
|
|
%str(history) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
if len(mailType.split(",")) == 2:
|
|
|
|
|
mailType = "all"
|
|
|
|
|
else:
|
|
|
|
|
self.printERROR(_("Мail type incorrect"))
|
|
|
|
|
return False
|
|
|
|
|
self.clVars.Set("sr_mail_type", mailType)
|
|
|
|
|
if options.has_key("c"):
|
|
|
|
|
mailCrypt = options['c']
|
|
|
|
|
if not mailCrypt in ["none", "tls"]:
|
|
|
|
|
self.printERROR(_("Мail encryption not 'none' or 'tls'"))
|
|
|
|
|
return False
|
|
|
|
|
if mailCrypt == "none":
|
|
|
|
|
mailCrypt = ""
|
|
|
|
|
self.clVars.Set("sr_mail_crypt", mailCrypt, True)
|
|
|
|
|
# История для jabber
|
|
|
|
|
if options.has_key("history"):
|
|
|
|
|
history = options["history"].strip()
|
|
|
|
|
if history in ("on", "off"):
|
|
|
|
|
self.clVars.Set("sr_jabber_history", history)
|
|
|
|
|
else :
|
|
|
|
|
self.printERROR(\
|
|
|
|
|
_("Command line incorrect, \
|
|
|
|
|
'history=%s' - error, to use 'history on' or 'history off'")\
|
|
|
|
|
%str(history) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
# находим установленные сервисы
|
|
|
|
|
servInstalled = self.getServiceSetup()
|
|
|
|
|
if not servInstalled:
|
|
|
|
@ -5140,19 +5146,25 @@ outdated. If the backup is obsolete, use cl-backup."))
|
|
|
|
|
self.printOK(_("Restarting service %s")%service.capitalize())
|
|
|
|
|
# запишем переменные для сервера
|
|
|
|
|
if not flagError:
|
|
|
|
|
self.clVars.Write("sr_jabber_history",
|
|
|
|
|
self.clVars.Get("sr_jabber_history"),
|
|
|
|
|
True,"local")
|
|
|
|
|
self.clVars.Write("sr_mail_type",
|
|
|
|
|
self.clVars.Get("sr_mail_type"),
|
|
|
|
|
True,"local")
|
|
|
|
|
self.clVars.Write("sr_mail_crypt",
|
|
|
|
|
self.clVars.Get("sr_mail_crypt"),
|
|
|
|
|
True,"local")
|
|
|
|
|
# запишем переменные для клиента
|
|
|
|
|
clientVars = ["sr_mail_type", "sr_mail_crypt"]
|
|
|
|
|
if not self.saveVarsClient(clientVars):
|
|
|
|
|
return False
|
|
|
|
|
# Переменные для jabber
|
|
|
|
|
if serviceUpdate in ["all","jabber"]:
|
|
|
|
|
self.clVars.Write("sr_jabber_history",
|
|
|
|
|
self.clVars.Get("sr_jabber_history"),
|
|
|
|
|
True,"local")
|
|
|
|
|
# Переменные для почты
|
|
|
|
|
if serviceUpdate in ["all","mail"]:
|
|
|
|
|
self.clVars.Write("sr_mail_type",
|
|
|
|
|
self.clVars.Get("sr_mail_type"),
|
|
|
|
|
True,"local")
|
|
|
|
|
self.clVars.Write("sr_mail_crypt",
|
|
|
|
|
self.clVars.Get("sr_mail_crypt"),
|
|
|
|
|
True,"local")
|
|
|
|
|
#запишем переменные для клиента
|
|
|
|
|
if self.clVars.Get("sr_mail_type") == "all":
|
|
|
|
|
self.clVars.Set("sr_mail_type","imap")
|
|
|
|
|
clientVars = ["sr_mail_type", "sr_mail_crypt"]
|
|
|
|
|
if not self.saveVarsClient(clientVars):
|
|
|
|
|
return False
|
|
|
|
|
if flagError:
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|