2022-07-17 18:16:00 +00:00
|
|
|
<!--
|
2023-11-04 09:54:52 +00:00
|
|
|
Copyright (C) 2023 Nicola Murino
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
This WebUI uses the KeenThemes Mega Bundle, a proprietary theme:
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
https://keenthemes.com/products/templates-mega-bundle
|
2022-07-17 18:16:00 +00:00
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
KeenThemes HTML/CSS/JS components are allowed for use only within the
|
|
|
|
SFTPGo product and restricted to be used in a resealable HTML template
|
|
|
|
that can compete with KeenThemes products anyhow.
|
|
|
|
|
|
|
|
This WebUI is allowed for use only within the SFTPGo product and
|
|
|
|
therefore cannot be used in derivative works/products without an
|
|
|
|
explicit grant from the SFTPGo Team (support@sftpgo.com).
|
2022-07-17 18:16:00 +00:00
|
|
|
-->
|
2021-09-29 16:46:15 +00:00
|
|
|
{{template "base" .}}
|
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- define "page_body"}}
|
|
|
|
<div class="card shadow-sm">
|
|
|
|
<div class="card-header bg-light">
|
2023-12-26 07:59:52 +00:00
|
|
|
<h3 data-i18n="general.my_profile" class="card-title section-title">My profile</h3>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- template "errmsg" .Error}}
|
|
|
|
<form id="page_form" action="{{.CurrentURL}}" method="POST">
|
2021-09-29 16:46:15 +00:00
|
|
|
<div class="form-group row">
|
2024-01-09 18:54:08 +00:00
|
|
|
<label for="idEmail" data-i18n="general.email" class="col-md-3 col-form-label">Email</label>
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="col-md-9">
|
2024-01-27 11:48:15 +00:00
|
|
|
<input type="email" id="idEmail" name="email" placeholder="" spellcheck="false" value="{{.Email}}" maxlength="255"
|
2024-02-04 11:36:39 +00:00
|
|
|
autocomplete="off" {{if not .LoggedUser.CanChangeInfo}}{{if .Email}}class="form-control-plaintext readonly-input"{{else}}class="form-control"{{end}} readonly{{else}}class="form-control"{{end}}>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-10-11 17:20:51 +00:00
|
|
|
{{- if .LoggedUser.CanChangeInfo}}
|
|
|
|
<div class="card mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="user.additional_emails" class="card-title section-title-inner">Additional emails</h3>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<div id="additional_emails">
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="additional_emails">
|
|
|
|
{{- range $idx, $val := .AdditionalEmails}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-10 mt-3 mt-md-8">
|
|
|
|
<input type="email" class="form-control" placeholder="" name="additional_email" value="{{$val}}" maxlength="255" autocomplete="off" spellcheck="false" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger">
|
|
|
|
<i class="ki-duotone ki-trash fs-5">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
<span data-i18n="general.delete">Delete</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-10 mt-3 mt-md-8">
|
|
|
|
<input type="email" class="form-control" placeholder="" name="additional_email" value="" maxlength="255" autocomplete="off" spellcheck="false" />
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger">
|
|
|
|
<i class="ki-duotone ki-trash fs-5">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
<span data-i18n="general.delete">Delete</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div class="form-group row mt-10">
|
|
|
|
<label for="idAdditionalEmails" data-i18n="user.additional_emails" class="col-md-3 col-form-label">Additional emails</label>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<input type="text" id="idAdditionalEmails" name="description" placeholder="" value="{{.AdditionalEmailsString}}"
|
|
|
|
class="form-control-plaintext readonly-input" readonly>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="form-group row mt-10">
|
2024-01-09 18:54:08 +00:00
|
|
|
<label for="idDescription" data-i18n="general.description" class="col-md-3 col-form-label">Description</label>
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="col-md-9">
|
2024-01-21 17:10:14 +00:00
|
|
|
<input type="text" id="idDescription" name="description" placeholder="" value="{{.Description}}" maxlength="255"
|
2024-02-04 11:36:39 +00:00
|
|
|
{{if not .LoggedUser.CanChangeInfo}}{{if .Description}}class="form-control-plaintext readonly-input"{{else}}class="form-control"{{end}} readonly{{else}}class="form-control"{{end}}>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="form-group row align-items-center mt-10">
|
2024-01-09 18:54:08 +00:00
|
|
|
<label data-i18n="general.api_key_auth" class="col-md-3 col-form-label" for="idAllowAPIKeyAuth">API key authentication</label>
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="col-md-9">
|
|
|
|
<div class="form-check form-switch form-check-custom form-check-solid">
|
|
|
|
<input class="form-check-input" type="checkbox" id="idAllowAPIKeyAuth" name="allow_api_key_auth" {{if not .LoggedUser.CanChangeAPIKeyAuth}}disabled="disabled"{{end}} {{if .AllowAPIKeyAuth}}checked="checked"{{end}}/>
|
2023-12-10 15:40:13 +00:00
|
|
|
<label data-i18n="general.api_key_auth_help" class="form-check-label fw-semibold text-gray-800" for="idAllowAPIKeyAuth">
|
2023-11-04 09:54:52 +00:00
|
|
|
Allow to impersonate yourself, in REST API, using an API key
|
|
|
|
</label>
|
|
|
|
</div>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- if .LoggedUser.CanManagePublicKeys}}
|
2024-01-09 18:54:08 +00:00
|
|
|
<div class="card mt-10">
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="card-header bg-light">
|
2023-12-26 07:59:52 +00:00
|
|
|
<h3 data-i18n="general.pub_keys" class="card-title section-title-inner">Public keys</h3>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
2023-11-04 09:54:52 +00:00
|
|
|
<div id="public_keys">
|
2024-05-03 16:30:03 +00:00
|
|
|
{{- template "infomsg-no-mb" "general.pub_keys_help"}}
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="public_keys">
|
|
|
|
{{- range $idx, $val := .PublicKeys}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
2024-01-09 18:54:08 +00:00
|
|
|
<div class="col-md-9 mt-3 mt-md-8">
|
|
|
|
<textarea data-i18n="[placeholder]general.pub_key_placeholder" class="form-control" name="public_key" rows="4"
|
2023-11-04 09:54:52 +00:00
|
|
|
placeholder="Paste your public key here">{{$val}}</textarea>
|
|
|
|
</div>
|
2024-01-09 18:54:08 +00:00
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
2024-01-01 19:09:15 +00:00
|
|
|
<a href="#" data-repeater-delete
|
2024-01-09 18:54:08 +00:00
|
|
|
class="btn btn-light-danger">
|
2023-11-04 09:54:52 +00:00
|
|
|
<i class="ki-duotone ki-trash fs-5">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
2024-01-01 19:09:15 +00:00
|
|
|
<span data-i18n="general.delete">Delete</span>
|
2023-11-04 09:54:52 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
2024-01-09 18:54:08 +00:00
|
|
|
<div class="col-md-9 mt-3 mt-md-8">
|
|
|
|
<textarea data-i18n="[placeholder]general.pub_key_placeholder" class="form-control" name="public_key" rows="4"
|
2023-11-04 09:54:52 +00:00
|
|
|
placeholder="Paste your public key here"></textarea>
|
|
|
|
</div>
|
2024-01-09 18:54:08 +00:00
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
2024-01-01 19:09:15 +00:00
|
|
|
<a href="#" data-repeater-delete
|
2024-01-09 18:54:08 +00:00
|
|
|
class="btn btn-light-danger">
|
2023-11-04 09:54:52 +00:00
|
|
|
<i class="ki-duotone ki-trash fs-5">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
2024-01-01 19:09:15 +00:00
|
|
|
<span data-i18n="general.delete">Delete</span>
|
2023-11-04 09:54:52 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- end}}
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="form-group mt-5">
|
2024-01-01 19:09:15 +00:00
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
2023-11-04 09:54:52 +00:00
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
2024-01-01 19:09:15 +00:00
|
|
|
<span data-i18n="general.add">Add</span>
|
2023-11-04 09:54:52 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
2021-09-29 16:46:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- end}}
|
2024-05-03 16:30:03 +00:00
|
|
|
{{- if .LoggedUser.CanManageTLSCerts}}
|
|
|
|
<div class="card mt-10">
|
|
|
|
<div class="card-header bg-light">
|
|
|
|
<h3 data-i18n="user.tls_certs" class="card-title section-title-inner">TLS certificates</h3>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<div id="tls_certs">
|
|
|
|
{{- template "infomsg-no-mb" "user.tls_certs_help"}}
|
|
|
|
<div class="form-group">
|
|
|
|
<div data-repeater-list="tls_certs">
|
|
|
|
{{- range $idx, $val := .TLSCerts}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-9 mt-3 mt-md-8">
|
|
|
|
<textarea data-i18n="[placeholder]user.tls_cert_help" class="form-control" name="tls_cert" rows="4">{{$val}}</textarea>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger">
|
|
|
|
<i class="ki-duotone ki-trash fs-5">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
<span data-i18n="general.delete">Delete</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- else}}
|
|
|
|
<div data-repeater-item>
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-9 mt-3 mt-md-8">
|
|
|
|
<textarea data-i18n="[placeholder]user.tls_cert_help" class="form-control" name="tls_cert" rows="4"></textarea>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
|
|
<a href="#" data-repeater-delete
|
|
|
|
class="btn btn-light-danger">
|
|
|
|
<i class="ki-duotone ki-trash fs-5">
|
|
|
|
<span class="path1"></span>
|
|
|
|
<span class="path2"></span>
|
|
|
|
<span class="path3"></span>
|
|
|
|
<span class="path4"></span>
|
|
|
|
<span class="path5"></span>
|
|
|
|
</i>
|
|
|
|
<span data-i18n="general.delete">Delete</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group mt-5">
|
|
|
|
<a href="#" data-repeater-create class="btn btn-light-primary">
|
|
|
|
<i class="ki-duotone ki-plus fs-3"></i>
|
|
|
|
<span data-i18n="general.add">Add</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end}}
|
2024-05-03 16:38:13 +00:00
|
|
|
{{if .CanSubmit}}
|
2023-11-04 09:54:52 +00:00
|
|
|
<div class="d-flex justify-content-end mt-12">
|
|
|
|
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
|
|
|
<button type="submit" id="form_submit" class="btn btn-primary px-10">
|
2023-12-10 15:40:13 +00:00
|
|
|
<span data-i18n="general.submit" class="indicator-label">
|
2023-11-04 09:54:52 +00:00
|
|
|
Submit
|
|
|
|
</span>
|
2023-12-10 15:40:13 +00:00
|
|
|
<span data-i18n="general.wait" class="indicator-progress">
|
|
|
|
Please wait...
|
|
|
|
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
2023-11-04 09:54:52 +00:00
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2024-05-03 16:38:13 +00:00
|
|
|
{{- end}}
|
2021-09-29 16:46:15 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- end}}
|
2021-09-29 16:46:15 +00:00
|
|
|
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- define "extra_js"}}
|
2024-05-03 16:30:03 +00:00
|
|
|
{{- if or .LoggedUser.CanManagePublicKeys .LoggedUser.CanManageTLSCerts}}
|
2023-11-21 15:24:43 +00:00
|
|
|
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/formrepeater/formrepeater.bundle.js"></script>
|
2024-01-18 18:18:57 +00:00
|
|
|
{{- end}}
|
2023-11-16 17:55:14 +00:00
|
|
|
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
2023-11-04 09:54:52 +00:00
|
|
|
KTUtil.onDOMContentLoaded(function () {
|
2024-05-03 16:30:03 +00:00
|
|
|
//{{- if or .LoggedUser.CanManagePublicKeys .LoggedUser.CanManageTLSCerts}}
|
2024-01-18 18:18:57 +00:00
|
|
|
//{{- if .LoggedUser.CanManagePublicKeys}}
|
2023-11-16 17:55:14 +00:00
|
|
|
initRepeater('#public_keys');
|
2024-05-03 16:30:03 +00:00
|
|
|
//{{- end}}
|
|
|
|
//{{- if .LoggedUser.CanManageTLSCerts}}
|
|
|
|
initRepeater('#tls_certs');
|
|
|
|
//{{- end}}
|
2024-10-11 17:20:51 +00:00
|
|
|
//{{- if .LoggedUser.CanChangeInfo}}
|
|
|
|
initRepeater('#additional_emails');
|
|
|
|
//{{- end}}
|
2023-11-16 17:55:14 +00:00
|
|
|
initRepeaterItems();
|
2024-01-18 18:18:57 +00:00
|
|
|
//{{- end}}
|
2023-11-04 09:54:52 +00:00
|
|
|
|
2024-05-03 16:38:13 +00:00
|
|
|
//{{if .CanSubmit}}
|
2023-11-04 09:54:52 +00:00
|
|
|
$("#page_form").submit(function (event) {
|
|
|
|
let submitButton = document.querySelector('#form_submit');
|
|
|
|
submitButton.setAttribute('data-kt-indicator', 'on');
|
|
|
|
submitButton.disabled = true;
|
2021-09-29 16:46:15 +00:00
|
|
|
});
|
2024-05-03 16:38:13 +00:00
|
|
|
//{{- end}}
|
2021-09-29 16:46:15 +00:00
|
|
|
});
|
|
|
|
</script>
|
2023-11-04 09:54:52 +00:00
|
|
|
{{- end}}
|