edit.tmpl 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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="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">
  39. </div>
  40. <input class="fake" type="password">
  41. <div class="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}}">
  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_username">{{.i18n.Tr "admin.auths.attribute_username"}}</label>
  67. <input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{.i18n.Tr "admin.auths.attribute_username_placeholder"}}">
  68. </div>
  69. <div class="field">
  70. <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
  71. <input id="attribute_name" name="attribute_name" value="{{$cfg.AttributeName}}">
  72. </div>
  73. <div class="field">
  74. <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
  75. <input id="attribute_surname" name="attribute_surname" value="{{$cfg.AttributeSurname}}">
  76. </div>
  77. <div class="required field">
  78. <label for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
  79. <input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="e.g. mail" required>
  80. </div>
  81. {{end}}
  82. <!-- SMTP -->
  83. {{if .Source.IsSMTP}}
  84. {{ $cfg:=.Source.SMTP }}
  85. <div class="inline required field">
  86. <label>{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  87. <div class="ui selection type dropdown">
  88. <input type="hidden" id="smtp_auth" name="smtp_auth" value="{{$cfg.Auth}}" required>
  89. <div class="text">{{$cfg.Auth}}</div>
  90. <i class="dropdown icon"></i>
  91. <div class="menu">
  92. {{range .SMTPAuths}}
  93. <div class="item" data-value="{{.}}">{{.}}</div>
  94. {{end}}
  95. </div>
  96. </div>
  97. </div>
  98. <div class="required field">
  99. <label for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  100. <input id="smtp_host" name="smtp_host" value="{{$cfg.Host}}" required>
  101. </div>
  102. <div class="required field">
  103. <label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  104. <input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required>
  105. </div>
  106. <div class="field">
  107. <label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label>
  108. <input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}">
  109. <p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p>
  110. </div>
  111. {{end}}
  112. <!-- PAM -->
  113. {{if .Source.IsPAM}}
  114. {{ $cfg:=.Source.PAM }}
  115. <div class="required field">
  116. <label for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label>
  117. <input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required>
  118. </div>
  119. {{end}}
  120. <div class="inline field {{if not (or (or .Source.IsLDAP .Source.IsDLDAP) .Source.IsSMTP)}}hide{{end}}">
  121. <div class="ui checkbox">
  122. <label><strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong></label>
  123. <input name="tls" type="checkbox" {{if .Source.UseTLS}}checked{{end}}>
  124. </div>
  125. </div>
  126. <div class="inline field {{if not (or (or .Source.IsLDAP .Source.IsDLDAP) .Source.IsSMTP)}}hide{{end}}">
  127. <div class="ui checkbox">
  128. <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label>
  129. <input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}>
  130. </div>
  131. </div>
  132. <div class="inline field">
  133. <div class="ui checkbox">
  134. <label><strong>{{.i18n.Tr "admin.auths.activated"}}</strong></label>
  135. <input name="is_active" type="checkbox" {{if .Source.IsActived}}checked{{end}}>
  136. </div>
  137. </div>
  138. <div class="field">
  139. <button class="ui green button">{{.i18n.Tr "admin.auths.update"}}</button>
  140. <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.i18n.Tr "admin.auths.delete"}}</div>
  141. </div>
  142. </form>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <div class="ui small basic delete modal">
  149. <div class="ui icon header">
  150. <i class="trash icon"></i>
  151. {{.i18n.Tr "admin.auths.delete_auth_title"}}
  152. </div>
  153. <div class="content">
  154. <p>{{.i18n.Tr "admin.auths.delete_auth_desc"}}</p>
  155. </div>
  156. {{template "base/delete_modal_actions" .}}
  157. </div>
  158. {{template "base/footer" .}}