summaryrefslogtreecommitdiffstats
path: root/templates/admin/auth/new.tmpl
blob: a18a782fc1c970b8f0c57658682bc314b650d2a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{{template "base/head" .}}
<div class="admin new authentication">
	{{template "admin/navbar" .}}
	<div class="ui container">
		{{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">{{.CurrentTypeName}}</div>
						<i class="dropdown icon"></i>
						<div class="menu">
							{{range .AuthSources}}
								<div class="item" data-value="{{.Type}}">{{.Name}}</div>
							{{end}}
						</div>
					</div>
				</div>
				<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 -->
				{{ template "admin/auth/source/ldap" . }}

				<!-- SMTP -->
				{{ template "admin/auth/source/smtp" . }}

				<!-- 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>

				<!-- OAuth2 -->
				{{ template "admin/auth/source/oauth" . }}

				<div class="ldap field">
					<div class="ui checkbox">
						<label><strong>{{.i18n.Tr "admin.auths.attributes_in_bind"}}</strong></label>
						<input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}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.enable_tls"}}</strong></label>
						<input name="tls" type="checkbox" {{if .tls}}checked{{end}}>
					</div>
				</div>
				<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}}>
					</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">
					<button class="ui green button">{{.i18n.Tr "admin.auths.new"}}</button>
				</div>
			</form>
		</div>

		<h4 class="ui top attached header">
			{{.i18n.Tr "admin.auths.tips"}}
		</h4>
		<div class="ui attached segment">
			<h5>GMail Settings:</h5>
			<p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p>
			<h5>OAuth GitHub:</h5>
			<p>{{.i18n.Tr "admin.auths.tip.github"}}</p>
		</div>
	</div>
</div>
{{template "base/footer" .}}