File tree 5 files changed +19
-5
lines changed
services/auth/source/ldap
5 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ func (typ LoginType) String() string {
36
36
return LoginNames [typ ]
37
37
}
38
38
39
+ // String returns the string name of the LoginType
40
+ func (typ LoginType ) Int () int {
41
+ return int (typ )
42
+ }
43
+
39
44
// LoginNames contains the name of LoginType values.
40
45
var LoginNames = map [LoginType ]string {
41
46
LoginLDAP : "LDAP (via BindDN)" ,
@@ -218,6 +223,10 @@ func CreateLoginSource(source *LoginSource) error {
218
223
return nil
219
224
}
220
225
226
+ if settable , ok := source .Cfg .(LoginSourceSettable ); ok {
227
+ settable .SetLoginSource (source )
228
+ }
229
+
221
230
registerableSource , ok := source .Cfg .(RegisterableSource )
222
231
if ! ok {
223
232
return nil
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ func (s SecurityProtocol) String() string {
19
19
return SecurityProtocolNames [s ]
20
20
}
21
21
22
+ // String returns the name of the SecurityProtocol
23
+ func (s SecurityProtocol ) Int () int {
24
+ return int (s )
25
+ }
26
+
22
27
// SecurityProtocolNames contains the name of SecurityProtocol values.
23
28
var SecurityProtocolNames = map [SecurityProtocol ]string {
24
29
SecurityProtocolUnencrypted : "Unencrypted" ,
Original file line number Diff line number Diff line change 12
12
<input type="hidden" name="id" value="{{.Source.ID}}">
13
13
<div class="inline field">
14
14
<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 }}">
16
16
<span>{{.Source.TypeName}}</span>
17
17
</div>
18
18
<div class="required inline field {{if .Err_Name}}error{{end}}">
31
31
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
32
32
<div class="menu">
33
33
{{range .SecurityProtocols}}
34
- <div class="item" data-value="{{.Type}}">{{.Name}}</div>
34
+ <div class="item" data-value="{{.Type.Int }}">{{.Name}}</div>
35
35
{{end}}
36
36
</div>
37
37
</div>
Original file line number Diff line number Diff line change 13
13
<div class="inline required field {{if .Err_Type}}error{{end}}">
14
14
<label>{{.i18n.Tr "admin.auths.auth_type"}}</label>
15
15
<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 }}">
17
17
<div class="text">{{.CurrentTypeName}}</div>
18
18
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
19
19
<div class="menu">
20
20
{{range .AuthSources}}
21
- <div class="item" data-value="{{.Type}}">{{.Name}}</div>
21
+ <div class="item" data-value="{{.Type.Int }}">{{.Name}}</div>
22
22
{{end}}
23
23
</div>
24
24
</div>
Original file line number Diff line number Diff line change 7
7
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
8
8
<div class="menu">
9
9
{{range .SecurityProtocols}}
10
- <div class="item" data-value="{{.Type}}">{{.Name}}</div>
10
+ <div class="item" data-value="{{.Type.Int }}">{{.Name}}</div>
11
11
{{end}}
12
12
</div>
13
13
</div>
You can’t perform that action at this time.
0 commit comments