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.

132 lines
9.7 KiB

  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. <div id="admin-wrapper">
  4. <div id="setting-wrapper" class="main-wrapper">
  5. <div id="admin-setting" class="container clear">
  6. {{template "admin/nav" .}}
  7. <div class="grid-4-5 left">
  8. <div class="setting-content">
  9. {{template "ng/base/alert" .}}
  10. <div id="setting-content">
  11. <div class="panel panel-radius">
  12. <div class="panel-header">
  13. <strong>{{.i18n.Tr "admin.auths.edit"}}</strong>
  14. </div>
  15. <form class="form form-align panel-body" id="auth-setting-form" action="{{AppSubUrl}}/admin/auths/{{.Source.Id}}" data-delete-url="/admin/auths/{{.Source.Id}}/delete" method="post">
  16. {{.CsrfTokenHtml}}
  17. <input type="hidden" value="{{.Source.Id}}" name="id"/>
  18. {{$type := .Source.Type}}
  19. <div class="field">
  20. <label>{{.i18n.Tr "admin.auths.auth_type"}}</label>
  21. <input type="hidden" name="type" value="{{.Source.Type}}"/>
  22. <label class="control-label">
  23. {{range $key, $val := .LoginTypes}}
  24. {{if eq $key $type}}{{$val}}{{end}}
  25. {{end}}
  26. </label>
  27. </div>
  28. <div class="field">
  29. <label class="req" for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
  30. <input class="ipt ipt-large ipt-radius {{if .Err_AuthName}}ipt-error{{end}}" id="name" name="name" value="{{.Source.Name}}" required />
  31. </div>
  32. {{if eq $type 2}}
  33. <div class="field">
  34. <label class="req" for="domain">{{.i18n.Tr "admin.auths.domain"}}</label>
  35. <input class="ipt ipt-large ipt-radius {{if .Err_Domain}}ipt-error{{end}}" id="domain" name="domain" value="{{.Source.LDAP.Name}}" required />
  36. </div>
  37. <div class="field">
  38. <label class="req" for="host">{{.i18n.Tr "admin.auths.host"}}</label>
  39. <input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.Source.LDAP.Host}}" required />
  40. </div>
  41. <div class="field">
  42. <label class="req" for="port">{{.i18n.Tr "admin.auths.port"}}</label>
  43. <input class="ipt ipt-large ipt-radius {{if .Err_Port}}ipt-error{{end}}" id="port" name="port" value="{{.Source.LDAP.Port}}" required />
  44. </div>
  45. <div class="field">
  46. <label class="req" for="base_dn">{{.i18n.Tr "admin.auths.base_dn"}}</label>
  47. <input class="ipt ipt-large ipt-radius {{if .Err_BaseDN}}ipt-error{{end}}" id="base_dn" name="base_dn" value="{{.Source.LDAP.BaseDN}}" />
  48. </div>
  49. <div class="field">
  50. <label class="req" for="attribute_username">{{.i18n.Tr "admin.auths.attribute_username"}}</label>
  51. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_username" name="attribute_username" value="{{.Source.LDAP.AttributeUsername}}" />
  52. </div>
  53. <div class="field">
  54. <label class="req" for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
  55. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_name" name="attribute_name" value="{{.Source.LDAP.AttributeName}}" />
  56. </div>
  57. <div class="field">
  58. <label class="req" for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
  59. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_surname" name="attribute_surname" value="{{.Source.LDAP.AttributeSurname}}" />
  60. </div>
  61. <div class="field">
  62. <label class="req" for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
  63. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_mail" name="attribute_mail" value="{{.Source.LDAP.AttributeMail}}" />
  64. </div>
  65. <div class="field">
  66. <label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
  67. <input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.Source.LDAP.Filter}}" />
  68. </div>
  69. <div class="field">
  70. <label class="req" for="ms_ad_sa">{{.i18n.Tr "admin.auths.ms_ad_sa"}}</label>
  71. <input class="ipt ipt-large ipt-radius {{if .Err_MsAdSA}}ipt-error{{end}}" id="ms_ad_sa" name="ms_ad_sa" value="{{.Source.LDAP.MsAdSAFormat}}" />
  72. </div>
  73. {{else if eq $type 3}}
  74. <div class="field">
  75. <label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  76. <select name="smtpauth">
  77. {{$auth := .Source.SMTP.Auth}}
  78. {{range .SMTPAuths}}
  79. <option value="{{.}}"
  80. {{if eq . $auth}} selected{{end}}>{{.}}</option>
  81. {{end}}
  82. </select>
  83. </div>
  84. <div class="field">
  85. <label class="req" for="smtphost">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  86. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtphost" name="smtphost" value="{{.Source.SMTP.Host}}" />
  87. </div>
  88. <div class="field">
  89. <label class="req" for="smtpport">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  90. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtpport" name="smtpport" value="{{.Source.SMTP.Port}}" />
  91. </div>
  92. {{end}}
  93. <div class="field">
  94. {{if eq $type 3}}
  95. <label></label>
  96. <input name="tls" type="checkbox" {{if .Source.SMTP.TLS}}checked{{end}}>
  97. <strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
  98. <br>
  99. {{end}}
  100. <label></label>
  101. <input name="allowautoregister" type="checkbox" {{if .Source.AllowAutoRegister}}checked{{end}}>
  102. <strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong>
  103. <br>
  104. <label></label>
  105. <input name="is_actived" type="checkbox" {{if .Source.IsActived}}checked{{end}}>
  106. <strong>{{.i18n.Tr "admin.auths.activated"}}</strong>
  107. </div>
  108. <div class="field">
  109. <label></label>
  110. <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "admin.auths.update"}}</button>
  111. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  112. <button class="btn btn-large btn-red btn-radius" id="delete-auth-btn" href="#delete-auth-modal">{{.i18n.Tr "admin.auths.delete"}}</button>
  113. </div>
  114. <div class="white-popup-block mfp-hide" id="delete-auth-modal">
  115. <h1 class="text-red">{{.i18n.Tr "admin.auths.delete_auth_title"}}</h1>
  116. <p>{{.i18n.Tr "admin.auths.delete_auth_desc"}}</p>
  117. <br>
  118. <button class="btn btn-red btn-large btn-radius" id="delete-auth-submit">{{.i18n.Tr "settings.continue"}}</button>
  119. <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  120. </div>
  121. </form>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. {{template "ng/base/footer" .}}