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.

120 lines
8.4 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="attributes">{{.i18n.Tr "admin.auths.attributes"}}</label>
  51. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attributes" name="attributes" value="{{.Source.LDAP.Attributes}}" />
  52. </div>
  53. <div class="field">
  54. <label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
  55. <input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.Source.LDAP.Filter}}" />
  56. </div>
  57. <div class="field">
  58. <label class="req" for="ms_ad_sa">{{.i18n.Tr "admin.auths.ms_ad_sa"}}</label>
  59. <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}}" />
  60. </div>
  61. {{else if eq $type 3}}
  62. <div class="field">
  63. <label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  64. <select name="smtpauth">
  65. {{$auth := .Source.SMTP.Auth}}
  66. {{range .SMTPAuths}}
  67. <option value="{{.}}"
  68. {{if eq . $auth}} selected{{end}}>{{.}}</option>
  69. {{end}}
  70. </select>
  71. </div>
  72. <div class="field">
  73. <label class="req" for="smtphost">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  74. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtphost" name="smtphost" value="{{.Source.SMTP.Host}}" />
  75. </div>
  76. <div class="field">
  77. <label class="req" for="smtpport">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  78. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtpport" name="smtpport" value="{{.Source.SMTP.Port}}" />
  79. </div>
  80. {{end}}
  81. <div class="field">
  82. {{if eq $type 3}}
  83. <label></label>
  84. <input name="tls" type="checkbox" {{if .Source.SMTP.TLS}}checked{{end}}>
  85. <strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
  86. <br>
  87. {{end}}
  88. <label></label>
  89. <input name="allowautoregister" type="checkbox" {{if .Source.AllowAutoRegister}}checked{{end}}>
  90. <strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong>
  91. <br>
  92. <label></label>
  93. <input name="is_actived" type="checkbox" {{if .Source.IsActived}}checked{{end}}>
  94. <strong>{{.i18n.Tr "admin.auths.activated"}}</strong>
  95. </div>
  96. <div class="field">
  97. <label></label>
  98. <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "admin.auths.update"}}</button>
  99. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  100. <button class="btn btn-large btn-red btn-radius" id="delete-auth-btn" href="#delete-auth-modal">{{.i18n.Tr "admin.auths.delete"}}</button>
  101. </div>
  102. <div class="white-popup-block mfp-hide" id="delete-auth-modal">
  103. <h1 class="text-red">{{.i18n.Tr "admin.auths.delete_auth_title"}}</h1>
  104. <p>{{.i18n.Tr "admin.auths.delete_auth_desc"}}</p>
  105. <br>
  106. <button class="btn btn-red btn-large btn-radius" id="delete-auth-submit">{{.i18n.Tr "settings.continue"}}</button>
  107. <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  108. </div>
  109. </form>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. {{template "ng/base/footer" .}}