edit.tmpl 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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="{{AppSubUrl}}/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="host">{{.i18n.Tr "admin.auths.host"}}</label>
  35. <input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.Source.LDAP.Host}}" required />
  36. </div>
  37. <div class="field">
  38. <label class="req" for="port">{{.i18n.Tr "admin.auths.port"}}</label>
  39. <input class="ipt ipt-large ipt-radius {{if .Err_Port}}ipt-error{{end}}" id="port" name="port" value="{{.Source.LDAP.Port}}" required />
  40. </div>
  41. <div class="field">
  42. <label for="use_ssl">{{.i18n.Tr "admin.auths.enable_tls"}}</label>
  43. <input name="use_ssl" type="checkbox" {{if .Source.LDAP.UseSSL}}checked{{end}}>
  44. </div>
  45. <div class="field">
  46. <label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
  47. <input class="ipt ipt-large ipt-radius {{if .Err_BindDN}}ipt-error{{end}}" id="bind_dn" name="bind_dn" value="{{.Source.LDAP.BindDN}}" />
  48. </div>
  49. <div class="field">
  50. <label for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label>
  51. <input class="ipt ipt-large ipt-radius {{if .Err_BindPassword}}ipt-error{{end}}" id="bind_password" name="bind_password" type="password" value="{{.Source.LDAP.BindPassword}}" />
  52. </div>
  53. <div class="field">
  54. <label class="req" for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
  55. <input class="ipt ipt-large ipt-radius {{if .Err_UserBase}}ipt-error{{end}}" id="user_base" name="user_base" value="{{.Source.LDAP.UserBase}}" />
  56. </div>
  57. <div class="field">
  58. <label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
  59. <input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.Source.LDAP.Filter}}" />
  60. </div>
  61. <div class="field">
  62. <label for="filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
  63. <input class="ipt ipt-large ipt-radius {{if .Err_AdminFilter}}ipt-error{{end}}" id="admin_filter" name="admin_filter" value="{{.Source.LDAP.AdminFilter}}" />
  64. </div>
  65. <div class="field">
  66. <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
  67. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_name" name="attribute_name" value="{{.Source.LDAP.AttributeName}}" />
  68. </div>
  69. <div class="field">
  70. <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
  71. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_surname" name="attribute_surname" value="{{.Source.LDAP.AttributeSurname}}" />
  72. </div>
  73. <div class="field">
  74. <label class="req" for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
  75. <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_mail" name="attribute_mail" value="{{.Source.LDAP.AttributeMail}}" />
  76. </div>
  77. {{else if eq $type 3}}
  78. <div class="field">
  79. <label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
  80. <select name="smtp_auth">
  81. {{$auth := .Source.SMTP.Auth}}
  82. {{range .SMTPAuths}}
  83. <option value="{{.}}"
  84. {{if eq . $auth}} selected{{end}}>{{.}}</option>
  85. {{end}}
  86. </select>
  87. </div>
  88. <div class="field">
  89. <label class="req" for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
  90. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtp_host" name="smtp_host" value="{{.Source.SMTP.Host}}" />
  91. </div>
  92. <div class="field">
  93. <label class="req" for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
  94. <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtp_port" name="smtp_port" value="{{.Source.SMTP.Port}}" />
  95. </div>
  96. {{else if eq $type 4}}
  97. <div class="field">
  98. <label class="req" for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label>
  99. <input class="ipt ipt-large ipt-radius {{if .Err_PAMServiceName}}ipt-error{{end}}" id="pam_service_name" name="pam_service_name" value="{{.Source.PAM.ServiceName}}" />
  100. </div>
  101. {{end}}
  102. <div class="field">
  103. {{if eq $type 3}}
  104. <label></label>
  105. <input name="tls" type="checkbox" {{if .Source.SMTP.TLS}}checked{{end}}>
  106. <strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
  107. <br>
  108. {{end}}
  109. <label></label>
  110. <input name="allowautoregister" type="checkbox" {{if .Source.AllowAutoRegister}}checked{{end}}>
  111. <strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong>
  112. <br>
  113. <label></label>
  114. <input name="is_actived" type="checkbox" {{if .Source.IsActived}}checked{{end}}>
  115. <strong>{{.i18n.Tr "admin.auths.activated"}}</strong>
  116. </div>
  117. <div class="field">
  118. <label></label>
  119. <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "admin.auths.update"}}</button>
  120. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  121. <button class="btn btn-large btn-red btn-radius" id="delete-auth-btn" href="#delete-auth-modal">{{.i18n.Tr "admin.auths.delete"}}</button>
  122. </div>
  123. <div class="white-popup-block mfp-hide" id="delete-auth-modal">
  124. <h1 class="text-red">{{.i18n.Tr "admin.auths.delete_auth_title"}}</h1>
  125. <p>{{.i18n.Tr "admin.auths.delete_auth_desc"}}</p>
  126. <br>
  127. <button class="btn btn-red btn-large btn-radius" id="delete-auth-submit">{{.i18n.Tr "settings.continue"}}</button>
  128. <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  129. </div>
  130. </form>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. {{template "ng/base/footer" .}}