2
0

Ftp.Edit.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script>
  4. function updatepasswordchanged() {
  5. document.getElementById('passwordchanged').value=1;
  6. }
  7. function getJsonPassword() {
  8. jQuery.noConflict();
  9. $.getJSON('/dashboard4/configurazione',
  10. function(data) {
  11. console.log(data);
  12. $('#clear').val(data.newPassword);
  13. $('#password1').val(data.newPassword);
  14. $('#password2').val(data.newPassword);
  15. $('#password1').get(0).type='text';
  16. $('#password2').get(0).type='text';
  17. });
  18. }
  19. </script>
  20. <script>
  21. function setPasswordField() {
  22. if( $('#password_change_enabled').is(":checked")) {
  23. $('#password1').attr('readonly',false);
  24. $('#password2').attr('readonly',false);
  25. $('#UpdatePWD').attr('disabled',false);
  26. $('#UpdatePWD').click(getJsonPassword);
  27. } else {
  28. $('#password1').attr('readonly',true);
  29. $('#password2').attr('readonly',true);
  30. $('#UpdatePWD').attr('disabled',true);
  31. $('#UpdatePWD').click(false);
  32. }
  33. };
  34. </script>
  35. <script>
  36. $(document).ready(function() { setPasswordField(); });
  37. </script>
  38. <script>
  39. $(function () {
  40. $('updatepwd').popover({
  41. container: 'body'
  42. });
  43. });
  44. </script>
  45. {% endblock %}
  46. {% block top %}
  47. <p>
  48. utente che sta effettuando gli aggiornamenti {{ utenteautorizzato.mail }}@{{ utenteautorizzato.domain.nome }}
  49. </p>
  50. {% if user %}
  51. <p>
  52. si stanno effettuando aggiornamenti su: {{ formftp.utente.value }}@{{ formftp.dominio_domain.value }}
  53. </p>
  54. <p>Home attuale: {{ formftp.homedir.value }}</p>
  55. {% endif %}
  56. {% endblock %}
  57. {% block body %}
  58. <div>Pannello Controllo Ftp - Aggiornamento</div>
  59. <div></div>
  60. <div>
  61. <br>
  62. <div>
  63. {% if formftp.errors %}
  64. <p>Rilevati Errori, impossibile proseguire.</p>
  65. <br>
  66. {% for f in formftp %}
  67. {% for e in f.errors %}
  68. <div class="alter alter-danger">
  69. <strong>{{f.label|escape }}: {{ e|escape }}</strong>
  70. </div>
  71. {% endfor %}
  72. {% endfor %}
  73. {% for e in formemail.non_field_errors %}
  74. <div class="alter alter-danger">
  75. <strong>{{ e|escape }}</strong>
  76. </div>
  77. {% endfor %}
  78. {% endif %}
  79. </div>
  80. </br>
  81. </div>
  82. <form name='ftpedit' method='post'>
  83. {% csrf_token %}
  84. <div class='row'>
  85. <div class='col'>
  86. <label for='utente'>Ftp Account</label>
  87. <input type='text' class='form-control' id='user' name='utente' placeholder='account ftp' value='{{ formftp.utente.value }}' {% if not CANWRITE and not 'EDITUSERNEW' in securitylist %} readonly='' {% endif %}>
  88. </div>
  89. <div class='col'>
  90. <label for='domain'>Dominio</label>
  91. <input type='text' class='form-control' id='dominio_domain' name='dominio_domain' value='{{ formftp.dominio_domain.value }}' readonly>
  92. <input type='hidden' name='dominio' value='{{ formftp.dominio.value }}'>
  93. </div>
  94. </div>
  95. <div class='row'>
  96. <div class='col'>
  97. l'utente che si collega al server ftp si definisce come: utente @ dominio_di_appartenenza<br>
  98. se l'utente e' nuovo, viene proposto un id univoco.
  99. </div>
  100. </div>
  101. <div class='row'>
  102. <br>
  103. </div>
  104. <div class='row'>
  105. <div class='col'>
  106. <label for="ftpgroup">Posizione Home: {{ formftp.ftpgroup.value}} </label>
  107. <select name='ftpgroup' id='ftpgroup' class='form-control'>
  108. {% for g in ftpgroupv %}
  109. <option value='{{ g.id }}' {% if g.id|stringformat:'s' == formftp.ftpgroup.value|stringformat:'s' %}selected{% endif %}>{{g.id}}: {{ g.nomegruppo }}</option>
  110. {% endfor %}
  111. </select>
  112. </div>
  113. </div>
  114. <div class='row'>
  115. <div class='col'>
  116. <label for='ftpserver' class='label'>Server di accesso:</label>
  117. <select name='ftpserver' id='ftpserver' class='form-control' {% if not formftp.edit %}readonly{% endif %} >
  118. {% for s in ftpserverv %}
  119. <option value='{{ s.id }}' {% if s.id|stringformat:'s' == formftp.ftpserver.value|stringformat:'s' %}selected{% endif %}>{{s.id}}: {{ s.nome }}</option>
  120. {% endfor %}
  121. </select>
  122. </div>
  123. </div>
  124. <div class='row'>
  125. <br>
  126. </div>
  127. <div class='row'>
  128. <div class='col'>
  129. <label for='homedir'>Home</label>
  130. <input type='text' class='form-control' id='homedir' name='homedir' value='{{ formftp.homedir.value }}' readonly>
  131. </div>
  132. </div>
  133. <div class='row'>
  134. <div class='col'>
  135. Posizione fisica del server (puo' servire con alcune applicazioni).
  136. </div>
  137. </div>
  138. <div class='row'>
  139. <br>
  140. </div>
  141. <div class='row form-group' id='updatepwd'>
  142. <div class='col'>
  143. <label for='password1'>Password</label>
  144. <input type='password' class='form-control' id='password1' name='password1' value='{{ formftp.clear.value }}' placeholder='digita la password' {% if not 'FTPEDITPASSWORD' in securitylist %} readonly {% endif %} {% if not formftp.password_change_enabled.value %} readonly {% endif %} oninput='updatepasswordchanged()' data-toggle='popover' title='{{ ftp_password_message }}'>
  145. </div>
  146. <div class='col'>
  147. <label for='password2'>Ripetere</label>
  148. <input type='password' class='form-control' id='password2' name='password2' value='{{ formftp.clear.value }}' placeholder='ripeti la password' {% if not 'FTPEDITPASSWORD' in securitylist %} readonly {% endif %} {% if not formftp.password_change_enabled.value %} readonly {% endif %} oninput='updatepasswordchanged()'>
  149. </div>
  150. {% if 'FTPSHOWPASSWORD' in securitylist %}
  151. <div class='col'>
  152. <label for='clear'>In chiaro</label>
  153. <input type='text' class='form-control' id='clear' name='clear' value='{{ formftp.clear.value }}' readonly>
  154. </div>
  155. <div class='collapse' id='PasswordMemo'>
  156. <h2 class="lead">Requisiti necessari per la password</h2>
  157. <p class="lead">La password non deve essere di lunghezza inferiore a {{ mail_password_length }} caratteri.</p>
  158. <p class="lead">Non deve essere la ripetizione di quella attuale.</p>
  159. <p class="lead">Non devono essere presenti spazi vuoti.</p>
  160. <p class="lead">La password deve contenere almeno un carattere maiuscolo, uno minuscolo, un numero e un simbolo.</p>
  161. </div>
  162. {% endif %}
  163. {% if 'FTPEDITPASSWORD' in securitylist %}
  164. <div class='col'><!-- richiesta nuova password e relativo aggiornamento -->
  165. <label for='UpdatePWD'>Cambia Password</label>
  166. <button type='button' class='form-control btn btn-secondary' name='UpdatePWD' id='UpdatePWD'
  167. {% if formftp.password_change_enabled.value == 1 %} onclick='getJsonPassword()'>
  168. {% else %}Disabled>
  169. {% endif %}Password</button>
  170. </div>
  171. {% endif %}
  172. {% if 'FTPCHANGEPASSWORD' in securitylist %}
  173. <div class='col form-inline'>
  174. <label for='password_change_enabled' class="form-check-label">Cambio password abilitato</label>
  175. <input type='checkbox' class='form-check-input' id='password_change_enabled' name='password_change_enabled' {% if formftp.password_change_enabled.value %} checked {% endif %} onclick='setPasswordField()'>
  176. </div>
  177. {% endif %}
  178. </div>
  179. <hr>
  180. <div class='row'>
  181. {% if 'FTPEDIT' in securitylist %}
  182. <div class='col form-inline'>
  183. <label for='edit' class='form-check-label'>Edit Parametri</label>
  184. <input type='checkbox' class='form-check-input' name='edit' {% if formftp.edit %} checked {% endif %}>
  185. </div>
  186. {% if 'FTPEDIT' in securitylist %}
  187. <div class='col form-inline'>
  188. <label for='enabled' class='form-check-label'>Abilitato:</label>
  189. <input type='checkbox' id='enabled' class='form-check-input' name='enabled' {% if formftp.enabled.value %} checked {% endif %}>
  190. </div>
  191. {% endif %}
  192. {% if 'USERTOBEDELETED' in securitylist %}
  193. <div class='col from-inlineì>
  194. <label class='form-check-label' for='tobedeleted'>Da eliminare:</label>
  195. <input type='checkbox' class='form-check-input' id='tobedeleted' name='tobedeleted' {% if formftp.tobedeleted.value %} checked {% endif %}>
  196. </label>
  197. </div>
  198. {% endif %}
  199. {% endif %}
  200. </div>
  201. <hr class='half-rule'/>
  202. {% if 'EDITUSERINFO' in securitylist %}
  203. <div class='col'>
  204. <div class='row'>
  205. <label for='nota'>Note e appunti</label>
  206. <textarea class='form-control' rows='3' id='note' placeholder='note e appunti'>{{ formftp.nota.value }}</textarea>
  207. </div>
  208. <p></p>
  209. <div class='row'>
  210. <div class='col'>
  211. <label for='quota'>Quota (in Mb):</label>
  212. <input type='text' class='form-control' id='ftp_quota' name='quota' value='{{ ftp.ftp_quota }}' placeholder='0' readonly=''>
  213. </div>
  214. <div class='col'>
  215. <label for='warning_mail_quota'>Spazio suggerito (in Mb):</label>
  216. <input type='text' class='form-control' id='warning_mail_quota' name='warning_mail_quota' value='{{ user.warning_mail_quota }}' placeholder='{{ user.domain.warning_mail_quota }}' {% if not 'EDITUSERWARNINGMAILQUOTA' in securitylist %} readonly='' {% endif %}> (Mbyte - il valore viene calcolato tenendo presente l'intero contenuto della casella, posta cancellata compresa')
  217. </div>
  218. <div class='col'>
  219. <label for='warning_mail_quota_check' class='form-check-label'>Controllo Soglia</label>
  220. <input type='checkbox' class='form-check-input' id='warning_mail_quota_check' name='warning_mail_quota_check' {% if user.warning_mail_quota_check %} checked {% endif %}{% if not 'EDITUSERWARNINGMAILQUOTA' in secufirtlist %} disabled {% endif %}>
  221. </div>
  222. <div class='col'>
  223. <label for='warning_mail_quota_send' class='form-check-label'>Avviso Superamento Soglia</label>
  224. <input type='checkbox' class='form-check-input' id='warning_mail_quota_send' name='warning_mail_quota_send' {% if user.warning_mail_quota_send %} checked {% endif %}{% if not 'EDITUSERWARNINGMAILQUOTA' in securitylist %} disabled {% endif %}>
  225. </div>
  226. </div>
  227. <p></p>
  228. <p></p>
  229. {% endif %}
  230. <div class='form-group'>
  231. <div class='row'>
  232. <div class='col'>
  233. <label class='form-check-label' for='mail_send'>Invia Credenziali</label>
  234. <input type='checkbox' class='form-check-input' id='mail_send' name='mail_send' {% if formftp.mail_send.value %} checked {% endif %}>
  235. </div>
  236. <div class='col'>
  237. <label for='mail'>Destinatario Credenziali</label>
  238. <input type='text' class='form-control' id='mail' name='mail' value='{{ formftp.mail.value }}'>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. <div class='form-group btn-group' role='group' aria-label='conferme'>
  244. <button type='submit' class='btn btn-primary'>Salva/Aggiorna</button>
  245. <button type='reset' class='btn btn-secondary'>Reset</button>
  246. <button type='submit' class='btn btn-secondary' name="Ritorno">Ritorno (Senza salvare)</button>
  247. </div>
  248. </form>
  249. </div>
  250. {% endblock %}