diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-05-11 18:10:37 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-05-11 18:10:37 +0800 |
commit | bf58679390b9045054139fd0f43bef9bb972f3e6 (patch) | |
tree | 1530b7daea20b3869c0ebea6128364f1b6f27edd /templates | |
parent | cdc87623dc818173a74d0bf57c99ee6dd2911c84 (diff) | |
download | gitea-bf58679390b9045054139fd0f43bef9bb972f3e6.tar.gz gitea-bf58679390b9045054139fd0f43bef9bb972f3e6.zip |
add support for smtp authentication
Diffstat (limited to 'templates')
-rw-r--r-- | templates/admin/auths/edit.tmpl | 60 | ||||
-rw-r--r-- | templates/admin/auths/new.tmpl | 53 |
2 files changed, 83 insertions, 30 deletions
diff --git a/templates/admin/auths/edit.tmpl b/templates/admin/auths/edit.tmpl index e040ea8f77..56c4db74aa 100644 --- a/templates/admin/auths/edit.tmpl +++ b/templates/admin/auths/edit.tmpl @@ -14,18 +14,16 @@ {{.CsrfTokenHtml}} {{template "base/alert" .}} <input type="hidden" value="{{.Source.Id}}" name="id"/> + {{$type := .Source.Type}} <div class="form-group"> <label class="col-md-3 control-label">Auth Type: </label> + <input type="hidden" name="type" value="{{.Source.Type}}"/> <div class="col-md-7"> - <select class="form-control"> - {{$type := .Source.Type}} - {{range $key, $val := .LoginTypes}} - <option value="{{$key}}" {{if eq $key $type}}selected{{end}}>{{$val}}</option> - {{end}} - </select> + {{range $key, $val := .LoginTypes}} + {{if eq $key $type}}{{$val}}{{end}} + {{end}} </div> </div> - <div class="form-group {{if .Err_AuthName}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Name: </label> <div class="col-md-7"> @@ -33,6 +31,8 @@ </div> </div> + {{if eq $type 2}} + <div class="form-group {{if .Err_Domain}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Domain: </label> <div class="col-md-7"> @@ -81,7 +81,53 @@ <input name="ms_ad_sa" class="form-control" placeholder="Type Ms Ad SA" value="{{.Source.LDAP.MsAdSAFormat}}" required="required"> </div> </div> + {{else}} + {{if eq $type 3}} + + <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">SMTP Auth: </label> + <div class="col-md-7"> + <select name="smtpauth" class="form-control"> + {{$auth := .Source.SMTP.Auth}} + {{range .SMTPAuths}} + <option value="{{.}}" + {{if eq . $auth}} selected{{end}}>{{.}}</option> + {{end}} + } + </select> + </div> + </div> + + <div class="form-group {{if .Err_Host}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Host: </label> + <div class="col-md-7"> + <input name="smtphost" class="form-control" placeholder="Type host address" value="{{.Source.SMTP.Host}}"> + </div> + </div> + + <div class="form-group {{if .Err_Port}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Port: </label> + <div class="col-md-7"> + <input name="smtpport" class="form-control" placeholder="Type port number" value="{{.Source.SMTP.Port}}"> + </div> + </div> + + <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">TLS: </label> + <div class="col-md-7"> + <input name="smtptls" type="checkbox" class="form-control" {{if .Source.SMTP.TLS}}checked{{end}}> + </div> + </div> + {{end}} + {{end}} + <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Auto Register: </label> + <div class="col-md-7"> + <input name="allowautoregister" type="checkbox" class="form-control" {{if .Source.AllowAutoRegisted}}checked{{end}}> + </div> + </div> + <div class="form-group"> <div class="col-md-7 col-md-offset-3"> <div class="checkbox"> diff --git a/templates/admin/auths/new.tmpl b/templates/admin/auths/new.tmpl index 5c0ccccae8..287c996c7f 100644 --- a/templates/admin/auths/new.tmpl +++ b/templates/admin/auths/new.tmpl @@ -16,104 +16,111 @@ <div class="form-group"> <label class="col-md-3 control-label">Auth Type: </label> <div class="col-md-7"> - <select class="form-control" id="auth-type"> + <select name="type" class="form-control" id="auth-type"> {{range $key, $val := .LoginTypes}} <option value="{{$key}}">{{$val}}</option> {{end}} </select> </div> </div> - <div class="ldap"> - <div class="form-group {{if .Err_AuthName}}has-error has-feedback{{end}}"> + <div class="form-group {{if .Err_AuthName}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Name: </label> <div class="col-md-7"> - <input name="name" class="form-control" placeholder="Type authentication's name" value="{{.name}}" required="required"> + <input name="name" class="form-control" placeholder="Type authentication's name" value="{{.name}}"> </div> </div> - + <div class="ldap"> <div class="form-group {{if .Err_Domain}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Domain: </label> <div class="col-md-7"> - <input name="domain" class="form-control" placeholder="Type domain name" value="{{.domain}}" required="required"> + <input name="domain" class="form-control" placeholder="Type domain name" value="{{.domain}}"> </div> </div> <div class="form-group {{if .Err_Host}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Host: </label> <div class="col-md-7"> - <input name="host" class="form-control" placeholder="Type host address" value="{{.host}}" required="required"> + <input name="host" class="form-control" placeholder="Type host address" value="{{.host}}"> </div> </div> <div class="form-group {{if .Err_Port}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Port: </label> <div class="col-md-7"> - <input name="port" class="form-control" placeholder="Type port number" value="{{.port}}" required="required"> + <input name="port" class="form-control" placeholder="Type port number" value="{{.port}}"> </div> </div> <div class="form-group {{if .Err_BaseDN}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Base DN: </label> <div class="col-md-7"> - <input name="base_dn" class="form-control" placeholder="Type base DN" value="{{.base_dn}}" required="required"> + <input name="base_dn" class="form-control" placeholder="Type base DN" value="{{.base_dn}}"> </div> </div> <div class="form-group {{if .Err_Attributes}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Search Attributes: </label> <div class="col-md-7"> - <input name="attributes" class="form-control" placeholder="Type search attributes" value="{{.attributes}}" required="required"> + <input name="attributes" class="form-control" placeholder="Type search attributes" value="{{.attributes}}"> </div> </div> <div class="form-group {{if .Err_Filter}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Search Filter: </label> <div class="col-md-7"> - <input name="filter" class="form-control" placeholder="Type search filter" value="{{.filter}}" required="required"> + <input name="filter" class="form-control" placeholder="Type search filter" value="{{.filter}}"> </div> </div> <div class="form-group {{if .Err_MsAdSA}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Ms Ad SA: </label> <div class="col-md-7"> - <input name="ms_ad_sa" class="form-control" placeholder="Type Ms Ad SA" value="{{.ms_ad_sa}}" required="required"> + <input name="ms_ad_sa" class="form-control" placeholder="Type Ms Ad SA" value="{{.ms_ad_sa}}"> </div> </div> </div> <div class="smtp hidden"> + <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">SMTP Auth: </label> + <div class="col-md-7"> + <select name="smtpauth" class="form-control"> + {{range .SMTPAuths}} + <option value="{{.}}">{{.}}</option> + {{end}} + } + </select> + </div> + </div> + <div class="form-group {{if .Err_Host}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Host: </label> <div class="col-md-7"> - <input name="host" class="form-control" placeholder="Type host address" value="{{.host}}" required="required"> + <input name="smtphost" class="form-control" placeholder="Type host address" value="{{.host}}"> </div> </div> <div class="form-group {{if .Err_Port}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">Port: </label> <div class="col-md-7"> - <input name="port" class="form-control" placeholder="Type port number" value="{{.port}}" required="required"> + <input name="smtpport" class="form-control" placeholder="Type port number" value="{{.port}}"> </div> </div> <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}"> <label class="col-md-3 control-label">TLS: </label> <div class="col-md-7"> - <input name="port" type="checkbox" class="form-control" value="" required="required"> + <input name="smtptls" type="checkbox" class="form-control" value=""> </div> </div> - <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}"> - <label class="col-md-3 control-label">TLS: </label> + </div> + <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Auto Register: </label> <div class="col-md-7"> - <select class="form-control"> - <option value="">options</option> - </select> + <input name="allowautoregister" type="checkbox" class="form-control" value=""> </div> </div> - </div> - - <hr/> <div class="form-group"> <div class="col-md-offset-3 col-md-7"> |