diff options
author | zeripath <art27@cantab.net> | 2021-09-27 02:02:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-26 21:02:01 -0400 |
commit | 7e98cd58dd670fd83c0ace5e9c8ef9a0407fd575 (patch) | |
tree | d6a7158517d666f7865540c5d350a48abcb2a72f /templates/admin | |
parent | 74542ad35bae2195972df86862da43e8d45f425f (diff) | |
download | gitea-7e98cd58dd670fd83c0ace5e9c8ef9a0407fd575.tar.gz gitea-7e98cd58dd670fd83c0ace5e9c8ef9a0407fd575.zip |
Add SkipLocal2FA option to pam and smtp sources (#17078)
* Add SkipLocal2FA option to other pam and smtp sources
Extend #16954 to allow setting skip local 2fa on pam and SMTP authentication sources
Signed-off-by: Andrew Thornton <art27@cantab.net>
* make SkipLocal2FA omitempty
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'templates/admin')
-rw-r--r-- | templates/admin/auth/edit.tmpl | 14 | ||||
-rw-r--r-- | templates/admin/auth/new.tmpl | 7 | ||||
-rw-r--r-- | templates/admin/auth/source/smtp.tmpl | 7 |
3 files changed, 28 insertions, 0 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 9ff8066384..142c537b15 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -215,6 +215,13 @@ <input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}"> <p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p> </div> + <div class="optional field"> + <div class="ui checkbox"> + <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> + <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + </div> + </div> {{end}} <!-- PAM --> @@ -228,6 +235,13 @@ <label for="pam_email_domain">{{.i18n.Tr "admin.auths.pam_email_domain"}}</label> <input id="pam_email_domain" name="pam_email_domain" value="{{$cfg.EmailDomain}}"> </div> + <div class="optional field"> + <div class="ui checkbox"> + <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> + <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + </div> + </div> {{end}} <!-- OAuth2 --> diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl index ba1f145a4a..13e1366c87 100644 --- a/templates/admin/auth/new.tmpl +++ b/templates/admin/auth/new.tmpl @@ -41,6 +41,13 @@ <label for="pam_email_domain">{{.i18n.Tr "admin.auths.pam_email_domain"}}</label> <input id="pam_email_domain" name="pam_email_domain" value="{{.pam_email_domain}}"> </div> + <div class="pam optional field {{if not (eq .type 4)}}hide{{end}}"> + <div class="ui checkbox"> + <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> + <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + </div> + </div> <!-- OAuth2 --> {{ template "admin/auth/source/oauth" . }} diff --git a/templates/admin/auth/source/smtp.tmpl b/templates/admin/auth/source/smtp.tmpl index b0f643b8ca..8572d6dc56 100644 --- a/templates/admin/auth/source/smtp.tmpl +++ b/templates/admin/auth/source/smtp.tmpl @@ -49,4 +49,11 @@ <input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}"> <p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p> </div> + <div class="optional field"> + <div class="ui checkbox"> + <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> + <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + </div> + </div> </div> |