You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
7.2 KiB

10 years ago
  1. {{template "base/head" .}}
  2. <div class="admin new 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.new"}}
  10. </h4>
  11. <div class="ui attached segment">
  12. <form class="ui form" action="{{.Link}}" method="post">
  13. {{.CsrfTokenHtml}}
  14. <!-- Types and name -->
  15. <div class="inline required field {{if .Err_Type}}error{{end}}">
  16. <label>{{.i18n.Tr "admin.auths.auth_type"}}</label>
  17. <div class="ui selection type dropdown">
  18. <input type="hidden" id="auth_type" name="type" value="{{.type}}">
  19. <div class="text">{{.CurTypeName}}</div>
  20. <i class="dropdown icon"></i>
  21. <div class="menu">
  22. {{range .AuthSources}}
  23. <div class="item" data-value="{{.Type}}">{{.Name}}</div>
  24. {{end}}
  25. </div>
  26. </div>
  27. </div>
  28. <div class="required inline field {{if .Err_Name}}error{{end}}">
  29. <label for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
  30. <input id="name" name="name" value="{{.name}}" autofocus required>
  31. </div>
  32. <!-- LDAP and DLDAP -->
  33. <div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}hide{{end}}">
  34. <div class="required field">
  35. <label for="host">{{.i18n.Tr "admin.auths.host"}}</label>
  36. <input id="host" name="host" value="{{.host}}" placeholder="e.g. mydomain.com">
  37. </div>
  38. <div class="required field">
  39. <label for="port">{{.i18n.Tr "admin.auths.port"}}</label>
  40. <input id="port" name="port" value="{{.port}}" placeholder="e.g. 636">
  41. </div>
  42. <div class="ldap field {{if not (eq .type 2)}}hide{{end}}">
  43. <label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
  44. <input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com">
  45. </div>
  46. <input class="fake" type="password">
  47. <div class="ldap field {{if not (eq .type 2)}}hide{{end}}">
  48. <label for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label>
  49. <input id="bind_password" name="bind_password" type="password" value="{{.bind_password}}">
  50. <p class="help text red">{{.i18n.Tr "admin.auths.bind_password_helper"}}</p>
  51. </div>
  52. <div class="ldap required field {{if not (eq .type 2)}}hide{{end}}">
  53. <label for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
  54. <input id="user_base" name="user_base" value="{{.user_base}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com">
  55. </div>
  56. <div class="dldap required field {{if not (eq .type 5)}}hide{{end}}">
  57. <label for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label>
  58. <input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com">
  59. </div>
  60. <div class="required field">
  61. <label for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
  62. <input id="filter" name="filter" value="{{.filter}}" placeholder="e.g. (&(objectClass=posixAccount)(uid=%s))">
  63. </div>
  64. <div class="field">
  65. <label for="admin_filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
  66. <input id="admin_filter" name="admin_filter" value="{{.admin_filter}}">
  67. </div>
  68. <div class="field">
  69. <label for="attribute_username">{{.i18n.Tr "admin.auths.attribute_username"}}</label>
  70. <input id="attribute_username" name="attribute_username" value="{{.attribute_username}}" placeholder="{{.i18n.Tr "admin.auths.attribute_username_placeholder"}}">
  71. </div>
  72. <div class="field">
  73. <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
  74. <input id="attribute_name" name="attribute_name" value="{{.attribute_name}}">
  75. </div>
  76. <div class="field">
  77. <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
  78. <input id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}">
  79. </div>
  80. <div class="required field">
  81. <label for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
  82. <input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="e.g. mail">
  83. </div>
  84. </div>
  85. <!-- SMTP -->
  86. <div class="smtp field {{if not (eq .type 3)}}hide{{end}}">
  87. <div class="inline required field">
  88. <label>{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  89. <div class="ui selection type dropdown">
  90. <input type="hidden" id="smtp_auth" name="smtp_auth" value="{{.smtp_auth}}">
  91. <div class="text">{{.smtp_auth}}</div>
  92. <i class="dropdown icon"></i>
  93. <div class="menu">
  94. {{range .SMTPAuths}}
  95. <div class="item" data-value="{{.}}">{{.}}</div>
  96. {{end}}
  97. </div>
  98. </div>
  99. </div>
  100. <div class="required field">
  101. <label for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  102. <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
  103. </div>
  104. <div class="required field">
  105. <label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  106. <input id="smtp_port" name="smtp_port" value="{{.smtp_port}}">
  107. </div>
  108. <div class="field">
  109. <label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label>
  110. <input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}">
  111. <p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p>
  112. </div>
  113. </div>
  114. <!-- PAM -->
  115. <div class="pam required field {{if not (eq .type 4)}}hide{{end}}">
  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="{{.pam_service_name}}" />
  118. </div>
  119. <div class="ldap dldap smtp inline field {{if not (or (or (eq .type 2) (eq .type 5)) (eq .type 3))}}hide{{end}}">
  120. <div class="ui checkbox">
  121. <label><strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong></label>
  122. <input name="tls" type="checkbox" {{if .tls}}checked{{end}}>
  123. </div>
  124. </div>
  125. <div class="ldap dldap smtp inline field {{if not (or (or (eq .type 2) (eq .type 5)) (eq .type 3))}}hide{{end}}">
  126. <div class="ui checkbox">
  127. <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label>
  128. <input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}>
  129. </div>
  130. </div>
  131. <div class="inline field">
  132. <div class="ui checkbox">
  133. <label><strong>{{.i18n.Tr "admin.auths.activated"}}</strong></label>
  134. <input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}>
  135. </div>
  136. </div>
  137. <div class="field">
  138. <button class="ui green button">{{.i18n.Tr "admin.auths.new"}}</button>
  139. </div>
  140. </form>
  141. </div>
  142. <h4 class="ui top attached header">
  143. {{.i18n.Tr "admin.auths.tips"}}
  144. </h4>
  145. <div class="ui attached segment">
  146. <h5>GMail Setting:</h5>
  147. <p>Host: smtp.gmail.com, Post: 587, Enable TLS Encryption: true</p>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. {{template "base/footer" .}}