gestione.domain.edit.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script>
  4. function UpdateHome() {
  5. if (document.getElementById("home").value.length == 0 ) {
  6. document.getElementById("home").value = document.getElementById("dominio").value;
  7. }
  8. }
  9. function OnSync() {
  10. jQuery.noConflict();
  11. $.get('/dashboard4/domini/OnSync',
  12. function(data,status) {
  13. alert("Data: " + data + "\nStatus: " + status);
  14. }
  15. );
  16. }
  17. </script>
  18. {% endblock %}
  19. {% load domini_tags %}
  20. {% block top %}
  21. <p>
  22. utente che sta effettuando aggiornamenti: {{ utenteautorizzato.mail }}@{{ utenteautorizzato.domain.nome }}
  23. </p>
  24. {% endblock %}
  25. {% block body %}
  26. <div>Gestione Amministrativa del Dominio</div>
  27. <p>Dominio: {{ dominio.id }}: {{ dominio.nome }}</p>
  28. <div>
  29. <div>
  30. {% if checkpassword.errors %}
  31. <p>
  32. Sono stati rilevati degli errori e non e' possibile continuare
  33. {{ checkpassword.errors }}
  34. </p>
  35. {% endif %}
  36. <form name='domainedit' method='post'>
  37. {% csrf_token %}
  38. {% if 'DOMINIEDITCAUSALI' in securitylist %}
  39. <div class='form-group'>
  40. <div class='row'>
  41. <div class='col'>
  42. {% if display_last_causale %}
  43. Ultima Causale Registrata: {{ display_last_causale }} <br><p>
  44. {% if dominio_storia %}
  45. {% for ssl in dominio_storia %}
  46. <p>{{ ssl.causale.nome }} {{ ssl.data }} {%endfor %}
  47. {% endif %}
  48. {% endif %}
  49. </div>
  50. </div>
  51. <p></p>
  52. <div class='row'>
  53. <div class='col'>
  54. <select class='form-control' id='causale' name='causale'>
  55. <option value="0">-- -- --</option>
  56. {% for i in causali %}
  57. <option value="{{ i.id }}" {% if i.id|stringformat:'s' == domainedit.causale.value|stringformat:'s' %} selected {% endif %}>{{ i.nome }}</option>
  58. {% endfor %}
  59. </select>
  60. </div>
  61. <div class='col'>
  62. <button type='submit' class='btn btn-secondary' name="confermacausale" value="confermacausale">Conferma</button>
  63. <button type='button' class='btn btn-secondary' name='toggle' data-toggle='modal' data-target='#ListaUltimeCausaliRegistrate'>Ultime Causali Registrate</button>
  64. <button type='submit' class='btn btn-secondary' name='Ritorna'>Ritorna</button>
  65. <label for='rinnovo_automatico'>Rinnovo Automatico</label>
  66. <input type='checkbox' class='form-check-input' id='rinnovo_automatico' name='rinnovo_automatico' {% if domainedit.rinnovo_automatico.value %} checked {% endif %}>
  67. </div>
  68. </div>
  69. <!-- Modal -->
  70. <div id='ListaUltimeCausaliRegistrate' class='modal fade' role='dialog' tabindex='-1' aria-labelledby='Update' aria-hidden='true'>
  71. <div class='modal-dialog modal-lg' role='document'>
  72. <!-- inizio contenuto modale-->
  73. <div class='modal-content'>
  74. <div class='modal-header'>
  75. <h4>Lista Ultime Causali Utilizzate</h3>
  76. </div>
  77. <div>
  78. <ul class='list-group'>
  79. {% for lc in UltimaStoriaCausali %}
  80. <li class='list-group-item'>{{ lc.data|DateFromUnixTimeStamp }} {{ lc.causale.nome }}</li>
  81. {% endfor %}
  82. </ul>
  83. </div>
  84. <div class='modal-footer'>
  85. <input type='button' class='btn btn-outline-dark' data-dismiss='modal' value='Chiudi'></button>
  86. </div>
  87. </div>
  88. <!-- fine del contenuto modale -->
  89. </div>
  90. </div>
  91. {% endif %}
  92. <div class='row'>&nbsp;</div>
  93. <div class='row'>
  94. <div class='col'>
  95. <label for='dominio'>Dominio </label>
  96. <input type='text' class='form-control' id='dominio' name='dominio' placeholder='nome dominio (obbligatorio)' value='{{ domainedit.dominio.value }}' {% if not 'DOMINIEDITDOMAIN' in securitylist or not domainedit.edit.value %} readonly {% endif %} onchange='UpdateHome()'>
  97. </div>
  98. <div class='col'>
  99. <label for='public_email'>Email Pubblica</label>
  100. <input type='text' class='form-control' id='public_email' name='public_email' value='{{ domainedit.public_email.value }}' {% if not 'DOMINIEDITPUBLICEMAIL' in securitylist or not domainedit.edit.value %} readonly {% endif %}>
  101. </div>
  102. </div>
  103. <div class='row'>
  104. <div class='col'>
  105. <label for='proprietario'>Owner</label>
  106. <textarea name='proprietario' class='form-control' rows='5'>{{ domainedit.proprietario.value }}</textarea>
  107. </div>
  108. </div>
  109. <div class='row'>
  110. <div class='col'>
  111. <label for='contatti'>Contatti Email (Separare le email con spazi o virgole)</label>
  112. <input type='text' class='form-control' id='contatti' name='contatti' value='{{ domainedit.contatti.value }}'/>
  113. </div>
  114. </div>
  115. <br>
  116. <div class='row'>
  117. <div class='col'>
  118. <div class='form-group'>
  119. <label for='target'>Target di Fatturazione</label>
  120. <select class='form-control' id='target' name='target'>
  121. {% for i in target %}
  122. <option value='{{ i.id }}' {% if i.id|stringformat:'s' == domainedit.target.value|stringformat:'s' %} selected {% endif %}>{{ i.nome }} - Max Size: {{ i.spazio }}</options>
  123. {% endfor %}
  124. </select>
  125. </div>
  126. </div>
  127. </div>
  128. <hr>
  129. Servizi assegnati al dominio:
  130. {% if dsf %}
  131. <div class='row'>
  132. <table class="table table-striped">
  133. <thead>
  134. <th>Id</th>
  135. <th>Servizio</th>
  136. <th>Attivazione</th>
  137. </thead>
  138. <tbody>
  139. {% for row in dsf %}
  140. <tr>
  141. <th scope="row">{{ row.servizio.id }}</th>
  142. <td>{{ row.servizio.nome }}</td>
  143. <td>{{ row.attivazione }}</td>
  144. <td {% if row.disattivazione %}style="text-decoration:line-through red;" {% endif %}>{{ row.disattivazione }}</td>
  145. </tr>
  146. {% endfor %}
  147. </tbody>
  148. </table>
  149. </div>
  150. {% else %}
  151. Non sono stati registrati servizi!
  152. {% endif %}
  153. <hr>
  154. <div class='row form-group'>
  155. <div class='col'>
  156. <label for='dic'>Inizio Contratto</label>
  157. <input type='text' class='form-control' id='idc' placeholder='inizio' name='date_start_contract' value='{{ domainedit.date_start_contract.value | date:'d/m/Y' }}' {% if not 'DOMINIDATE' in securitylist and not domainedit.edit.value %} readonly {% endif %}>
  158. </div>
  159. <div class='col'>
  160. <label for='psc'>Prossima Scadenza Contratto</label>
  161. <input type='text' class='form-control' id='psc' placeholder='sc. contratto' name='date_expire_contract' value='{{ domainedit.date_expire_contract.value | date:'d/m/Y' }}' {% if not 'DOMINIDATE' in securitylist and not domainedit.edit.value %} readonly {% endif %}>
  162. </div>
  163. <div class='col'>
  164. <label for='psr'>Prossima Scadenza Registrazione</label>
  165. <input type='text' class='form-control' id='psr' placeholder='sc. registrazione' name='date_expire_registrar' value='{{ domainedit.date_expire_registrar.value | date:'d/m/Y' }}' {% if not 'DOMINIDATE' in securitylist and not domainedit.edit.value %} readonly='' {% endif %}>
  166. </div>
  167. </div>
  168. <div class='form-group'>
  169. <label for='home'>Home</label>
  170. <input type='text' class='form-control' id='home' name='home' value='{{ domainedit.home.value }}'>
  171. </div>
  172. {% if 'DOMINIEDITREGISTRAR' in securitylist %}
  173. <div class='form-group'>
  174. <label for='registrar'>Registrar</label>
  175. <select class='form-control' id='registrar' name='registrar' {% if not domainedit.edit.value %} readonly {% endif %}>
  176. {% for i in registrar %}
  177. <option value="{{ i.id }}" {% if i.id|stringformat:'s' == domainedit.registrar.value|stringformat:'s' %} selected {% endif %}>{{ i.nome }} ({% if i.registrazione %}Gestito Da noi{% else %}Gestito dal cliente {% endif %})</option>
  178. {% endfor %}
  179. </select>
  180. {% endif %}
  181. <div class='form-group'>
  182. <label for='mail_server'>Mail Server</label>
  183. <select class='form-control' id='mail_server' name='mail_server' {% if not domainedit.edit.value %} readonly {% endif %}>
  184. {% for i in mailserver %}
  185. <option value="{{ i.id }}" {% if i.id|stringformat:'s' == domainedit.mail_server.value|stringformat:'s' %} selected {% endif %}>
  186. {{ i.id }} {{ i.nome }} {{ i.nota }}</option>
  187. {% endfor %}
  188. </select>
  189. </div>
  190. <div class='form-group'>
  191. <label for='lmtp_server'>Lmtp Server</label>
  192. <select class='form-control' id='lmtp_server' name='lmtp_server' {% if not domainedit.edit.value %} readonly {% endif %}>
  193. {% for i in mailserver %}
  194. <option value="{{ i.id }}" {% if i.id|stringformat:'s' == domainedit.lmtp_server.value|stringformat:'s' %} selected {% endif %}>
  195. {{ i.id }} {{ i.nome }} {{ i.nota }}</option>
  196. {% endfor %}
  197. </select>
  198. </div>
  199. <div class='form-group'>
  200. <label for='mail_server'>Mail Proxy</label>
  201. <select class='form-control' id='mail_proxy' name='mail_proxy' {% if not domainedit.edit.value %} readonly {% endif %}>
  202. {% for i in mailserver %}
  203. <option value="{{ i.id }}" {% if i.id|stringformat:'s' == domainedit.mail_proxy.value|stringformat:'s' %} selected {% endif %}>
  204. {{ i.id }} {{ i.nome }} {{ i.nota }}</option>
  205. {% endfor %}
  206. </select>
  207. </div>
  208. <div class='form-group'>
  209. <label for='mail_server'>Mail Database Server</label>
  210. <select class='form-control' id='sql_remote' name='sql_remote' {% if not domainedit.edit.value %} readonly {% endif %}>
  211. {% for i in mailserver %}
  212. <option value="{{ i.id }}" {% if i.id|stringformat:'s' == domainedit.sql_remote.value|stringformat:'s' %} selected {% endif %}>
  213. {{ i.id }} {{ i.nome }} {{ i.nota }}</option>
  214. {% endfor %}
  215. </select>
  216. </div>
  217. <div>
  218. <label for='OnSync'>Sincronizza Utenti</label>
  219. <button type='button' class='form-control btn btn-secondary' name='OnSync' id='OnSync' onclick="OnSync">Sincronizza Utenti</button>
  220. </div>
  221. <div class='row'>
  222. <div class='col text-center'>
  223. <label for='enabled'>attivo</label>
  224. <input type='checkbox' class='form-check-input' id='enabled' name='enabled' {% if domainedit.enabled.value %} checked {% endif %}>
  225. </div>
  226. <div class='col text-center'>
  227. <label for='tobedeleted'>Dominio Impostato per la cancellazione</label>
  228. <input type='checkbox' class='form-check-input' id='tobedeleted' name='tobedeleted' {% if domainedit.tobedeleted.value %} checked {% endif %}{% if not domainedit.edit.value %} readonly {% endif %}>
  229. </div>
  230. </div>
  231. <br>
  232. <div class='row'>
  233. <div class='col text-center'>
  234. <label for='mail'>mail</label>
  235. <input type='checkbox' class='form-check-input' id='mail' name='mail' {% if domainedit.mail.value %} checked {% endif %}>
  236. </div>
  237. <div class='col text-center'>
  238. <label for='pop3'>Pop3</label>
  239. <input type='checkbox' class='form-check-input' id='pop3' name='pop3' {% if domainedit.pop3.value %} checked {% endif %}>
  240. </div>
  241. <div class='col text-center'>
  242. <label for='imap'>Imap</label>
  243. <input type='checkbox' class='form-check-input' id='imap' name='imap' {% if domainedit.imap.value %} checked {% endif %}>
  244. </div>
  245. <div class='col text-center'>
  246. <label for='smtp'>Smtp</label>
  247. <input type='checkbox' class='form-check-input' id='smtp' name='smtp' {% if domainedit.smtp.value %} checked {% endif %}>
  248. </div>
  249. <div class='col text-center'>
  250. <label for='smtp_relay'>Relay</label>
  251. <input type='checkbox' class='form-check-input' id='smtp_relay' name='smtp_relay' {% if domainedit.smtp_relay.value %} checked {% endif %}>
  252. </div>
  253. <div class='col text-center'>
  254. <label for='webmail'>Webmail</label>
  255. <input type='checkbox' class='form-check-input' id='webmail' name='webmail' {% if domainedit.webmail.value %} checked {% endif %}>
  256. </div>
  257. <div class='col text-center'>
  258. <label for='nextcloud'>NextCloud</label>
  259. <input type='checkbox' class='form-check-input' id='nextcloud' name='nextcloud' {% if domainedit.nextcloud.value %} checked {% endif %}>
  260. </div>
  261. <div class='col text-center'>
  262. <label for='nextcloud_pwd'>NextCloud Pwd Sync</label>
  263. <input type='checkbox' class='form-check-input' id='nextcloud_pwd' name='nextcloud_pwd' {% if domainedit.nextcloud_pwd.value %} checked {% endif %}>
  264. </div>
  265. <div class='col text-center'>
  266. <label for='sendafile'>Send A File</label>
  267. <input type='checkbox' class='form-check-input' id='sendafile' name='sendafile' {% if domainedit.sendafile.value %} checked {% endif %}>
  268. </div>
  269. <div class='col text-center'>
  270. <label for='sms'>Sms</label>
  271. <input type='checkbox' class='form-check-input' id='sms' name='sms' {% if domainedit.sms.value %} checked {% endif %}>
  272. </div>
  273. </div>
  274. <hr>
  275. <div class='row'>
  276. <div class='col text-center'>
  277. <label for='lmtp'>Lmtp</label>
  278. <input type='checkbox' class='form-check-input' id='lmtp' name='lmtp' {% if domainedit.lmtp.value %} checked {% endif %}>
  279. </div>
  280. <div class='col text-center'>
  281. <label for='sieve'>Sieve</label>
  282. <input type='checkbox' class='form-check-input' id='sieve' name='sieve' {% if domainedit.sieve.value %} checked {% endif %}>
  283. </div>
  284. <div class='col text-center'>
  285. <label for='antivirus'>Antivirus</label>
  286. <input type='checkbox' class='form-check-input' id='antivirus' name='antivirus' {% if domainedit.antivirus.value %} checked {% endif %}>
  287. </div>
  288. <div class='col text-center'>
  289. <label for='spf'>Spf</label>
  290. <input type='checkbox' class='form-check-input' id='spf' name='spf' {% if domainedit.spf.value %} checked {% endif %}>
  291. </div>
  292. <div class='col text-center'>
  293. <label for='blacklist'>Blacklist</label>
  294. <input type='checkbox' class='form-check-input' id='blacklist' name='blacklist' {% if domainedit.blacklist.value %} checked {% endif %}>
  295. </div>
  296. <div class='col text-center'>
  297. <label for='ftp'>Ftp</label>
  298. <input type='checkbox' class='form-check-input' id='ftp' name='ftp' {% if domainedit.ftp.value %} checked {% endif %}>
  299. </div>
  300. <div class='col text-center'>
  301. <label for='sql'>Sql</label>
  302. <input type='checkbox' class='form-check-input' id='sql' name='sql' {% if domainedit.sql.value %} checked {% endif %}>
  303. </div>
  304. <div class='col text-center'>
  305. <label for='http'>Http</label>
  306. <input type='checkbox' class='form-check-input' id='http' name='http' {% if domainedit.http.value %} checked {% endif %}>
  307. </div>
  308. <div class='col text-center'>
  309. <label for='proxy'>Proxy</label>
  310. <input type='checkbox' class='form-check-input' id='proxy' name='proxy' {% if domainedit.proxy.value %} checked {% endif %}>
  311. </div>
  312. </div>
  313. <hr>
  314. <div class='row'>
  315. <div class='col text-center'>
  316. <label for='Account'>Account di posta</label>
  317. <input type='number' class='form-control' id='max_account' name='max_account' value={{ domainedit.max_account.value }}>
  318. </div>
  319. <div class='col text-center'>
  320. <label for='max_alias'>Alias</label>
  321. <input type='number' class='form-control' id='max_alias' name='max_alias' value={{ domainedit.max_alias.value }}>
  322. </div>
  323. <div class='col text-center'>
  324. <label for='max_alias'>Liste</label>
  325. <input type='number' class='form-control' id='max_list' name='max_list' value={{ domainedit.max_list.value }}>
  326. </div>
  327. </div>
  328. <hr>
  329. <div class='row'>
  330. <div class='col text-center'>
  331. <label for='account_used'>Account Usati</label>
  332. <input type='text' class='form-control' id='account_used' name='account_used' value="{{ domainedit.account_used.value }}" readonly>
  333. </div>
  334. <div class='col text-center'>
  335. <label for='alias_used'>Alias Utilizzati</label>
  336. <input type='text' class='form-control' id='alias_used' name='alias_used' value="{{ domainedit.alias_used.value }}" readonly>
  337. </div>
  338. <div class='col text-center'>
  339. <label for='list_used'>Liste Utilizzate</label>
  340. <input type='test' class='form-control' id='list_used' name='list_used' value="{{ domainedit.list_used.value }}" readonly>
  341. </div>
  342. </div>
  343. <hr>
  344. Quote utilizzate (I valori sono espressi in Mega)
  345. <div class='row'>
  346. <div class='col'>
  347. <label for='mail_quota'>Mail Quota</label>
  348. <input type='text' class='form-control' id='mail_quota' name='mail_quota' value='{{ dominio.mail_quota }}' readonly>
  349. </div>
  350. <div class='col'>
  351. <label for='http_quota'>Http Quota</label>
  352. <input type='Text' class='form-control' id='http_quota' name='http_quota' value='{{ dominio.http_quota }}' readonly>
  353. </div>
  354. <div class='col'>
  355. <label for='ftp_quota'>Ftp Quota</label>
  356. <input type='Text' class='form-control' id='ftp_quota' name='ftp_quota'value='{{ dominio.ftp_quota }}' readonly>
  357. </div>
  358. <div class='col'>
  359. <label for='http_quota'>Sql Quota</label>
  360. <input type='Text' class='form-control' id='http_quota' name='sql_quota' value='{{ dominio.sql_quota }}' readonly>
  361. </div>
  362. <div class='col'>
  363. <label for='nextcloud_quota'>Nextcloud quota</label>
  364. <input type='text' class='form-control' id='Nextcloud_quota' name='nextcloud_quota' value='{{ dominio.nextcloud_quota }}' readonly>
  365. </div>
  366. <div class='col'>
  367. <label for='totale'>Totale</label>
  368. <input type='text' class='form-control' id='Totale' name='totale' value='{{ totale }}' readonly>
  369. </div>
  370. </div>
  371. <hr>
  372. <div class='row form-group'>
  373. <div class='col text-center'>
  374. <label for='warning_mail_quota'>Quota Allarme per Utente</label>
  375. <input type='number' class='form-control' id='warning_mail_quota' name='warning_mail_quota' value={{ domainedit.warning_mail_quota.value }}>
  376. </div>
  377. <div class='col'>
  378. <label class='form-check-label' for='warning_mail_quota_check'>Controllo Soglia</label>:
  379. <input type='checkbox' class='form-check-label' id='warning_mail_quota_check' name='warning_mail_quota_check' {% if domainedit.warning_mail_quota_check.value %} checked {% endif %}>
  380. </div>
  381. <div class='col text-center'>
  382. <label class='form-check-label' for='update_mail_quota'>Aggiorna Quota Email</label>:
  383. <input type='checkbox' class='form-check-input'' id='update_mail_quota' name='update_mail_quota' {% if domainedit.update_mail_quota.value %} checked {% endif %}>
  384. </div>
  385. <div class='col text-center'>
  386. <label class=ìform-check-label' for='force_update_mail_quota'>Forza Aggiornamento</label>:
  387. <input type='checkbox' class='form-check-input' id='force_update_mail_quota' name='force_update_mail_quota' {% if domainedit.force_update_mail_quota.value %} checked {% endif %}>
  388. </div>
  389. </div>
  390. <hr>
  391. {% if ftplist %}
  392. Spazio FTP assegnato
  393. <table class='table table-striped table-hover'>
  394. <thead class='thead-dark'>
  395. <tr>
  396. <th>Utente</th>
  397. <th>Home</th>
  398. <th>Quota</th>
  399. </tr>
  400. </thead>
  401. <tbody>
  402. {% for f in ftplist %}
  403. <tr>
  404. <td>{{ f.utente }}</td>
  405. <td>{{ f.homedir }}</td>
  406. <td>{{ f.quota }}</td>
  407. </tr>
  408. {% endfor %}
  409. </tbody>
  410. </table>
  411. {% endif %}
  412. <div class='row form-group'>
  413. <label for='nota'>Note e appunti</label>
  414. <textarea name='nota' class='form-control' rows='5'>{{ domainedit.nota.value }}</textarea>
  415. </div>
  416. {% if 'EDITUSEROPTIONS' in securitylist %}
  417. <label for='edit' class='form-check-label'>Editing Campi Protetti</label>:
  418. <input type='checkbox' class='form-check-input' id='edit' name='edit' {% if domainedit.edit.value %} checked {% endif %}>
  419. {% endif %}
  420. <div>
  421. <div class='row'>
  422. {% if domainedit.errors %}
  423. <div class='row'>
  424. Rilevati Errori, impossibile proseguire.
  425. </div>
  426. <div class='row'>
  427. {% for f in domainedit %}
  428. {% for e in f.errors %}
  429. <div class="alter alter-danger">
  430. <strong>{{f.label|escape }}: {{ e|escape }}</strong>
  431. </div>
  432. {% endfor %}
  433. {% endfor %}
  434. </div>
  435. <div class='row'>
  436. {% for e in domainedit.non_field_errors %}
  437. <div class="alter alter-danger">
  438. <strong>{{ e|escape }}</strong>
  439. </div>
  440. {% endfor %}
  441. </div>
  442. {% endif %}
  443. </div>
  444. </div>
  445. <hr>
  446. <div class='btn-group' role='group' aria-label='conferme'>
  447. <button type='submit' class='btn btn-primary active'>Conferma</button>
  448. <button type='reset' class='btn btn-secondary'>Reset</button>
  449. <button type='submit' class='btn btn-secondary' name='Ritorna'>Ritorna (Senza Salvare)</button>
  450. </div>
  451. </form>
  452. </div>
  453. {% endblock %}