|
|
@@ -106,11 +106,13 @@ def UserList(request):
|
|
|
u = User.objects.get(pk=idpost)
|
|
|
u.tobedeleted = not u.tobedeleted
|
|
|
u.save()
|
|
|
-
|
|
|
- if 'sendInfoToAdmin' in request.POST:
|
|
|
+
|
|
|
+ # invia le info sull'email all'utente autorizzato all'editing
|
|
|
+ # le info vengono ottenute da quanto contenuto nel record
|
|
|
+ if 'sendInfoToMe' in request.POST:
|
|
|
print('richista informazioni mail')
|
|
|
sm = ServizioMail()
|
|
|
- idpost = request.POST['sendInfoToAdmin']
|
|
|
+ idpost = request.POST['sendInfoToMe']
|
|
|
record = User.objects.get(pk=idpost)
|
|
|
print(record.nome)
|
|
|
sm.set_rcptto(r'{}@{}'.format(utenteautorizzato.mail.strip(),utenteautorizzato.domain.nome.strip()))
|
|
|
@@ -127,6 +129,7 @@ def UserList(request):
|
|
|
if 'ritorno' in request.POST:
|
|
|
return HttpResponseRedirect(reverse('Login:welcome',args={}))
|
|
|
|
|
|
+ # cazz'e' sta sezione?
|
|
|
if 'notaSubmit' in request.POST:
|
|
|
fm = formMsg(request.POST)
|
|
|
if fm.is_valid():
|
|
|
@@ -326,22 +329,7 @@ def UserEdit(request):
|
|
|
buildemail(getConfigurazione('mail_from'),["{}@{}".format(record.mail,record.domain.nome)],'mail_test_subject','mail_test_body_html','mail_test_body_text',{'domain':record.domain.nome,'mail':record.mail})
|
|
|
|
|
|
if 'sendInfoToMe' in request.POST:
|
|
|
- print('richeista informazioni mail')
|
|
|
- sm = ServizioMail()
|
|
|
- sm.set_rcptto(r'{}@{}'.format(record.mail.strip(),record.domain.nome.strip()))
|
|
|
- template=Template.objects.get(pk=getConfigurazione("mail:info:info"))
|
|
|
- sm.set_oggetto(template.oggetto)
|
|
|
- sm.set_soggetto(template.soggetto)
|
|
|
- dictdict={}
|
|
|
- dictdict['utente'] = record
|
|
|
- dictdict['utenteautorizzato'] = utenteautorizzato
|
|
|
- dictdict['precedente_password'] = oldpassword
|
|
|
- dictdict['data'] = datetime.now()
|
|
|
- sm.set_data(dictdict)
|
|
|
- sm.send()
|
|
|
-
|
|
|
- if 'sendInfoToAdmin' in request.POST:
|
|
|
- print('richeista informazioni mail')
|
|
|
+ print('richiesta informazioni mail')
|
|
|
sm = ServizioMail()
|
|
|
sm.set_rcptto(r'{}@{}'.format(utenteautorizzato.mail.strip(),utenteautorizzato.domain.nome.strip()))
|
|
|
template=Template.objects.get(pk=getConfigurazione("mail:info:info"))
|
|
|
@@ -350,6 +338,7 @@ def UserEdit(request):
|
|
|
dictdict={}
|
|
|
dictdict['utente'] = record
|
|
|
dictdict['utenteautorizzato'] = utenteautorizzato
|
|
|
+ dictdict['precedente_password'] = oldpassword
|
|
|
dictdict['data'] = datetime.now()
|
|
|
sm.set_data(dictdict)
|
|
|
sm.send()
|
|
|
@@ -506,12 +495,16 @@ def UserEdit(request):
|
|
|
if nuovorecord:
|
|
|
print('generato nuovo record')
|
|
|
sm = ServizioMail()
|
|
|
+ # inserisce la mail dell'utente appena creato
|
|
|
sm.set_rcptto(r'{}@{}'.format(record.mail.strip(),record.domain.nome.strip()))
|
|
|
- sm.add_to(re.findall("[\w\.-_]+@[\w\.]+",getConfigurazione('mail_notification')))
|
|
|
- #if utenteautorizzato.id == record.id:
|
|
|
+ # viene inviata una notifica anche all'utente supremo/assoluto
|
|
|
+ sm.add_to(re.findall("[\w\.-_]+@[\w\.]+",getConfigurazione('mail:notifica')))
|
|
|
+ #aggiunge l'utente autorizzato all'editing (tipicamenteo l'amministratore del dominio)
|
|
|
sm.add_to(utenteautorizzato.mail + "@" + utenteautorizzato.domain.nome)
|
|
|
+ # se presente, aggiunge anche la nota all'utente indicato nel campo (Invia credenziali a)
|
|
|
if mail_who:
|
|
|
sm.add_to(re.findall("[\w\.-_]+@[\w\.]+",mail_who))
|
|
|
+
|
|
|
template=Template.objects.get(pk=getConfigurazione("mail:info:account"))
|
|
|
sm.set_oggetto(template.oggetto)
|
|
|
sm.set_soggetto(template.soggetto)
|
|
|
@@ -526,9 +519,11 @@ def UserEdit(request):
|
|
|
if record.password_change_enabled and oldpassword != record.clear:
|
|
|
print('richiesto aggiornamento password')
|
|
|
sm = ServizioMail()
|
|
|
+ # invia la mail all'utente in fase di editing
|
|
|
sm.set_rcptto(r'{}@{}'.format(record.mail.strip(),record.domain.nome.strip()))
|
|
|
- sm.add_to(re.findall("[\w\.-_]+@[\w\.]+",getConfigurazione('mail_notification')))
|
|
|
- #if utenteautorizzato.id == record.id:
|
|
|
+ # invia la mail agli utenti di notifica indicati nella configurazione
|
|
|
+ sm.add_to(re.findall("[\w\.-_]+@[\w\.]+",getConfigurazione('mail:notifica')))
|
|
|
+ # infine viene aggiunta una mail all'utente autorizzato per l'editing
|
|
|
sm.add_to(utenteautorizzato.mail + "@" + utenteautorizzato.domain.nome)
|
|
|
if mail_who:
|
|
|
sm.add_to(re.findall("[\w\.-_]+@[\w\.]+",mail_who))
|
|
|
@@ -624,11 +619,11 @@ def UserEdit(request):
|
|
|
temp['sendafile'] = record.sendafile
|
|
|
temp['tobedeleted'] = record.tobedeleted
|
|
|
temp['mail_quota'] = record.mail_quota
|
|
|
+ temp['date_mail_quota'] = record.date_mail_quota
|
|
|
temp['accountdatecreation'] = record.account_date_creation
|
|
|
temp['accountdatedisabled'] = record.account_date_disabled
|
|
|
temp['sms_communication'] = record.sms_communication
|
|
|
temp['nota'] = record.nota
|
|
|
- temp['last_mail_checked'] = record.last_mail_checked
|
|
|
temp['proxy_host'] = record.proxy_host
|
|
|
#temp['bigmail'] = record.bigmail
|
|
|
temp['mail_di_recupero'] = record.mail_di_recupero
|