forkjo/templates/admin/auth/new.tmpl

162 lines
8.2 KiB
Cheetah
Raw Normal View History

2015-09-10 23:11:41 +02:00
{{template "base/head" .}}
<div class="admin new authentication">
<div class="ui container">
<div class="ui grid">
{{template "admin/navbar" .}}
<div class="twelve wide column content">
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{.i18n.Tr "admin.auths.new"}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<!-- Types and name -->
<div class="inline required field {{if .Err_Type}}error{{end}}">
<label>{{.i18n.Tr "admin.auths.auth_type"}}</label>
<div class="ui selection type dropdown">
<input type="hidden" id="auth_type" name="type" value="{{.type}}">
<div class="text">{{.CurTypeName}}</div>
<i class="dropdown icon"></i>
<div class="menu">
{{range .AuthSources}}
<div class="item" data-value="{{.Type}}">{{.Name}}</div>
{{end}}
2014-08-29 14:50:43 +02:00
</div>
2015-09-10 23:11:41 +02:00
</div>
2014-05-15 20:46:04 +02:00
</div>
2015-09-10 23:11:41 +02:00
<div class="required inline field {{if .Err_Name}}error{{end}}">
<label for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
<input id="name" name="name" value="{{.name}}" autofocus required>
</div>
<!-- LDAP and DLDAP -->
<div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}hide{{end}}">
<div class="required field">
2015-09-11 18:03:08 +02:00
<label for="host">{{.i18n.Tr "admin.auths.host"}}</label>
<input id="host" name="host" value="{{.host}}" placeholder="e.g. mydomain.com">
2015-09-10 23:11:41 +02:00
</div>
<div class="required field">
2015-09-11 18:03:08 +02:00
<label for="port">{{.i18n.Tr "admin.auths.port"}}</label>
<input id="port" name="port" value="{{.port}}" placeholder="e.g. 636">
2015-09-10 23:11:41 +02:00
</div>
<div class="ldap required field {{if not (eq .type 2)}}hide{{end}}">
2015-09-11 18:03:08 +02:00
<label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
<input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com">
2015-09-10 23:11:41 +02:00
</div>
<input class="fake" type="password">
<div class="ldap required field {{if not (eq .type 2)}}hide{{end}}">
2015-09-11 18:03:08 +02:00
<label for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label>
<input id="bind_password" name="bind_password" type="password" value="{{.bind_password}}">
<p class="help text red">{{.i18n.Tr "admin.auths.bind_password_helper"}}</p>
2015-09-10 23:11:41 +02:00
</div>
<div class="ldap required field {{if not (eq .type 2)}}hide{{end}}">
2015-09-11 18:03:08 +02:00
<label for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
<input id="user_base" name="user_base" value="{{.user_base}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com">
2015-09-10 23:11:41 +02:00
</div>
<div class="dldap required field {{if not (eq .type 5)}}hide{{end}}">
2015-09-11 18:03:08 +02:00
<label for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label>
<input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com">
2015-09-10 23:11:41 +02:00
</div>
<div class="required field">
2015-09-11 18:03:08 +02:00
<label for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
<input id="filter" name="filter" value="{{.filter}}" placeholder="e.g. (&(objectClass=posixAccount)(uid=%s))">
2015-09-10 23:11:41 +02:00
</div>
<div class="field">
2015-09-11 18:03:08 +02:00
<label for="admin_filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
<input id="admin_filter" name="admin_filter" value="{{.admin_filter}}">
2015-09-10 23:11:41 +02:00
</div>
<div class="field">
2015-09-11 18:03:08 +02:00
<label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
<input id="attribute_name" name="attribute_name" value="{{.attribute_name}}">
2015-09-10 23:11:41 +02:00
</div>
<div class="field">
2015-09-11 18:03:08 +02:00
<label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
<input id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}">
2015-09-10 23:11:41 +02:00
</div>
<div class="required field">
2015-09-11 18:03:08 +02:00
<label for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
<input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="e.g. mail">
2015-09-10 23:11:41 +02:00
</div>
</div>
<!-- SMTP -->
<div class="smtp field {{if not (eq .type 3)}}hide{{end}}">
<div class="inline required field">
<label>{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
<div class="ui selection type dropdown">
<input type="hidden" id="smtp_auth" name="smtp_auth" value="{{.smtp_auth}}">
<div class="text">{{.smtp_auth}}</div>
<i class="dropdown icon"></i>
<div class="menu">
{{range .SMTPAuths}}
<div class="item" data-value="{{.}}">{{.}}</div>
{{end}}
</div>
</div>
</div>
<div class="required field">
2015-09-11 18:03:08 +02:00
<label for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
<input id="smtp_host" name="smtp_host" value="{{.smtp_host}}">
2015-09-10 23:11:41 +02:00
</div>
<div class="required field">
2015-09-11 18:03:08 +02:00
<label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
<input id="smtp_port" name="smtp_port" value="{{.smtp_port}}">
2015-09-10 23:11:41 +02:00
</div>
<div class="field">
<label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label>
<input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}">
<p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p>
</div>
2015-09-10 23:11:41 +02:00
</div>
<!-- PAM -->
<div class="pam required field {{if not (eq .type 4)}}hide{{end}}">
<label for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label>
<input id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}" />
</div>
<div class="ldap dldap smtp inline field {{if not (or (or (eq .type 2) (eq .type 5)) (eq .type 3))}}hide{{end}}">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong></label>
<input name="tls" type="checkbox" {{if .tls}}checked{{end}}>
</div>
</div>
<div class="smtp inline field {{if not (eq .type 3)}}hide{{end}}">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label>
<input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong></label>
<input name="allow_auto_register" type="checkbox" {{if .allow_auto_register}}checked{{end}}>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.auths.activated"}}</strong></label>
<input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}>
</div>
</div>
<div class="field">
2015-09-11 18:03:08 +02:00
<button class="ui green button">{{.i18n.Tr "admin.auths.new"}}</button>
2015-09-10 23:11:41 +02:00
</div>
</form>
2014-05-15 20:46:04 +02:00
</div>
2015-09-10 23:11:41 +02:00
<h4 class="ui top attached header">
{{.i18n.Tr "admin.auths.tips"}}
</h4>
<div class="ui attached segment">
<h5>GMail Setting:</h5>
<p>Host: smtp.gmail.com, Post: 587, Enable TLS Encryption: true</p>
</div>
</div>
</div>
2014-05-03 04:48:14 +02:00
</div>
</div>
2015-09-10 23:11:41 +02:00
{{template "base/footer" .}}