diff options
author | Unknwon <u@gogs.io> | 2016-07-08 07:25:09 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-07-08 07:25:09 +0800 |
commit | 401bf944ef4b09e7d4ca85d7272dbd32e7e950a0 (patch) | |
tree | 7e9af9199616f4704d4e1e9e0bfcf97d537693e4 /templates/admin | |
parent | 326c98266040a69ceec51c3804c372c7af47e027 (diff) | |
download | gitea-401bf944ef4b09e7d4ca85d7272dbd32e7e950a0.tar.gz gitea-401bf944ef4b09e7d4ca85d7272dbd32e7e950a0.zip |
Use SecurityProtocol to replace UseSSL in LDAP config
Initially proposed by #2376 and fixes #3068 as well.
Diffstat (limited to 'templates/admin')
-rw-r--r-- | templates/admin/auth/edit.tmpl | 19 | ||||
-rw-r--r-- | templates/admin/auth/new.tmpl | 19 |
2 files changed, 32 insertions, 6 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 9bda877980..0879b274b1 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -14,7 +14,7 @@ <input type="hidden" name="id" value="{{.Source.ID}}"> <div class="inline field"> <label>{{$.i18n.Tr "admin.auths.auth_type"}}</label> - <input type="hidden" name="type" value="{{.Source.Type}}"> + <input type="hidden" id="auth_type" name="type" value="{{.Source.Type}}"> <span>{{.Source.TypeName}}</span> </div> <div class="required inline field {{if .Err_Name}}error{{end}}"> @@ -25,6 +25,19 @@ <!-- LDAP and DLDAP --> {{if or .Source.IsLDAP .Source.IsDLDAP}} {{ $cfg:=.Source.LDAP }} + <div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}"> + <label>{{.i18n.Tr "admin.auths.security_protocol"}}</label> + <div class="ui selection security-protocol dropdown"> + <input type="hidden" id="security_protocol" name="security_protocol" value="{{$cfg.SecurityProtocol}}"> + <div class="text">{{$cfg.SecurityProtocolName}}</div> + <i class="dropdown icon"></i> + <div class="menu"> + {{range .SecurityProtocols}} + <div class="item" data-value="{{.Type}}">{{.Name}}</div> + {{end}} + </div> + </div> + </div> <div class="required field"> <label for="host">{{.i18n.Tr "admin.auths.host"}}</label> <input id="host" name="host" value="{{$cfg.Host}}" placeholder="e.g. mydomain.com" required> @@ -129,13 +142,13 @@ </div> {{end}} - <div class="inline field {{if not (or (or .Source.IsLDAP .Source.IsDLDAP) .Source.IsSMTP)}}hide{{end}}"> + <div class="inline field {{if not .Source.IsSMTP}}hide{{end}}"> <div class="ui checkbox"> <label><strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong></label> <input name="tls" type="checkbox" {{if .Source.UseTLS}}checked{{end}}> </div> </div> - <div class="inline field {{if not (or (or .Source.IsLDAP .Source.IsDLDAP) .Source.IsSMTP)}}hide{{end}}"> + <div class="has-tls inline field {{if not .HasTLS}}hide{{end}}"> <div class="ui checkbox"> <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}> diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl index 418f21dad8..55b6b14c10 100644 --- a/templates/admin/auth/new.tmpl +++ b/templates/admin/auth/new.tmpl @@ -16,7 +16,7 @@ <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> + <div class="text">{{.CurrentTypeName}}</div> <i class="dropdown icon"></i> <div class="menu"> {{range .AuthSources}} @@ -32,6 +32,19 @@ <!-- LDAP and DLDAP --> <div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}hide{{end}}"> + <div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}"> + <label>{{.i18n.Tr "admin.auths.security_protocol"}}</label> + <div class="ui selection security-protocol dropdown"> + <input type="hidden" id="security_protocol" name="security_protocol" value="{{.security_protocol}}"> + <div class="text">{{.CurrentSecurityProtocol}}</div> + <i class="dropdown icon"></i> + <div class="menu"> + {{range .SecurityProtocols}} + <div class="item" data-value="{{.Type}}">{{.Name}}</div> + {{end}} + </div> + </div> + </div> <div class="required field"> <label for="host">{{.i18n.Tr "admin.auths.host"}}</label> <input id="host" name="host" value="{{.host}}" placeholder="e.g. mydomain.com"> @@ -126,13 +139,13 @@ <input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}> </div> </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="smtp inline field {{if not (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="ldap dldap smtp inline field {{if not (or (or (eq .type 2) (eq .type 5)) (eq .type 3))}}hide{{end}}"> + <div class="has-tls inline field {{if not .HasTLS}}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}}> |