2022-07-17 18:16:00 +00:00
<!--
2024-01-09 18:54:08 +00:00
Copyright (C) 2024 Nicola Murino
2022-07-17 18:16:00 +00:00
2024-01-09 18:54:08 +00:00
This WebUI uses the KeenThemes Mega Bundle, a proprietary theme:
2022-07-17 18:16:00 +00:00
2024-01-09 18:54:08 +00:00
https://keenthemes.com/products/templates-mega-bundle
2022-07-17 18:16:00 +00:00
2024-01-09 18:54:08 +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
-->
2019-10-07 16:19:01 +00:00
{{template "base" .}}
2024-01-09 18:54:08 +00:00
{{- define "page_body"}}
< div class = "card shadow-sm" >
< div class = "card-header bg-light" >
< h3 data-i18n = "{{.Title}}" class = "card-title section-title" > < / h3 >
2021-01-22 18:42:18 +00:00
< / div >
< div class = "card-body" >
2024-01-09 18:54:08 +00:00
{{- if eq .Mode 3}}
< div class = "notice d-flex bg-light-primary rounded border-primary border border-dashed p-6 mb-5" >
< i class = "ki-duotone ki-shield-tick fs-2tx text-primary me-4" >
< span class = "path1" > < / span >
< span class = "path2" > < / span >
< / i >
< div class = "d-flex flex-stack flex-grow-1 flex-wrap flex-md-nowrap" >
< div class = "mb-3 mb-md-0 fw-semibold" >
< h4 class = "text-gray-900 fw-bold" >
2024-01-16 18:51:37 +00:00
< span data-i18n = "user.template_title" > Create one or more new users from this template< / span >
2024-01-09 18:54:08 +00:00
< / h4 >
< div class = "fs-6 text-gray-800 pe-7" >
2024-01-16 18:51:37 +00:00
< p data-i18n = "general.template_placeholders" class = "mt-5" > The following placeholders are supported< / p >
2024-01-09 18:54:08 +00:00
< ul >
2024-01-16 18:51:37 +00:00
< li > < span class = "text-info" > %username%< / span > , < span data-i18n = "user.template_username_placeholder" > replaced with the specified username< / span > < / li >
< li > < span class = "text-info" > %password%< / span > , < span data-i18n = "user.template_password_placeholder" > replaced with the specified password< / span > < / li >
2024-01-09 18:54:08 +00:00
< / ul >
2024-01-16 18:51:37 +00:00
< p data-i18n = "user.template_help1" > Placeholders will be replaced in paths and credentials of the configured storage backend.< / p >
< p data-i18n = "user.template_help2" > The generated users can be saved or exported. Exported users can be imported from the "Maintenance" section of this SFTPGo instance or another.< / p >
2024-01-09 18:54:08 +00:00
< / div >
< / div >
2021-01-25 20:31:33 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
{{- template "errmsg" .Error}}
2021-01-25 20:31:33 +00:00
< form id = "user_form" enctype = "multipart/form-data" action = "{{.CurrentURL}}" method = "POST" autocomplete = "off" { { if eq . Mode 3 } } target = "_blank" { { end } } >
2024-01-09 18:54:08 +00:00
{{- if eq .Mode 3}}
< div class = "card mt-10" >
< div class = "card-header bg-light" >
< h3 data-i18n = "title.users" class = "card-title section-title-inner" > Users< / h3 >
2021-05-23 20:02:01 +00:00
< / div >
< div class = "card-body" >
2024-01-09 18:54:08 +00:00
< div id = "template_users" >
< p class = "fs-5 fw-semibold mb-4" data-i18n = "user.template_help" > For each user set the username and at least one of the password and public key< / p >
< div class = "form-group" >
< div data-repeater-list = "template_users" >
< div data-repeater-item >
< div class = "form-group row" >
< div class = "col-md-3 mt-3 mt-md-8" >
< input data-i18n = "[placeholder]login.username" type = "text" class = "form-control" name = "tpl_username" autocomplete = "nope" spellcheck = "false" value = "" / >
< / div >
< div class = "col-md-3 mt-3 mt-md-8" >
< input data-i18n = "[placeholder]login.password" type = "password" class = "form-control" name = "tpl_password" autocomplete = "nope" spellcheck = "false" value = "" / >
< / div >
< div class = "col-md-5 mt-3 mt-md-8" >
< textarea class = "form-control" name = "tpl_public_keys" rows = "5" placeholder = "Paste your public key here" > < / textarea >
< / div >
< div class = "col-md-1 mt-3 mt-md-8" >
< a href = "#" data-repeater-delete
class="btn btn-light-danger ps-5 pe-4">
< i class = "ki-duotone ki-trash fs-2" >
< span class = "path1" > < / span >
< span class = "path2" > < / span >
< span class = "path3" > < / span >
< span class = "path4" > < / span >
< span class = "path5" > < / span >
< / i >
< / a >
< / div >
< / div >
2021-05-23 20:02:01 +00:00
< / div >
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< 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 >
2021-05-23 20:02:01 +00:00
< / div >
2021-01-25 20:31:33 +00:00
< / div >
< / div >
< input type = "hidden" name = "username" id = "idUsername" value = "{{.User.Username}}" >
2024-01-09 18:54:08 +00:00
{{- else}}
2021-01-22 18:42:18 +00:00
< div class = "form-group row" >
2024-01-09 18:54:08 +00:00
< label for = "idUsername" data-i18n = "login.username" class = "col-md-3 col-form-label" > Username< / label >
< div class = "col-md-9" >
< input id = "idUsername" type = "text" class = "form-control" placeholder = "" name = "username" value = "{{.User.Username}}"
maxlength="255" autocomplete="nope" spellcheck="false" required {{if ge .Mode 2}}readonly{{end}} />
2021-01-22 18:42:18 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
2019-10-07 16:19:01 +00:00
2024-01-09 18:54:08 +00:00
{{- if .Roles}}
< div class = "form-group row mt-10" >
< label for = "idRole" data-i18n = "general.role" class = "col-md-3 col-form-label" > Role< / label >
< div class = "col-md-9" >
< select id = "idRole" name = "role" data-i18n = "[data-placeholder]general.role_placeholder" class = "form-select" data-control = "i18n-select2" data-placeholder = "Select a role" data-allow-clear = "true" aria-describedby = "idRoleHelp" >
2022-11-16 18:04:50 +00:00
< option value = "" > < / option >
{{- range .Roles}}
< option value = "{{.Name}}" { { if eq $ . User . Role . Name } } selected { { end } } > {{.Name}}< / option >
{{- end}}
< / select >
2024-01-09 18:54:08 +00:00
< div id = "idRoleHelp" data-i18n = "user.role_help" class = "form-text" >
2022-11-16 18:04:50 +00:00
Users with a role can be managed by global administrators and administrators with the same role
2024-01-09 18:54:08 +00:00
< / div >
2022-11-16 18:04:50 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
{{- if ne .Mode 3}}
< div class = "form-group row mt-10" >
< label for = "idPassword" data-i18n = "login.password" class = "col-md-3 col-form-label" > Password< / label >
< div class = "col-md-9" >
< input id = "idPassword" type = "password" class = "form-control" name = "password" autocomplete = "off"
spellcheck="false" value="{{.User.Password}}" />
2021-01-22 18:42:18 +00:00
< / div >
< / div >
2019-10-07 16:19:01 +00:00
2024-01-09 18:54:08 +00:00
< div class = "form-group row align-items-center mt-10" >
< label data-i18n = "user.require_pwd_change" class = "col-md-3 col-form-label" for = "idRequirePasswordChange" > Require password change< / label >
< 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 = "idRequirePasswordChange" name = "require_password_change" { { if . User . Filters . RequirePasswordChange } } checked = "checked" { { end } } / >
< label data-i18n = "user.require_pwd_change_help" class = "form-check-label fw-semibold text-gray-800" for = "idRequirePasswordChange" >
User must change password from the WebClient at next login
< / label >
< / div >
2022-12-11 16:15:34 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< div class = "card mt-10" >
< div class = "card-header bg-light" >
< h3 data-i18n = "general.pub_keys" class = "card-title section-title-inner" > Public keys< / h3 >
2021-05-23 20:02:01 +00:00
< / div >
< div class = "card-body" >
2024-01-09 18:54:08 +00:00
< div id = "public_keys" >
< div class = "form-group" >
< div data-repeater-list = "public_keys" >
{{- range $idx, $val := .User.PublicKeys}}
< div data-repeater-item >
< div class = "form-group row" >
< 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"
placeholder="Paste your public key here">{{$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 >
2021-05-23 20:02:01 +00:00
< / div >
2024-01-09 18:54:08 +00:00
{{- else}}
< div data-repeater-item >
< div class = "form-group row" >
< 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"
placeholder="Paste your public key here">< / 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 >
2021-05-23 20:02:01 +00:00
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
2021-05-23 20:02:01 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< 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 >
2021-05-23 20:02:01 +00:00
< / div >
2021-01-22 18:42:18 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
2021-02-28 11:10:40 +00:00
2024-01-09 18:54:08 +00:00
{{- if .Groups}}
< div class = "card mt-10 {{if .LoggedUser.Filters.Preferences.HideGroups}}d-none{{end}}" >
< div class = "card-header bg-light" >
< h3 data-i18n = "title.groups" class = "card-title section-title-inner" > Groups< / h3 >
2022-04-25 13:49:11 +00:00
< / div >
< div class = "card-body" >
2024-01-09 18:54:08 +00:00
< p data-i18n = "user.groups_help" class = "fs-5 fw-semibold mb-4" > < / p >
< div class = "form-group row mt-10" >
< label for = "idPrimaryGroup" data-i18n = "user.primary_group" class = "col-md-3 col-form-label" > Primary group< / label >
< div class = "col-md-9" >
< select id = "idPrimaryGroup" name = "primary_group" data-i18n = "[data-placeholder]general.group_placeholder" class = "form-select" data-control = "i18n-select2" data-placeholder = "Select a group" data-allow-clear = "true" >
2022-04-25 13:49:11 +00:00
< option value = "" > < / option >
{{- range .Groups}}
< option value = "{{.Name}}" { { if $ . User . HasPrimaryGroup . Name } } selected { { end } } > {{.Name}}< / option >
{{- end}}
< / select >
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idSecondaryGroup" data-i18n = "user.secondary_groups" class = "col-md-3 col-form-label" >
Secondary groups
< / label >
< div class = "col-md-9" >
< select id = "idSecondaryGroup" name = "secondary_groups" class = "form-select" data-control = "i18n-select2" data-close-on-select = "false" multiple >
2022-04-25 13:49:11 +00:00
{{- range .Groups}}
< option value = "{{.Name}}" { { if $ . User . HasSecondaryGroup . Name } } selected { { end } } > {{.Name}}< / option >
{{- end}}
< / select >
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idMembershipGroup" data-i18n = "user.membership_groups" class = "col-md-3 col-form-label" >
Membership groups
< / label >
< div class = "col-md-9" >
< select id = "idMembershipGroup" name = "membership_groups" class = "form-select" data-control = "i18n-select2" data-close-on-select = "false" multiple >
2022-09-13 16:04:27 +00:00
{{- range .Groups}}
< option value = "{{.Name}}" { { if $ . User . HasMembershipGroup . Name } } selected { { end } } > {{.Name}}< / option >
{{- end}}
< / select >
< / div >
< / div >
2022-04-25 13:49:11 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
2022-04-25 13:49:11 +00:00
2024-01-09 18:54:08 +00:00
{{- template "fshtml" .FsWrapper}}
{{- if .VirtualFolders}}
< div class = "card mt-10 {{if .LoggedUser.Filters.Preferences.HideVirtualFolders}}d-none{{end}}" >
< div class = "card-header bg-light" >
< h3 data-i18n = "title.folders" class = "card-title section-title-inner" > Virtual folders< / h3 >
2021-01-22 18:42:18 +00:00
< / div >
2021-05-23 20:02:01 +00:00
< div class = "card-body" >
2024-01-09 18:54:08 +00:00
< div id = "virtual_folders" >
< p class = "fs-5 fw-semibold mb-4" data-i18n = "user.virtual_folders_help" >
Quota size/files -1 means included within user quota, 0 unlimited. Don't set -1 for shared folders. You can use MB/GB/TB suffix. Without suffix we assume bytes
< / p >
< div class = "form-group" >
< div data-repeater-list = "virtual_folders" >
{{- range $idx, $val := .User.VirtualFolders}}
< div data-repeater-item >
< div data-repeater-item >
< div class = "form-group row" >
< div class = "col-md-3 mt-3 mt-md-8" >
< input data-i18n = "[placeholder]virtual_folders.mount_path" type = "text" class = "form-control" name = "vfolder_path" value = "{{$val.VirtualPath}}" / >
< / div >
< div class = "col-md-3 mt-3 mt-md-8" >
< select name = "vfolder_name" data-i18n = "[data-placeholder]general.folder_placeholder" class = "form-select select-repetear" data-placeholder = "Select a folder" data-allow-clear = "true" >
< option value = "" > < / option >
{{- range $.VirtualFolders}}
< option value = "{{.Name}}" { { - if eq $ val . Name . Name } } selected { { - end } } > {{.Name}}< / option >
{{- end}}
< / select >
< / div >
< div class = "col-md-3 mt-3 mt-md-8" >
< input type = "text" class = "form-control" name = "vfolder_quota_size" value = "{{HumanizeBytes $val.QuotaSize}}" / >
< div class = "form-text" data-i18n = "virtual_folders.quota_size" > < / div >
< / div >
2024-01-10 17:49:20 +00:00
< div class = "col-md-2 mt-3 mt-md-8" >
2024-01-09 18:54:08 +00:00
< input type = "number" min = "-1" class = "form-control" name = "vfolder_quota_files" value = "{{$val.QuotaFiles}}" / >
< div class = "form-text" data-i18n = "virtual_folders.quota_files" > < / div >
< / div >
< div class = "col-md-1 mt-3 mt-md-8" >
< a href = "#" data-repeater-delete
class="btn btn-light-danger ps-5 pe-4">
< i class = "ki-duotone ki-trash fs-2" >
< span class = "path1" > < / span >
< span class = "path2" > < / span >
< span class = "path3" > < / span >
< span class = "path4" > < / span >
< span class = "path5" > < / span >
< / i >
< / a >
< / div >
< / div >
< / div >
2021-05-23 20:02:01 +00:00
< / div >
2024-01-09 18:54:08 +00:00
{{- else}}
< div data-repeater-item >
< div class = "form-group row" >
< div class = "col-md-3 mt-3 mt-md-8" >
< input data-i18n = "[placeholder]virtual_folders.mount_path" type = "text" class = "form-control" name = "vfolder_path" value = "" / >
< / div >
< div class = "col-md-3 mt-3 mt-md-8" >
< select name = "vfolder_name" data-i18n = "[data-placeholder]general.folder_placeholder" class = "form-select select-repetear" data-placeholder = "Select a folder" data-allow-clear = "true" >
< option value = "" > < / option >
{{- range .VirtualFolders}}
< option value = "{{.Name}}" > {{.Name}}< / option >
{{- end}}
< / select >
< / div >
< div class = "col-md-3 mt-3 mt-md-8" >
< input type = "text" class = "form-control" name = "vfolder_quota_size" value = "" / >
< div class = "form-text" data-i18n = "virtual_folders.quota_size" > < / div >
< / div >
< div class = "col-md-2 mt-3 mt-md-8" >
< input type = "number" min = "-1" class = "form-control" name = "vfolder_quota_files" value = "" / >
< div class = "form-text" data-i18n = "virtual_folders.quota_files" > < / div >
< / div >
< div class = "col-md-1 mt-3 mt-md-8" >
< a href = "#" data-repeater-delete
class="btn btn-light-danger ps-5 pe-4">
< i class = "ki-duotone ki-trash fs-2" >
< span class = "path1" > < / span >
< span class = "path2" > < / span >
< span class = "path3" > < / span >
< span class = "path4" > < / span >
< span class = "path5" > < / span >
< / i >
< / a >
< / div >
< / div >
2021-05-23 20:02:01 +00:00
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
2021-05-23 20:02:01 +00:00
< / div >
< / div >
2019-12-25 17:20:19 +00:00
2024-01-09 18:54:08 +00:00
< 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 >
2021-05-23 20:02:01 +00:00
< / div >
2021-05-06 19:35:43 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
< div class = "accordion shadow-sm mt-10 {{- if eq .LoggedUser.Filters.Preferences.VisibleUserPageSections 0}} d-none{{- end}}" id = "accordionUser" >
< div class = "accordion-item {{- if .LoggedUser.Filters.Preferences.HideProfile}} d-none{{- end}}" >
< h2 class = "accordion-header" id = "headingProfile" >
< button class = "accordion-button section-title-inner text-primary collapsed" type = "button" data-bs-toggle = "collapse" data-bs-target = "#collapseProfile" aria-expanded = "true" aria-controls = "collapseProfile" >
< span data-i18n = "title.profile" > Profile< / span >
< / button >
< / h2 >
< div id = "collapseProfile" class = "accordion-collapse collapse" aria-labelledby = "headingProfile" data-bs-parent = "#accordionUser" >
< div class = "accordion-body" >
2022-01-10 18:44:16 +00:00
< div class = "form-group row" >
2024-01-09 18:54:08 +00:00
< label for = "idStatus" data-i18n = "user.status" class = "col-md-3 col-form-label" > Status< / label >
< div class = "col-md-9" >
< select id = "idStatus" name = "status" class = "form-select" data-control = "i18n-select2" data-hide-search = "true" >
< option data-i18n = "general.active" value = "1" { { - if eq . User . Status 1 } } selected { { - end } } > Active< / option >
< option data-i18n = "general.inactive" value = "0" { { - if eq . User . Status 0 } } selected { { - end } } > Inactive< / option >
2021-05-23 20:02:01 +00:00
< / select >
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "id_expiration" data-i18n = "general.expiration" class = "col-md-3 col-form-label" > Expiration< / label >
< div class = "col-md-9 d-flex" >
< input data-i18n = "[placeholder]general.expiration_help" id = "id_expiration" class = "form-control" placeholder = "Pick an expiration date" / >
< button class = "btn btn-icon btn-light-danger ms-2 d-none" id = "id_expiration_clear" >
< i class = "ki-solid ki-cross fs-1" > < / i >
< / button >
2021-05-23 20:02:01 +00:00
< / div >
< / div >
2022-01-10 18:44:16 +00:00
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idEmail" data-i18n = "general.email" class = "col-md-3 col-form-label" > Email< / label >
< div class = "col-md-9" >
< input id = "idEmail" type = "text" class = "form-control" placeholder = "" name = "email" value = "{{.User.Email}}"
maxlength="255" autocomplete="nope" spellcheck="false" />
2021-05-23 20:02:01 +00:00
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2024-01-14 08:09:42 +00:00
{{- template "user_group_profile" .User.Filters}}
2023-08-07 17:07:20 +00:00
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idDescription" data-i18n = "general.description" class = "col-md-3 col-form-label" > Description< / label >
< div class = "col-md-9" >
2024-01-10 17:49:20 +00:00
< input id = "idDescription" type = "text" class = "form-control" name = "description" value = "{{.User.Description}}" maxlength = "255" >
2021-05-23 20:02:01 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idAdditionalInfo" data-i18n = "general.additional_info" class = "col-md-3 col-form-label" > Additional info< / label >
< div class = "col-md-9" >
< textarea id = "idAdditionalInfo" class = "form-control" name = "additional_info" rows = "3" > {{.User.AdditionalInfo}}< / textarea >
2022-01-10 18:44:16 +00:00
< / div >
< / div >
< / div >
2021-05-23 20:02:01 +00:00
< / div >
2021-01-22 18:42:18 +00:00
< / div >
2019-10-07 16:19:01 +00:00
2024-01-09 18:54:08 +00:00
< div class = "accordion-item {{- if .LoggedUser.Filters.Preferences.HideACLs}} d-none{{- end}}" >
< h2 class = "accordion-header" id = "headingPermissions" >
< button class = "accordion-button section-title-inner text-primary collapsed" type = "button" data-bs-toggle = "collapse" data-bs-target = "#collapsePermissions" aria-expanded = "true" aria-controls = "collapsePermissions" >
< span data-i18n = "general.acls" > ACLs< / span >
< / button >
< / h2 >
< div id = "collapsePermissions" class = "accordion-collapse collapse" aria-labelledby = "headingPermissions" data-bs-parent = "#accordionUser" >
< div class = "accordion-body" >
2022-01-10 18:44:16 +00:00
< div class = "form-group row" >
2024-01-09 18:54:08 +00:00
< label for = "idPermissions" data-i18n = "general.permissions" class = "col-md-3 col-form-label" >
Permissions
< / label >
< div class = "col-md-9" >
< select id = "idPermissions" name = "permissions" class = "form-select" data-control = "i18n-select2" data-hide-search = "true" data-close-on-select = "false" multiple >
{{- range $validPerm := .ValidPerms}}
< option value = "{{$validPerm}}" { { - range $ perm : = $.RootDirPerms } } { { - if eq $ perm $ validPerm } } selected { { - end } } { { - end } } > {{$validPerm}}< / option >
{{- end}}
2022-01-10 18:44:16 +00:00
< / select >
< / div >
< / div >
2020-02-23 10:30:26 +00:00
2024-01-09 18:54:08 +00:00
< div class = "card mt-10" >
< div class = "card-header bg-light" >
< h3 data-i18n = "filters.directory_permissions" class = "card-title section-title-inner" > Per-directory permissions< / h3 >
2022-01-10 18:44:16 +00:00
< / div >
< div class = "card-body" >
2024-01-09 18:54:08 +00:00
< div id = "directory_permissions" >
< p class = "fs-5 fw-semibold mb-4" data-i18n = "filters.directory_permissions_help" > < / p >
< div class = "form-group" >
< div data-repeater-list = "directory_permissions" >
{{- range $idx, $dirPerms := .User.GetSubDirPermissions -}}
< div data-repeater-item >
< div class = "form-group row" >
< div class = "col-md-6 mt-3 mt-md-8" >
< input data-i18n = "[placeholder]filters.directory_path_help" type = "text" class = "form-control" name = "sub_perm_path" value = "{{$dirPerms.Path}}" / >
< / div >
< div class = "col-md-5 mt-3 mt-md-8" >
< select name = "sub_perm_permissions" data-i18n = "[data-placeholder]general.permissions" class = "form-select select-repetear" data-hide-search = "true" data-close-on-select = "false" multiple >
{{- range $validPerm := $.ValidPerms}}
< option value = "{{$validPerm}}" { { - range $ perm : = $dirPerms.Permissions } } { { - if eq $ perm $ validPerm } } selected { { - end } } { { - end } } > {{$validPerm}}< / option >
{{- end}}
< / select >
< / div >
< div class = "col-md-1 mt-3 mt-md-8" >
< a href = "#" data-repeater-delete
class="btn btn-light-danger ps-5 pe-4">
< i class = "ki-duotone ki-trash fs-2" >
< span class = "path1" > < / span >
< span class = "path2" > < / span >
< span class = "path3" > < / span >
< span class = "path4" > < / span >
< span class = "path5" > < / span >
< / i >
< / a >
< / div >
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2024-01-09 18:54:08 +00:00
{{- else}}
< div data-repeater-item >
< div class = "form-group row" >
< div class = "col-md-6 mt-3 mt-md-8" >
< input data-i18n = "[placeholder]filters.directory_path_help" type = "text" class = "form-control" name = "sub_perm_path" value = "" / >
< / div >
< div class = "col-md-5 mt-3 mt-md-8" >
< select name = "sub_perm_permissions" data-i18n = "[data-placeholder]general.permissions" class = "form-select select-repetear" data-hide-search = "true" data-close-on-select = "false" multiple >
{{- range $validPerm := .ValidPerms}}
< option value = "{{$validPerm}}" > {{$validPerm}}< / option >
{{- end}}
< / select >
< / div >
< div class = "col-md-1 mt-3 mt-md-8" >
< a href = "#" data-repeater-delete
class="btn btn-light-danger ps-5 pe-4">
< i class = "ki-duotone ki-trash fs-2" >
< span class = "path1" > < / span >
< span class = "path2" > < / span >
< span class = "path3" > < / span >
< span class = "path4" > < / span >
< span class = "path5" > < / span >
< / i >
< / a >
< / div >
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
2022-01-10 18:44:16 +00:00
< / div >
< / div >
2021-12-10 17:43:26 +00:00
2024-01-09 18:54:08 +00:00
< 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 >
2022-01-10 18:44:16 +00:00
< / div >
< / div >
< / div >
2019-10-07 16:19:01 +00:00
2024-01-14 08:09:42 +00:00
{{- template "user_group_perms" .User.Filters}}
2019-10-07 16:19:01 +00:00
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idMaxSessions" data-i18n = "filters.max_sessions" class = "col-md-3 col-form-label" > Max sessions< / label >
< div class = "col-md-9" >
< input id = "idMaxSessions" type = "number" min = "0" class = "form-control" name = "max_sessions" value = "{{.User.MaxSessions}}" aria-describedby = "idMaxSessionsHelp" / >
< div id = "idMaxSessionsHelp" class = "form-text" data-i18n = "filters.max_sessions_help" > < / div >
2021-12-10 17:43:26 +00:00
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idProtocols" data-i18n = "filters.denied_protocols" class = "col-md-3 col-form-label" >
Denied protocols
< / label >
< div class = "col-md-9" >
< select id = "idProtocols" name = "denied_protocols" class = "form-select" data-control = "i18n-select2" data-close-on-select = "false" multiple >
{{- range $protocol := .ValidProtocols}}
< option value = "{{$protocol}}" { { - range $ p : = $.User.Filters.DeniedProtocols } } { { - if eq $ p $ protocol } } selected { { - end } } { { - end } } > {{$protocol}}< / option >
{{- end}}
2022-01-10 18:44:16 +00:00
< / select >
2021-12-10 17:43:26 +00:00
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2021-12-10 17:43:26 +00:00
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idLoginMethods" data-i18n = "filters.denied_login_methods" class = "col-md-3 col-form-label" >
2024-01-14 08:09:42 +00:00
Denied login methods
2024-01-09 18:54:08 +00:00
< / label >
< div class = "col-md-9" >
< select id = "idLoginMethods" name = "denied_login_methods" class = "form-select" data-control = "i18n-select2" data-close-on-select = "false" multiple aria-describedby = "idLoginMethodsHelp" >
{{- range $method := .ValidLoginMethods}}
< option value = "{{$method}}" { { - range $ m : = $.User.Filters.DeniedLoginMethods } } { { - if eq $ m $ method } } selected { { - end } } { { - end } } > {{$method}}< / option >
{{- end}}
2022-01-10 18:44:16 +00:00
< / select >
2024-01-09 18:54:08 +00:00
< div id = "idLoginMethodsHelp" data-i18n = "filters.denied_login_methods_help" class = "form-text" >
< / div >
2022-03-06 15:57:13 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idTwoFactorProtocols" data-i18n = "2fa.require_for" class = "col-md-3 col-form-label" >
Require 2FA for
< / label >
< div class = "col-md-9" >
< select id = "idTwoFactorProtocols" name = "required_two_factor_protocols" class = "form-select" data-control = "i18n-select2" data-close-on-select = "false" multiple >
{{- range $protocol := .TwoFactorProtocols}}
< option value = "{{$protocol}}" { { - range $ p : = $.User.Filters.TwoFactorAuthProtocols } } { { - if eq $ p $ protocol } } selected { { - end } } { { - end } } > {{$protocol}}< / option >
2022-03-06 15:57:13 +00:00
{{end}}
< / select >
2021-12-10 17:43:26 +00:00
< / div >
< / div >
2022-01-10 18:44:16 +00:00
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idWebClient" data-i18n = "filters.web_client_options" class = "col-md-3 col-form-label" >
Web client/REST API
< / label >
< div class = "col-md-9" >
< select id = "idWebClient" name = "web_client_options" class = "form-select" data-control = "i18n-select2" data-close-on-select = "false" multiple >
{{- range $option := .WebClientOptions}}
< option value = "{{$option}}" { { - range $ p : = $.User.Filters.WebClient } } { { - if eq $ p $ option } } selected { { - end } } { { - end } } > {{$option}}< / option >
{{- end}}
2022-01-10 18:44:16 +00:00
< / select >
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idDeniedIP" data-i18n = "general.denied_ip_mask" class = "col-md-3 col-form-label" > Denied IP/Mask< / label >
< div class = "col-md-9" >
< textarea class = "form-control" id = "idDeniedIP" name = "denied_ip" aria-describedby = "idDeniedIPHelp"
rows="3">{{.User.GetDeniedIPAsString}}< / textarea >
< div id = "idDeniedIPHelp" class = "form-text" data-i18n = "general.ip_mask_help" > < / div >
2021-12-10 17:43:26 +00:00
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10" >
< label for = "idAllowedIP" data-i18n = "general.allowed_ip_mask" class = "col-md-3 col-form-label" > Allowed IP/Mask< / label >
< div class = "col-md-9" >
< textarea class = "form-control" id = "idAllowedIP" name = "allowed_ip" aria-describedby = "idAllowedIPHelp"
2024-01-14 08:09:42 +00:00
rows="3">{{.User.GetAllowedIPAsString}}< / textarea >
2024-01-09 18:54:08 +00:00
< div id = "idAllowedIPHelp" class = "form-text" data-i18n = "general.ip_mask_help" > < / div >
2021-12-10 17:43:26 +00:00
< / div >
< / div >
2022-01-10 18:44:16 +00:00
< / div >
2021-12-10 17:43:26 +00:00
< / div >
2021-01-22 18:42:18 +00:00
< / div >
2022-01-10 18:44:16 +00:00
2024-01-09 18:54:08 +00:00
< div class = "accordion-item {{- if .LoggedUser.Filters.Preferences.HideDiskQuotaAndBandwidthLimits}} d-none{{- end}}" >
< h2 class = "accordion-header" id = "headingQuota" >
< button class = "accordion-button section-title-inner text-primary collapsed" type = "button" data-bs-toggle = "collapse" data-bs-target = "#collapseQuota" aria-expanded = "true" aria-controls = "collapseQuota" >
< span data-i18n = "general.quota_limits" > Disk quota and bandwidth limits< / span >
< / button >
< / h2 >
< div id = "collapseQuota" class = "accordion-collapse collapse" aria-labelledby = "headingQuota" data-bs-parent = "#accordionUser" >
< div class = "accordion-body" >
2024-01-14 08:09:42 +00:00
{{template "user_group_quota" .User}}
2022-01-30 10:42:36 +00:00
2022-01-10 18:44:16 +00:00
< / div >
< / div >
2021-01-22 18:42:18 +00:00
< / div >
2019-12-30 17:37:50 +00:00
2024-01-09 18:54:08 +00:00
< div class = "accordion-item {{- if .LoggedUser.Filters.Preferences.HideAdvancedSettings}} d-none{{- end}}" >
< h2 class = "accordion-header" id = "headingAdvanced" >
< button class = "accordion-button section-title-inner text-primary collapsed" type = "button" data-bs-toggle = "collapse" data-bs-target = "#collapseAdvanced" aria-expanded = "true" aria-controls = "collapseAdvanced" >
< span data-i18n = "general.advanced_settings" > Advanced settings< / span >
< / button >
< / h2 >
< div id = "collapseAdvanced" class = "accordion-collapse collapse" aria-labelledby = "headingAdvanced" data-bs-parent = "#accordionUser" >
< div class = "accordion-body" >
2024-01-14 20:36:23 +00:00
< 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" >
< div class = "form-group" >
< div data-repeater-list = "tls_certs" >
{{- range $idx, $val := .User.Filters.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 >
2024-01-14 08:09:42 +00:00
{{template "user_group_advanced" .User.Filters}}
2022-07-26 16:51:39 +00:00
2024-01-14 08:09:42 +00:00
< div class = "form-group row mt-10 {{if not .User.HasExternalAuth}}d-none{{end}}" >
< label for = "idExtAuthCacheTime" data-i18n = "filters.external_auth_cache_time" class = "col-md-3 col-form-label" > External auth cache time< / label >
2024-01-09 18:54:08 +00:00
< div class = "col-md-9" >
2024-01-14 08:09:42 +00:00
< input id = "idExtAuthCacheTime" type = "number" min = "0" class = "form-control" name = "external_auth_cache_time" value = "{{.User.Filters.ExternalAuthCacheTime}}" aria-describedby = "idExtAuthCacheTimeHelp" / >
< div id = "idExtAuthCacheTimeHelp" class = "form-text" data-i18n = "filters.external_auth_cache_time_help" > < / div >
2022-04-25 13:49:11 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
< div class = "form-group row mt-10 {{if not .CanImpersonate}}d-none{{end}}" >
< label for = "idUID" class = "col-md-3 col-form-label" > UID< / label >
< div class = "col-md-3" >
< input id = "idUID" type = "number" min = "0" max = "2147483647" class = "form-control" name = "uid" value = "{{.User.UID}}" / >
2021-05-23 20:02:01 +00:00
< / div >
2024-01-09 18:54:08 +00:00
< div class = "col-md-1" > < / div >
< label for = "idGID" class = "col-md-2 col-form-label" > GID< / label >
< div class = "col-md-3" >
< input id = "idGID" type = "number" min = "0" max = "2147483647" class = "form-control" name = "gid" value = "{{.User.GID}}" / >
2021-05-23 20:02:01 +00:00
< / div >
2022-01-10 18:44:16 +00:00
< / div >
< / div >
2021-05-23 20:02:01 +00:00
< / div >
2021-01-22 18:42:18 +00:00
< / div >
2024-01-09 18:54:08 +00:00
2021-01-22 18:42:18 +00:00
< / div >
2024-01-09 18:54:08 +00:00
{{- if eq .Mode 2}}
< div class = "form-group row align-items-center mt-10" >
< label data-i18n = "user.disconnect" class = "col-md-3 col-form-label" for = "idDisconnect" > Disconnect the user after the update< / label >
< 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 = "idDisconnect" name = "disconnect" / >
< label data-i18n = "user.disconnect_help" class = "form-check-label fw-semibold text-gray-800" for = "idDisconnect" >
This way you force the user to login again, if connected, and so to use the new configuration
< / label >
< / div >
2021-01-22 18:42:18 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
< div class = "d-flex justify-content-end mt-12" >
< input type = "hidden" name = "expiration_date" id = "hidden_start_datetime" value = "" >
< input type = "hidden" name = "_form_token" value = "{{.CSRFToken}}" >
{{- if eq .Mode 3}}
2024-01-16 18:51:37 +00:00
< button type = "submit" id = "form_generate_submit" class = "btn btn-secondary px-10 me-10" name = "form_action" value = "export_from_template" >
2024-01-09 18:54:08 +00:00
< span data-i18n = "user.submit_export" class = "indicator-label" >
Generate and export users
< / span >
< span data-i18n = "general.wait" class = "indicator-progress" >
Please wait...
< span class = "spinner-border spinner-border-sm align-middle ms-2" > < / span >
< / span >
< / button >
{{- end}}
< button type = "submit" id = "form_submit" class = "btn btn-primary px-10" name = "form_action" value = "submit" >
< span { { if eq . Mode 3 } } data-i18n = "user.submit_generate" { { else } } data-i18n = "general.submit" { { end } } class = "indicator-label" >
Submit
< / span >
< span data-i18n = "general.wait" class = "indicator-progress" >
Please wait...
< span class = "spinner-border spinner-border-sm align-middle ms-2" > < / span >
< / span >
< / button >
2022-01-12 18:01:19 +00:00
< / div >
2021-01-22 18:42:18 +00:00
< / form >
2024-01-09 18:54:08 +00:00
2021-01-22 18:42:18 +00:00
< / div >
< / div >
2024-01-09 18:54:08 +00:00
{{- end}}
{{- define "extra_js"}}
< script { { - if . CSPNonce } } nonce = "{{.CSPNonce}}" { { - end } } src = "{{.StaticURL}}/assets/plugins/custom/formrepeater/formrepeater.bundle.js" > < / script >
< script { { - if . CSPNonce } } nonce = "{{.CSPNonce}}" { { - end } } src = "{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/it.js" > < / script >
< script type = "text/javascript" { { - if . CSPNonce } } nonce = "{{.CSPNonce}}" { { - end } } >
function onFilesystemChanged(val){
$('.form-group.fsconfig').hide();
$('.form-group.fsconfig-'+val).show();
}
$(document).on("i18nload", function(){
2021-06-05 16:29:34 +00:00
onFilesystemChanged('{{.User.FsConfig.Provider.Name}}');
2021-05-23 20:02:01 +00:00
2024-01-09 18:54:08 +00:00
$('#idFilesystem').on("change", function(){
onFilesystemChanged(this.value);
});
2022-04-25 13:49:11 +00:00
});
2021-05-23 20:02:01 +00:00
2024-01-09 18:54:08 +00:00
$(document).on("i18nshow", function(){
//{{- if eq .Mode 3}}
initRepeater('#template_users');
//{{- else}}
initRepeater('#public_keys');
//{{- end}}
initRepeater('#virtual_folders');
initRepeater('#directory_permissions');
initRepeater('#directory_patterns');
initRepeater('#src_bandwidth_limits');
2024-01-14 20:36:23 +00:00
initRepeater('#tls_certs');
2024-01-09 18:54:08 +00:00
initRepeaterItems();
//{{- if .Error}}
//{{- if ne .LoggedUser.Filters.Preferences.VisibleUserPageSections 0}}
$('#accordionUser .collapse').removeAttr("data-bs-parent").collapse('show');
//{{- end}}
//{{- end}}
const picker = $('#id_expiration').flatpickr({
enableTime: false,
time_24hr: true,
formatDate: (date, format, locale) => {
return $.t('general.datetime', {
val: new Date(date),
formatParams: {
val: { year: 'numeric', month: 'numeric', day: 'numeric' },
}
});
},
defaultHour: 23,
defaultMinute: 59,
locale: i18next.resolvedLanguage,
onChange: function(selectedDates, dateStr, instance) {
if (selectedDates.length > 0){
$('#id_expiration_clear').removeClass("d-none");
} else {
$('#id_expiration_clear').addClass("d-none");
}
}
});
//{{ if gt .User.ExpirationDate 0 }}
let input_dt = moment('{{.User.ExpirationDate }}', 'x').format('YYYY-MM-DD');
picker.setDate(input_dt, true);
//{{ end }}
$('#id_expiration_clear').on("click", function(e){
e.preventDefault();
picker.clear();
});
$("#user_form").submit(function (event) {
$('#hidden_start_datetime').val("");
let dt = picker.selectedDates;
if (dt.length > 0) {
let d = dt[0];
if (d) {
let dateString = moment.utc(d).format('YYYY-MM-DD HH:mm:ss');
$('#hidden_start_datetime').val(dateString);
}
}
2024-01-16 18:51:37 +00:00
//{{- if ne .Mode 3}}
2024-01-09 18:54:08 +00:00
let submitButton = document.querySelector('#form_submit');
submitButton.setAttribute('data-kt-indicator', 'on');
submitButton.disabled = true;
//{{- end}}
});
2020-01-31 18:04:00 +00:00
2024-01-09 18:54:08 +00:00
});
2019-11-13 10:36:21 +00:00
< / script >
2024-01-09 18:54:08 +00:00
{{- end}}