File tree Expand file tree Collapse file tree
services/auth/source/ldap Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ func (typ LoginType) String() string {
3636 return LoginNames [typ ]
3737}
3838
39+ // String returns the string name of the LoginType
40+ func (typ LoginType ) Int () int {
41+ return int (typ )
42+ }
43+
3944// LoginNames contains the name of LoginType values.
4045var LoginNames = map [LoginType ]string {
4146 LoginLDAP : "LDAP (via BindDN)" ,
@@ -218,6 +223,10 @@ func CreateLoginSource(source *LoginSource) error {
218223 return nil
219224 }
220225
226+ if settable , ok := source .Cfg .(LoginSourceSettable ); ok {
227+ settable .SetLoginSource (source )
228+ }
229+
221230 registerableSource , ok := source .Cfg .(RegisterableSource )
222231 if ! ok {
223232 return nil
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ func (s SecurityProtocol) String() string {
1919 return SecurityProtocolNames [s ]
2020}
2121
22+ // String returns the name of the SecurityProtocol
23+ func (s SecurityProtocol ) Int () int {
24+ return int (s )
25+ }
26+
2227// SecurityProtocolNames contains the name of SecurityProtocol values.
2328var SecurityProtocolNames = map [SecurityProtocol ]string {
2429 SecurityProtocolUnencrypted : "Unencrypted" ,
Original file line number Diff line number Diff line change 1212 <input type= " hidden" name= " id" value= " {{.Source.ID}}" >
1313 <div class= " inline field" >
1414 <label>{{$ .i18n.Tr " admin.auths.auth_type" }}</label>
15- <input type= " hidden" id= " auth_type" name= " type" value= " {{.Source.Type}}" >
15+ <input type= " hidden" id= " auth_type" name= " type" value= " {{.Source.Type.Int }}" >
1616 <span>{{.Source.TypeName }}</span>
1717 </div>
1818 <div class= " required inline field {{if .Err_Name}}error{{end}}" >
3131 {{svg " octicon-triangle-down" 14 " dropdown icon" }}
3232 <div class= " menu" >
3333 {{range .SecurityProtocols }}
34- <div class= " item" data-value= " {{.Type}}" >{{.Name }}</div>
34+ <div class= " item" data-value= " {{.Type.Int }}" >{{.Name }}</div>
3535 {{end }}
3636 </div>
3737 </div>
Original file line number Diff line number Diff line change 1313 <div class= " inline required field {{if .Err_Type}}error{{end}}" >
1414 <label>{{.i18n.Tr " admin.auths.auth_type" }}</label>
1515 <div class= " ui selection type dropdown" >
16- <input type= " hidden" id= " auth_type" name= " type" value= " {{.type}}" >
16+ <input type= " hidden" id= " auth_type" name= " type" value= " {{.type.Int }}" >
1717 <div class= " text" >{{.CurrentTypeName }}</div>
1818 {{svg " octicon-triangle-down" 14 " dropdown icon" }}
1919 <div class= " menu" >
2020 {{range .AuthSources }}
21- <div class= " item" data-value= " {{.Type}}" >{{.Name }}</div>
21+ <div class= " item" data-value= " {{.Type.Int }}" >{{.Name }}</div>
2222 {{end }}
2323 </div>
2424 </div>
Original file line number Diff line number Diff line change 77 {{svg " octicon-triangle-down" 14 " dropdown icon" }}
88 <div class= " menu" >
99 {{range .SecurityProtocols }}
10- <div class= " item" data-value= " {{.Type}}" >{{.Name }}</div>
10+ <div class= " item" data-value= " {{.Type.Int }}" >{{.Name }}</div>
1111 {{end }}
1212 </div>
1313 </div>
You can’t perform that action at this time.
0 commit comments