edit.tmpl 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {{template "base/head" .}}
  2. <div class="admin edit authentication">
  3. <div class="ui container">
  4. <div class="ui grid">
  5. {{template "admin/navbar" .}}
  6. <div class="twelve wide column content">
  7. {{template "base/alert" .}}
  8. <h4 class="ui top attached header">
  9. {{.i18n.Tr "admin.auths.edit"}}
  10. </h4>
  11. <div class="ui attached segment">
  12. <form class="ui form" action="{{.Link}}" method="post">
  13. {{.CsrfTokenHtml}}
  14. <input type="hidden" name="id" value="{{.Source.ID}}">
  15. <div class="inline field">
  16. <label>{{$.i18n.Tr "admin.auths.auth_type"}}</label>
  17. <input type="hidden" name="type" value="{{.Source.Type}}">
  18. <span>{{.Source.TypeName}}</span>
  19. </div>
  20. <div class="required inline field {{if .Err_Name}}error{{end}}">
  21. <label for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
  22. <input id="name" name="name" value="{{.Source.Name}}" autofocus required>
  23. </div>
  24. <!-- LDAP and DLDAP -->
  25. {{if or .Source.IsLDAP .Source.IsDLDAP}}
  26. {{ $cfg:=.Source.LDAP }}
  27. <div class="required field">
  28. <label for="host">{{.i18n.Tr "admin.auths.host"}}</label>
  29. <input id="host" name="host" value="{{$cfg.Host}}" placeholder="e.g. mydomain.com" required>
  30. </div>
  31. <div class="required field">
  32. <label for="port">{{.i18n.Tr "admin.auths.port"}}</label>
  33. <input id="port" name="port" value="{{$cfg.Port}}" placeholder="e.g. 636" required>
  34. </div>
  35. {{if .Source.IsLDAP}}
  36. <div class="required field">
  37. <label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
  38. <input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com" required>
  39. </div>
  40. <input class="fake" type="password">
  41. <div class="required field">
  42. <label for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label>
  43. <input id="bind_password" name="bind_password" type="password" value="{{$cfg.BindPassword}}" required>
  44. <p class="help text red">{{.i18n.Tr "admin.auths.bind_password_helper"}}</p>
  45. </div>
  46. <div class="required field">
  47. <label for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
  48. <input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com" required>
  49. </div>
  50. {{end}}
  51. {{if .Source.IsDLDAP}}
  52. <div class="required field">
  53. <label for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label>
  54. <input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com" required>
  55. </div>
  56. {{end}}
  57. <div class="required field">
  58. <label for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
  59. <input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="e.g. (&(objectClass=posixAccount)(uid=%s))" required>
  60. </div>
  61. <div class="field">
  62. <label for="admin_filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
  63. <input id="admin_filter" name="admin_filter" value="{{$cfg.AdminFilter}}">
  64. </div>
  65. <div class="field">
  66. <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
  67. <input id="attribute_name" name="attribute_name" value="{{$cfg.AttributeName}}">
  68. </div>
  69. <div class="field">
  70. <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
  71. <input id="attribute_surname" name="attribute_surname" value="{{$cfg.AttributeSurname}}">
  72. </div>
  73. <div class="required field">
  74. <label for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
  75. <input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="e.g. mail" required>
  76. </div>
  77. {{end}}
  78. <!-- SMTP -->
  79. {{if .Source.IsSMTP}}
  80. {{ $cfg:=.Source.SMTP }}
  81. <div class="inline required field">
  82. <label>{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  83. <div class="ui selection type dropdown">
  84. <input type="hidden" id="smtp_auth" name="smtp_auth" value="{{$cfg.Auth}}" required>
  85. <div class="text">{{$cfg.Auth}}</div>
  86. <i class="dropdown icon"></i>
  87. <div class="menu">
  88. {{range .SMTPAuths}}
  89. <div class="item" data-value="{{.}}">{{.}}</div>
  90. {{end}}
  91. </div>
  92. </div>
  93. </div>
  94. <div class="required field">
  95. <label for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  96. <input id="smtp_host" name="smtp_host" value="{{$cfg.Host}}" required>
  97. </div>
  98. <div class="required field">
  99. <label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  100. <input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required>
  101. </div>
  102. <div class="field">
  103. <label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label>
  104. <input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}">
  105. <p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p>
  106. </div>
  107. {{end}}
  108. <!-- PAM -->
  109. {{if .Source.IsPAM}}
  110. {{ $cfg:=.Source.PAM }}
  111. <div class="required field">
  112. <label for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label>
  113. <input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required>
  114. </div>
  115. {{end}}
  116. <div class="inline field {{if not (or (or .Source.IsLDAP .Source.IsDLDAP) .Source.IsSMTP)}}hide{{end}}">
  117. <div class="ui checkbox">
  118. <label><strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong></label>
  119. <input name="tls" type="checkbox" {{if .Source.UseTLS}}checked{{end}}>
  120. </div>
  121. </div>
  122. <div class="inline field {{if not (or (or .Source.IsLDAP .Source.IsDLDAP) .Source.IsSMTP)}}hide{{end}}">
  123. <div class="ui checkbox">
  124. <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label>
  125. <input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>
  126. </div>
  127. </div>
  128. <div class="inline field">
  129. <div class="ui checkbox">
  130. <label><strong>{{.i18n.Tr "admin.auths.activated"}}</strong></label>
  131. <input name="is_active" type="checkbox" {{if .Source.IsActived}}checked{{end}}>
  132. </div>
  133. </div>
  134. <div class="field">
  135. <button class="ui green button">{{.i18n.Tr "admin.auths.update"}}</button>
  136. <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.i18n.Tr "admin.auths.delete"}}</div>
  137. </div>
  138. </form>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="ui small basic delete modal">
  145. <div class="ui icon header">
  146. <i class="trash icon"></i>
  147. {{.i18n.Tr "admin.auths.delete_auth_title"}}
  148. </div>
  149. <div class="content">
  150. <p>{{.i18n.Tr "admin.auths.delete_auth_desc"}}</p>
  151. </div>
  152. {{template "base/delete_modal_actions" .}}
  153. </div>
  154. {{template "base/footer" .}}