Procházet zdrojové kódy

modifiche a utenti, aggiunta campo forward

mauro před 11 měsíci
rodič
revize
4a98b0dbaf

+ 5 - 4
mqtt/views.py

@@ -197,11 +197,12 @@ class mqtt(object):
 ##########################################
 
 def start():
-  broker='172.18.0.1'
-  port = 1881
+  broker = getConfigurazione('mqtt:broker:address')
+  port = int(getConfigurazione('mqtt:broker:port'))
+  username = getConfigurazione('mqtt:broker:username')
+  password = getConfigurazione('mqtt:broker:password')
+
   topic = 'dashboard'
-  username = 'dashboard'
-  password = 'EnigmA'
   client_id = f'mqtt-{random.randint(0, 1000)}'
 
   def on_connect(client,userdata,flags,rc):

+ 1 - 0
utenti/forms.py

@@ -61,6 +61,7 @@ class formEmail(forms.Form):
     self.fields['blacklist'] = forms.BooleanField(required=False,initial=1)
     self.fields['spf'] = forms.BooleanField(required=False,initial=1)
     self.fields['mail_quota'] = forms.IntegerField(required=False,initial=1)
+    self.fields['forward'] = forms.CharField(required=False,initial="")
 
   def clean_password1(self):
 

+ 2 - 1
utenti/models.py

@@ -58,7 +58,6 @@ class User(models.Model):
   mail_proxy = models.ForeignKey('mail.MailProxy',db_column='mail_proxy',on_delete=models.PROTECT)
   sql_remote = models.ForeignKey('mail.SqlRemote',db_column='sql_remote',on_delete=models.PROTECT)
 
-
   warning_mail_quota = models.IntegerField(db_column='warning_mail_quota',default=0)
   limit_mail_quota = models.IntegerField(db_column='limit_mail_quota',default=0)
 
@@ -72,6 +71,8 @@ class User(models.Model):
   antivirus = models.BooleanField(db_column='antivirus')
   sieve = models.BooleanField(db_column='sieve')
 
+  forward = models.CharField(db_column='forward',max_length=128,default="",null=True)
+
   '''
   mail_di_recupero: consente il recupero delle password smarrite dal pannello di login.
   viene inviata una mail a questo account.

+ 6 - 0
utenti/templates/Utente.Edit.html

@@ -223,6 +223,12 @@
   </div>
 
   {% if 'EDITUSEROPTIONS' in securitylist %}
+    <div class='form-group'>
+      <div class='form-inline'>
+        <label class='form-input-label' for='forward'>Forward email a (questa opzione supera le regole della webmail):  </label>
+	<input type='text' clas=form-control' id='forward' name='forward' value="{{ formemail.forward.value }}" size=64></input>
+      </div>
+    </div>
     <div class='row form-group'> 
       <div class='col form-inline'>
         <label class='form-check-label' for='pop3'>Pop3:&nbsp;&nbsp;</label>

+ 2 - 2
utenti/templates/Utente.ReadOnlyList.html

@@ -11,7 +11,7 @@
         <th scope='col'>*</th>
         <th scope='col'>l</th>
         <th scope='col'>quota</th>
-	<!--{% if 'USERSHOWCLEARPASSWORD' in securitylist %}<th scope='col'>Password</th>{% endif %}i-->
+	{% if 'USERSHOWCLEARPASSWORD' in securitylist %}<th scope='col'>Password</th>{% endif %}
 	<th scope='col'>Agg.Pas</th>
 	<th scope='col'>Attivo</th>
 	<th scope='col'>Da cancellare</th>
@@ -26,7 +26,7 @@
         <td>{% if u.enabled %}*{% else %}-{% endif %}</td>
         <td>{{ u.securitylevel.id }}</td>
 	<td>{{ u.mail_quota }}Mb/{% if u.warning_mail_quota %}{{ u.warning_mail_quota }}Mb{% else %}--{% endif %}
-		<!-- {% if 'USERSHOWCLEARPASSWORD' in securitylist %} <td>{{ u.clear }}</td> {% endif %} -->
+		{% if 'USERSHOWCLEARPASSWORD' in securitylist %} <td>{{ u.clear }}</td> {% endif %} 
         <td>{% if u.last_password_update %}{{ u.last_password_update }}{% endif %}</td>
         <td>{% if not u.enabled %}Utente Disattivato {% else %} {% endif %}</td>
 	<td>{% if u.tobedeleted %}In Cancellazione {% else %} {% endif %} </td>

+ 2 - 0
utenti/views.py

@@ -415,6 +415,7 @@ def UserEdit(request):
       record.limit_mail_quota = formemail.cleaned_data.get('limit_mail_quota')
       record.nota = formemail.cleaned_data.get('nota')
       record.mail_di_recupero = formemail.cleaned_data.get('mail_di_recupero')
+      record.forward = formemail.cleaned_data.get('forward')
 
       print('stato password_change_enabled')
       print('password_change_enabled originale',record.password_change_enabled)
@@ -624,6 +625,7 @@ def UserEdit(request):
     temp['limit_mail_quota'] = record.limit_mail_quota
     temp['password_change_enabled'] = record.password_change_enabled
     temp['passwordchanged'] = False
+    temp['forward'] = record.forward
   
     formemail  = formEmail(temp)
     formemail.update()