2015-09-11 19:03:08 +03:00
{{template "base/head" .}}
<div class="admin edit authentication">
2017-03-16 01:39:38 +03:00
{{template "admin/navbar" .}}
2015-12-08 01:30:52 +03:00
<div class="ui container">
2017-03-16 01:39:38 +03:00
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{.i18n.Tr "admin.auths.edit"}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="id" value="{{.Source.ID}}">
<div class="inline field">
<label>{{$.i18n.Tr "admin.auths.auth_type"}}</label>
<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}}">
<label for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
<input id="name" name="name" value="{{.Source.Name}}" autofocus required>
</div>
2017-02-22 10:14:37 +03:00
2017-03-16 01:39:38 +03:00
<!-- 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}}
2015-12-08 01:30:52 +03:00
</div>
</div>
2017-03-16 01:39:38 +03:00
</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>
</div>
<div class="required field">
<label for="port">{{.i18n.Tr "admin.auths.port"}}</label>
<input id="port" name="port" value="{{ $ cfg . Port }}" placeholder="e.g. 636" required>
</div>
{{if .Source.IsLDAP}}
<div class="field">
<label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
<input id="bind_dn" name="bind_dn" value="{{ $ cfg . BindDN }}" placeholder="e.g. cn=Search,dc=mydomain,dc=com">
</div>
<input class="fake" type="password">
<div class="field">
<label for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label>
<input id="bind_password" name="bind_password" type="password" value="{{ $ cfg . BindPassword }}">
<p class="help text red">{{.i18n.Tr "admin.auths.bind_password_helper"}}</p>
</div>
2018-12-27 19:51:19 +03:00
{{end}}
<div class="{{if .Source.IsLDAP}}required{{end}} field">
2017-03-16 01:39:38 +03:00
<label for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
2019-04-28 16:53:55 +03:00
<input id="user_base" name="user_base" value="{{ $ cfg . UserBase }}" placeholder="e.g. ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}>
2018-12-27 19:51:19 +03:00
</div>
2017-03-16 01:39:38 +03:00
{{if .Source.IsDLDAP}}
<div class="required field">
<label for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label>
<input id="user_dn" name="user_dn" value="{{ $ cfg . UserDN }}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com" required>
2015-12-08 01:30:52 +03:00
</div>
2017-03-16 01:39:38 +03:00
{{end}}
<div class="required field">
<label for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
<input id="filter" name="filter" value="{{ $ cfg . Filter }}" placeholder="e.g. (&(objectClass=posixAccount)(uid=%s))" required>
</div>
<div class="field">
<label for="admin_filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
<input id="admin_filter" name="admin_filter" value="{{ $ cfg . AdminFilter }}">
</div>
2020-03-05 09:30:33 +03:00
<div class="field">
<label for="restricted_filter">{{.i18n.Tr "admin.auths.restricted_filter"}}</label>
<input id="restricted_filter" name="restricted_filter" value="{{ $ cfg . RestrictedFilter }}">
<p class="help">{{.i18n.Tr "admin.auths.restricted_filter_helper"}}</p>
</div>
2017-03-16 01:39:38 +03:00
<div class="field">
<label for="attribute_username">{{.i18n.Tr "admin.auths.attribute_username"}}</label>
<input id="attribute_username" name="attribute_username" value="{{ $ cfg . AttributeUsername }}" placeholder="{{.i18n.Tr "admin.auths.attribute_username_placeholder"}}">
</div>
<div class="field">
<label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
<input id="attribute_name" name="attribute_name" value="{{ $ cfg . AttributeName }}">
</div>
<div class="field">
<label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
<input id="attribute_surname" name="attribute_surname" value="{{ $ cfg . AttributeSurname }}">
</div>
<div class="required field">
<label for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
<input id="attribute_mail" name="attribute_mail" value="{{ $ cfg . AttributeMail }}" placeholder="e.g. mail" required>
</div>
2018-05-24 07:59:02 +03:00
<div class="field">
<label for="attribute_ssh_public_key">{{.i18n.Tr "admin.auths.attribute_ssh_public_key"}}</label>
<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{ $ cfg . AttributeSSHPublicKey }}" placeholder="e.g. SshPublicKey">
</div>
2020-09-10 18:30:07 +03:00
<div class="inline field">
<div class="ui checkbox">
<label for="groups_enabled"><strong>{{.i18n.Tr "admin.auths.verify_group_membership"}}</strong></label>
<input id="groups_enabled" name="groups_enabled" type="checkbox" {{if $ cfg . GroupsEnabled }}checked{{end}}>
</div>
</div>
<div id="groups_enabled_change">
<div class="field">
<label for="group_dn">{{.i18n.Tr "admin.auths.group_search_base"}}</label>
<input id="group_dn" name="group_dn" value="{{ $ cfg . GroupDN }}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
</div>
<div class="field">
<label for="group_filter">{{.i18n.Tr "admin.auths.valid_groups_filter"}}</label>
<input id="group_filter" name="group_filter" value="{{ $ cfg . GroupFilter }}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))">
</div>
<div class="field">
<label for="group_member_uid">{{.i18n.Tr "admin.auths.group_attribute_list_users"}}</label>
<input id="group_member_uid" name="group_member_uid" value="{{ $ cfg . GroupMemberUID }}" placeholder="e.g. memberUid">
</div>
<div class="field">
<label for="user_uid">{{.i18n.Tr "admin.auths.user_attribute_in_group"}}</label>
<input id="user_uid" name="user_uid" value="{{ $ cfg . UserUID }}" placeholder="e.g. uid">
</div>
<br/>
</div>
2017-03-16 01:39:38 +03:00
{{if .Source.IsLDAP}}
2018-05-05 17:30:47 +03:00
<div class="inline field">
<div class="ui checkbox">
<label for="use_paged_search"><strong>{{.i18n.Tr "admin.auths.use_paged_search"}}</strong></label>
<input id="use_paged_search" name="use_paged_search" type="checkbox" {{if $ cfg . UsePagedSearch }}checked{{end}}>
</div>
</div>
<div class="field required search-page-size{{if not $ cfg . UsePagedSearch }} hide{{end}}">
<label for="search_page_size">{{.i18n.Tr "admin.auths.search_page_size"}}</label>
<input id="search_page_size" name="search_page_size" value="{{if $ cfg . UsePagedSearch }}{{ $ cfg . SearchPageSize }}{{end}}">
</div>
2015-12-08 01:30:52 +03:00
<div class="inline field">
<div class="ui checkbox">
2017-03-16 01:39:38 +03:00
<label><strong>{{.i18n.Tr "admin.auths.attributes_in_bind"}}</strong></label>
<input name="attributes_in_bind" type="checkbox" {{if $ cfg . AttributesInBind }}checked{{end}}>
2015-12-08 01:30:52 +03:00
</div>
</div>
2017-03-16 01:39:38 +03:00
{{end}}
2020-01-20 06:47:39 +03:00
<div class="inline field">
<div class="ui checkbox">
<label for="allow_deactivate_all"><strong>{{.i18n.Tr "admin.auths.allow_deactivate_all"}}</strong></label>
<input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if $ cfg . AllowDeactivateAll }}checked{{end}}>
</div>
</div>
2017-03-16 01:39:38 +03:00
{{end}}
2014-05-15 22:46:04 +04:00
2017-03-16 01:39:38 +03:00
<!-- SMTP -->
{{if .Source.IsSMTP}}
{{ $ cfg :=.Source.SMTP }}
<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="{{ $ cfg . Auth }}" required>
<div class="text">{{ $ cfg . 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">
<label for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label>
<input id="smtp_host" name="smtp_host" value="{{ $ cfg . Host }}" required>
</div>
<div class="required field">
<label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
<input id="smtp_port" name="smtp_port" value="{{ $ cfg . Port }}" required>
</div>
<div class="field">
<label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label>
<input id="allowed_domains" name="allowed_domains" value="{{ $ cfg . AllowedDomains }}">
<p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p>
</div>
{{end}}
<!-- PAM -->
{{if .Source.IsPAM}}
{{ $ cfg :=.Source.PAM }}
<div class="required field">
<label for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label>
<input id="pam_service_name" name="pam_service_name" value="{{ $ cfg . ServiceName }}" required>
</div>
{{end}}
<!-- OAuth2 -->
{{if .Source.IsOAuth2}}
{{ $ cfg :=.Source.OAuth2 }}
<div class="inline required field">
<label>{{.i18n.Tr "admin.auths.oauth2_provider"}}</label>
<div class="ui selection type dropdown">
<input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{ $ cfg . Provider }}" required>
<div class="text">{{.CurrentOAuth2Provider.DisplayName}}</div>
<i class="dropdown icon"></i>
<div class="menu">
{{range $ key , $ value := .OAuth2Providers}}
<div class="item" data-value="{{ $ key }}">{{ $ value . DisplayName }}</div>
{{end}}
</div>
2015-12-08 01:30:52 +03:00
</div>
2017-03-16 01:39:38 +03:00
</div>
<div class="required field">
<label for="oauth2_key">{{.i18n.Tr "admin.auths.oauth2_clientID"}}</label>
<input id="oauth2_key" name="oauth2_key" value="{{ $ cfg . ClientID }}" required>
</div>
<div class="required field">
<label for="oauth2_secret">{{.i18n.Tr "admin.auths.oauth2_clientSecret"}}</label>
<input id="oauth2_secret" name="oauth2_secret" value="{{ $ cfg . ClientSecret }}" required>
</div>
2017-05-01 16:26:53 +03:00
<div class="open_id_connect_auto_discovery_url required field">
<label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{ $ cfg . OpenIDConnectAutoDiscoveryURL }}">
</div>
<div class="oauth2_use_custom_url inline field">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
<input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox" {{if $ cfg . CustomURLMapping }}checked{{end}}>
</div>
</div>
<div class="oauth2_use_custom_url_field oauth2_auth_url required field">
<label for="oauth2_auth_url">{{.i18n.Tr "admin.auths.oauth2_authURL"}}</label>
2018-06-06 17:02:37 +03:00
<input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $ cfg . CustomURLMapping }}{{ $ cfg . CustomURLMapping . AuthURL }}{{end}}">
2017-05-01 16:26:53 +03:00
</div>
<div class="oauth2_use_custom_url_field oauth2_token_url required field">
<label for="oauth2_token_url">{{.i18n.Tr "admin.auths.oauth2_tokenURL"}}</label>
<input id="oauth2_token_url" name="oauth2_token_url" value="{{if $ cfg . CustomURLMapping }}{{ $ cfg . CustomURLMapping . TokenURL }}{{end}}">
</div>
<div class="oauth2_use_custom_url_field oauth2_profile_url required field">
<label for="oauth2_profile_url">{{.i18n.Tr "admin.auths.oauth2_profileURL"}}</label>
<input id="oauth2_profile_url" name="oauth2_profile_url" value="{{if $ cfg . CustomURLMapping }}{{ $ cfg . CustomURLMapping . ProfileURL }}{{end}}">
</div>
<div class="oauth2_use_custom_url_field oauth2_email_url required field">
<label for="oauth2_email_url">{{.i18n.Tr "admin.auths.oauth2_emailURL"}}</label>
<input id="oauth2_email_url" name="oauth2_email_url" value="{{if $ cfg . CustomURLMapping }}{{ $ cfg . CustomURLMapping . EmailURL }}{{end}}">
</div>
{{if .OAuth2DefaultCustomURLMappings}}{{range $ key , $ value := .OAuth2DefaultCustomURLMappings}}
<input id="{{ $ key }}_token_url" value="{{ $ value . TokenURL }}" type="hidden" />
<input id="{{ $ key }}_auth_url" value="{{ $ value . AuthURL }}" type="hidden" />
<input id="{{ $ key }}_profile_url" value="{{ $ value . ProfileURL }}" type="hidden" />
<input id="{{ $ key }}_email_url" value="{{ $ value . EmailURL }}" type="hidden" />
{{end}}{{end}}
2017-03-16 01:39:38 +03:00
{{end}}
2019-11-23 02:33:31 +03:00
<!-- SSPI -->
{{if .Source.IsSSPI}}
{{ $ cfg :=.Source.SSPI }}
<div class="field">
<div class="ui checkbox">
<label for="sspi_auto_create_users"><strong>{{.i18n.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>
<input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox" {{if $ cfg . AutoCreateUsers }}checked{{end}}>
<p class="help">{{.i18n.Tr "admin.auths.sspi_auto_create_users_helper"}}</p>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<label for="sspi_auto_activate_users"><strong>{{.i18n.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label>
<input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox" {{if $ cfg . AutoActivateUsers }}checked{{end}}>
<p class="help">{{.i18n.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<label for="sspi_strip_domain_names"><strong>{{.i18n.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label>
<input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox" {{if $ cfg . StripDomainNames }}checked{{end}}>
<p class="help">{{.i18n.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
</div>
</div>
<div class="required field">
<label for="sspi_separator_replacement">{{.i18n.Tr "admin.auths.sspi_separator_replacement"}}</label>
<input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{ $ cfg . SeparatorReplacement }}" required>
<p class="help">{{.i18n.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
</div>
<div class="field">
<label for="sspi_default_language">{{.i18n.Tr "admin.auths.sspi_default_language"}}</label>
<div class="ui language selection dropdown" id="sspi_default_language">
<input name="sspi_default_language" type="hidden" value="{{ $ cfg . DefaultLanguage }}">
<i class="dropdown icon"></i>
<div class="text">{{range .AllLangs}}{{if eq $ cfg . DefaultLanguage .Lang}}{{.Name}}{{end}}{{end}}</div>
<div class="menu">
<div class="item{{if not $.SSPIDefaultLanguage}} active selected{{end}}" data-value="">-</div>
{{range .AllLangs}}
<div class="item{{if eq $ cfg . DefaultLanguage .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div>
{{end}}
</div>
</div>
<p class="help">{{.i18n.Tr "admin.auths.sspi_default_language_helper"}}</p>
</div>
{{end}}
2017-03-16 01:39:38 +03:00
<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="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}}>
</div>
</div>
2017-05-10 16:10:18 +03:00
{{if .Source.IsLDAP}}
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.auths.syncenabled"}}</strong></label>
<input name="is_sync_enabled" type="checkbox" {{if .Source.IsSyncEnabled}}checked{{end}}>
</div>
</div>
{{end}}
2017-03-16 01:39:38 +03:00
<div class="inline field">
<div class="ui checkbox">
<label><strong>{{.i18n.Tr "admin.auths.activated"}}</strong></label>
<input name="is_active" type="checkbox" {{if .Source.IsActived}}checked{{end}}>
</div>
</div>
<div class="field">
<button class="ui green button">{{.i18n.Tr "admin.auths.update"}}</button>
<div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.i18n.Tr "admin.auths.delete"}}</div>
2015-12-08 01:30:52 +03:00
</div>
2017-03-16 01:39:38 +03:00
</form>
2015-12-08 01:30:52 +03:00
</div>
</div>
2015-09-11 19:03:08 +03:00
</div>
<div class="ui small basic delete modal">
2015-12-08 01:30:52 +03:00
<div class="ui icon header">
2020-10-22 00:07:33 +03:00
{{svg "octicon-trashcan"}}
2015-12-08 01:30:52 +03:00
{{.i18n.Tr "admin.auths.delete_auth_title"}}
</div>
<div class="content">
<p>{{.i18n.Tr "admin.auths.delete_auth_desc"}}</p>
</div>
{{template "base/delete_modal_actions" .}}
2014-05-05 12:40:25 +04:00
</div>
2015-09-11 19:03:08 +03:00
{{template "base/footer" .}}