86eab21be8
some field names changed with the new UI Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
1129 lines
81 KiB
HTML
1129 lines
81 KiB
HTML
<!--
|
|
Copyright (C) 2024 Nicola Murino
|
|
|
|
This WebUI uses the KeenThemes Mega Bundle, a proprietary theme:
|
|
|
|
https://keenthemes.com/products/templates-mega-bundle
|
|
|
|
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).
|
|
-->
|
|
{{template "base" .}}
|
|
|
|
{{- define "page_body"}}
|
|
<div class="card shadow-sm">
|
|
<div class="card-header bg-light">
|
|
<h3 data-i18n="{{.Title}}" class="card-title section-title"></h3>
|
|
</div>
|
|
<div class="card-body">
|
|
{{- 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">
|
|
<span data-i18n="">Create one or more new users from this template</span>
|
|
</h4>
|
|
<div class="fs-6 text-gray-800 pe-7">
|
|
<p class="mt-5">The following placeholders are supported:</p>
|
|
<ul>
|
|
<li><span class="text-info">%username%</span> will be replaced with the specified username</li>
|
|
<li><span class="text-info">%password%</span> will be replaced with the specified password</li>
|
|
</ul>
|
|
<p>They will be replaced, with the specified username and password, in the paths and credentials of the configured storage backend.</p>
|
|
<p>The generated users can be saved or exported. Exported users can be imported from the "Maintenance" section of this SFTPGo instance or another.</p>
|
|
{{if .User.Username}}
|
|
<p>Please note that no credentials were copied from user "{{.User.Username}}", you have to set them explicitly.</p>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{- end}}
|
|
{{- template "errmsg" .Error}}
|
|
<form id="user_form" enctype="multipart/form-data" action="{{.CurrentURL}}" method="POST" autocomplete="off" {{if eq .Mode 3}}target="_blank"{{end}}>
|
|
{{- 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>
|
|
</div>
|
|
<div class="card-body">
|
|
<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>
|
|
</div>
|
|
</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>
|
|
<input type="hidden" name="username" id="idUsername" value="{{.User.Username}}">
|
|
{{- else}}
|
|
<div class="form-group row">
|
|
<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}} />
|
|
</div>
|
|
</div>
|
|
{{- end}}
|
|
|
|
{{- 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">
|
|
<option value=""></option>
|
|
{{- range .Roles}}
|
|
<option value="{{.Name}}" {{if eq $.User.Role .Name}}selected{{end}}>{{.Name}}</option>
|
|
{{- end}}
|
|
</select>
|
|
<div id="idRoleHelp" data-i18n="user.role_help" class="form-text">
|
|
Users with a role can be managed by global administrators and administrators with the same role
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{- 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}}" />
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</div>
|
|
<div class="card-body">
|
|
<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>
|
|
</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]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>
|
|
</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}}
|
|
|
|
{{- 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>
|
|
</div>
|
|
<div class="card-body">
|
|
<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">
|
|
<option value=""></option>
|
|
{{- range .Groups}}
|
|
<option value="{{.Name}}" {{if $.User.HasPrimaryGroup .Name}}selected{{end}}>{{.Name}}</option>
|
|
{{- end}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<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>
|
|
{{- range .Groups}}
|
|
<option value="{{.Name}}" {{if $.User.HasSecondaryGroup .Name}}selected{{end}}>{{.Name}}</option>
|
|
{{- end}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<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>
|
|
{{- range .Groups}}
|
|
<option value="{{.Name}}" {{if $.User.HasMembershipGroup .Name}}selected{{end}}>{{.Name}}</option>
|
|
{{- end}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{- end}}
|
|
|
|
{{- 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>
|
|
</div>
|
|
<div class="card-body">
|
|
<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>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<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>
|
|
</div>
|
|
{{- 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>
|
|
</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}}
|
|
|
|
<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">
|
|
|
|
<div class="form-group row">
|
|
<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>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</div>
|
|
</div>
|
|
|
|
<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" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idPasswordStrength" data-i18n="filters.password_strength" class="col-md-3 col-form-label">Password strength</label>
|
|
<div class="col-md-9">
|
|
<input id="idPasswordStrength" type="number" min="0" max="100" class="form-control" name="password_strength" value="{{.User.Filters.PasswordStrength}}" aria-describedby="idPasswordStrengthHelp"/>
|
|
<div id="idPasswordStrengthHelp" class="form-text" data-i18n="filters.password_strength_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idPasswordExpiration" data-i18n="filters.password_expiration" class="col-md-3 col-form-label">Password expiration</label>
|
|
<div class="col-md-9">
|
|
<input id="idPasswordExpiration" type="number" min="0" class="form-control" name="password_expiration" value="{{.User.Filters.PasswordExpiration}}" aria-describedby="idPasswordExpirationHelp"/>
|
|
<div id="idPasswordExpirationHelp" class="form-text" data-i18n="filters.password_expiration_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idDefaultSharesExpiration" data-i18n="filters.default_shares_expiration" class="col-md-3 col-form-label">Default shares expiration</label>
|
|
<div class="col-md-9">
|
|
<input id="idDefaultSharesExpiration" type="number" min="0" class="form-control" name="default_shares_expiration" value="{{.User.Filters.DefaultSharesExpiration}}" aria-describedby="idDefaultSharesExpirationHelp"/>
|
|
<div id="idDefaultSharesExpirationHelp" class="form-text" data-i18n="filters.default_shares_expiration_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idMaxSharesExpiration" data-i18n="filters.max_shares_expiration" class="col-md-3 col-form-label">Max shares expiration</label>
|
|
<div class="col-md-9">
|
|
<input id="idMaxSharesExpiration" type="number" min="0" class="form-control" name="max_shares_expiration" value="{{.User.Filters.MaxSharesExpiration}}" aria-describedby="idMaxSharesExpirationHelp"/>
|
|
<div id="idMaxSharesExpirationHelp" class="form-text" data-i18n="filters.max_shares_expiration_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<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">
|
|
<input id="idDescription" type="text" class="form-control" name="description" value="{{.User.Description}}" maxlength="255">
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<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">
|
|
|
|
<div class="form-group row">
|
|
<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}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</div>
|
|
<div class="card-body">
|
|
<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>
|
|
</div>
|
|
{{- 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>
|
|
</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>
|
|
|
|
<div class="card mt-10">
|
|
<div class="card-header bg-light">
|
|
<h3 data-i18n="filters.directory_patterns" class="card-title section-title-inner">Per-directory name patterns restrictions</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<div id="directory_patterns">
|
|
<p class="fs-5 fw-semibold mb-4" data-i18n="filters.directory_patterns_help"></p>
|
|
<div class="form-group">
|
|
<div data-repeater-list="directory_patterns">
|
|
{{- range $idx, $pattern := .User.Filters.GetFlatFilePatterns -}}
|
|
<div data-repeater-item>
|
|
<div class="form-group row">
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
<input data-i18n="[placeholder]filters.directory_path_help" type="text" class="form-control" name="pattern_path" value="{{$pattern.Path}}" />
|
|
</div>
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
<input type="text" class="form-control" name="patterns" placeholder="*.png,*.zip" value="{{$pattern.GetCommaSeparatedPatterns}}" />
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<select name="pattern_type" class="form-select select-repetear select-first" data-hide-search="true">
|
|
<option value="denied" data-i18n="general.denied" {{- if $pattern.IsDenied}} selected{{- end}}>Denied</option>
|
|
<option value="allowed" data-i18n="general.allowed" {{- if $pattern.IsAllowed}} selected{{- end}}>Allowed</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<select name="pattern_policy" class="form-select select-repetear select-first" data-hide-search="true">
|
|
<option value="0" data-i18n="general.visible" {{- if eq $pattern.DenyPolicy 0}} selected{{- end}}>Visible</option>
|
|
<option value="1" data-i18n="general.hidden" {{- if eq $pattern.DenyPolicy 1}} selected{{- end}}>Hidden</option>
|
|
</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>
|
|
</div>
|
|
{{- else}}
|
|
<div data-repeater-item>
|
|
<div class="form-group row">
|
|
<div class="col-md-4 mt-3 mt-md-8">
|
|
<input data-i18n="[placeholder]filters.directory_path_help" type="text" class="form-control" name="pattern_path" value="" />
|
|
</div>
|
|
<div class="col-md-3 mt-3 mt-md-8">
|
|
<input type="text" class="form-control" name="patterns" placeholder="*.png,*.zip" value="" />
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<select name="pattern_type" class="form-select select-repetear select-first" data-hide-search="true">
|
|
<option value="denied" data-i18n="general.denied">Denied</option>
|
|
<option value="allowed" data-i18n="general.allowed">Allowed</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<select name="pattern_policy" class="form-select select-repetear select-first" data-hide-search="true">
|
|
<option value="0" data-i18n="general.visible">Visible</option>
|
|
<option value="1" data-i18n="general.hidden">Hidden</option>
|
|
</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>
|
|
</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>
|
|
|
|
<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>
|
|
</div>
|
|
</div>
|
|
|
|
<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}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idLoginMethods" data-i18n="filters.denied_login_methods" class="col-md-3 col-form-label">
|
|
Denied protocols
|
|
</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}}
|
|
</select>
|
|
<div id="idLoginMethodsHelp" data-i18n="filters.denied_login_methods_help" class="form-text">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
{{end}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<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}}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</div>
|
|
</div>
|
|
|
|
<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"
|
|
rows="3">{{.User.GetDeniedIPAsString}}</textarea>
|
|
<div id="idAllowedIPHelp" class="form-text" data-i18n="general.ip_mask_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<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">
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idQuotaSize" data-i18n="virtual_folders.quota_size" class="col-md-3 col-form-label">Quota size</label>
|
|
<div class="col-md-3">
|
|
<input id="idQuotaSize" type="text" class="form-control" name="quota_size" value="{{HumanizeBytes .User.QuotaSize}}" aria-describedby="idQuotaSizeHelp" />
|
|
<div id="idQuotaSizeHelp" class="form-text" data-i18n="virtual_folders.quota_size_help"></div>
|
|
</div>
|
|
<div class="col-md-1"></div>
|
|
<label for="idQuotaFiles" data-i18n="virtual_folders.quota_files" class="col-md-2 col-form-label">Quota files</label>
|
|
<div class="col-md-3">
|
|
<input id="idQuotaFiles" type="number" min="0" class="form-control" name="quota_files" value="{{.User.QuotaFiles}}" aria-describedby="idQuotaFilesHelp" />
|
|
<div id="idQuotaFilesHelp" class="form-text" data-i18n="general.zero_no_limit_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idMaxUploadSize" data-i18n="filters.max_upload_size" class="col-md-3 col-form-label">Max file upload size</label>
|
|
<div class="col-md-9">
|
|
<input id="idMaxUploadSize" type="text" class="form-control" name="max_upload_file_size" value="{{HumanizeBytes .User.Filters.MaxUploadFileSize}}" aria-describedby="idMaxUploadSizeHelp" />
|
|
<div id="idMaxUploadSizeHelp" class="form-text" data-i18n="filters.max_upload_size_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idUploadBandwidth" data-i18n="filters.upload_bandwidth" class="col-md-3 col-form-label">Bandwidth UL (KB/s)</label>
|
|
<div class="col-md-3">
|
|
<input id="idUploadBandwidth" type="number" min="0" class="form-control" name="upload_bandwidth" value="{{.User.UploadBandwidth}}" aria-describedby="idUploadBandwidthHelp" />
|
|
<div id="idUploadBandwidthHelp" class="form-text" data-i18n="general.zero_no_limit_help"></div>
|
|
</div>
|
|
<div class="col-md-1"></div>
|
|
<label for="idDownloadBandwidth" data-i18n="filters.download_bandwidth" class="col-md-2 col-form-label">Bandwidth DL (KB/s)</label>
|
|
<div class="col-md-3">
|
|
<input id="idDownloadBandwidth" type="number" min="0" class="form-control" name="download_bandwidth" value="{{.User.DownloadBandwidth}}" aria-describedby="idDownloadBandwidthHelp" />
|
|
<div id="idDownloadBandwidthHelp" class="form-text" data-i18n="general.zero_no_limit_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mt-10">
|
|
<div class="card-header bg-light">
|
|
<h3 data-i18n="filters.src_bandwidth_limit" class="card-title section-title-inner">Per-source bandwidth speed limits</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<div id="src_bandwidth_limits">
|
|
<div class="form-group">
|
|
<div data-repeater-list="src_bandwidth_limits">
|
|
{{- range $idx, $bwLimit := .User.Filters.BandwidthLimits -}}
|
|
<div data-repeater-item>
|
|
<div class="form-group row">
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
<textarea class="form-control" name="bandwidth_limit_sources" rows="4">{{$bwLimit.GetSourcesAsString}}</textarea>
|
|
<div class="form-text" data-i18n="general.ip_mask_help"></div>
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<input type="number" min="0" class="form-control" name="upload_bandwidth_source" value="{{$bwLimit.UploadBandwidth}}" />
|
|
<div class="form-text" data-i18n="filters.upload_bandwidth_help"></div>
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<input type="number" min="0" class="form-control" name="download_bandwidth_source" value="{{$bwLimit.DownloadBandwidth}}" />
|
|
<div class="form-text" data-i18n="filters.download_bandwidth_help"></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>
|
|
{{- else}}
|
|
<div data-repeater-item>
|
|
<div class="form-group row">
|
|
<div class="col-md-7 mt-3 mt-md-8">
|
|
<textarea class="form-control" name="bandwidth_limit_sources" rows="4"></textarea>
|
|
<div class="form-text" data-i18n="general.ip_mask_help"></div>
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<input type="number" min="0" class="form-control" name="upload_bandwidth_source" value="" />
|
|
<div class="form-text" data-i18n="filters.upload_bandwidth_help"></div>
|
|
</div>
|
|
<div class="col-md-2 mt-3 mt-md-8">
|
|
<input type="number" min="0" class="form-control" name="download_bandwidth_source" value="" />
|
|
<div class="form-text" data-i18n="filters.download_bandwidth_help"></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>
|
|
{{- 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>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idTransferUL" data-i18n="filters.upload_data_transfer" class="col-md-3 col-form-label">Upload data transfer (MB)</label>
|
|
<div class="col-md-3">
|
|
<input id="idTransferUL" type="number" min="0" class="form-control" name="upload_data_transfer" value="{{.User.UploadDataTransfer}}" aria-describedby="idTransferULHelp" />
|
|
<div id="idTransferULHelp" class="form-text" data-i18n="filters.upload_data_transfer_help"></div>
|
|
</div>
|
|
<div class="col-md-1"></div>
|
|
<label for="idTransferDL" data-i18n="filters.download_data_transfer" class="col-md-2 col-form-label">Download data transfer (MB)</label>
|
|
<div class="col-md-3">
|
|
<input id="idTransferDL" type="number" min="0" class="form-control" name="download_data_transfer" value="{{.User.DownloadDataTransfer}}" aria-describedby="idTransferDLhHelp" />
|
|
<div id="idTransferDLhHelp" class="form-text" data-i18n="filters.download_data_transfer_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idTransferTotal" data-i18n="filters.total_data_transfer" class="col-md-3 col-form-label">Total data transfer (MB)</label>
|
|
<div class="col-md-9">
|
|
<input id="idTransferTotal" type="number" min="0" class="form-control" name="total_data_transfer" value="{{.User.TotalDataTransfer}}" aria-describedby="idTransferTotalHelp" />
|
|
<div id="idTransferTotalHelp" class="form-text" data-i18n="filters.total_data_transfer_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<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">
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idStartDirectory" data-i18n="filters.start_directory" class="col-md-3 col-form-label">Start directory</label>
|
|
<div class="col-md-9">
|
|
<input id="idStartDirectory" type="text" class="form-control" name="start_directory" value="{{.User.Filters.StartDirectory}}" aria-describedby="idStartDirectoryHelp" />
|
|
<div id="idStartDirectoryHelp" class="form-text" data-i18n="filters.start_directory_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idTLSUsername" data-i18n="filters.tls_username" class="col-md-3 col-form-label">TLS username</label>
|
|
<div class="col-md-9">
|
|
<select id="idTLSUsername" name="tls_username" class="form-select" data-control="i18n-select2" data-hide-search="true" aria-describedby="idTLSUsernameHelp">
|
|
<option value="" {{if or (eq .User.Filters.TLSUsername "None") (eq .User.Filters.TLSUsername "") }}selected{{end}}>---</option>
|
|
<option value="CommonName" {{if eq .User.Filters.TLSUsername "CommonName" }}selected{{end}}>Common Name</option>
|
|
</select>
|
|
<div id="idTLSUsernameHelp" class="form-text" data-i18n="filters.tls_username_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idFTPSecurity" data-i18n="filters.ftp_security" class="col-md-3 col-form-label">FTP security</label>
|
|
<div class="col-md-9">
|
|
<select id="idFTPSecurity" name="ftp_security" class="form-select" data-control="i18n-select2" data-hide-search="true" aria-describedby="idFTPSecurityHelp">
|
|
<option value="" data-i18n="general.global_settings" {{if eq .User.Filters.FTPSecurity 0 }}selected{{end}}>Server settings</option>
|
|
<option value="1" data-i18n="general.mandatory_encryption" {{if eq .User.Filters.FTPSecurity 1 }}selected{{end}}>Mandatory encryption</option>
|
|
</select>
|
|
<div id="idFTPSecurityHelp" class="form-text" data-i18n="filters.ftp_security_help"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row mt-10">
|
|
<label for="idHooks" data-i18n="filters.hooks" class="col-md-3 col-form-label">Hooks</label>
|
|
<div class="col-md-9">
|
|
<select id="idHooks" name="hooks" class="form-select" data-control="i18n-select2" data-hide-search="true" data-close-on-select="false" multiple>
|
|
<option value="external_auth_disabled" data-i18n="filters.hook_ext_auth_disabled" {{if .User.Filters.Hooks.ExternalAuthDisabled}}selected{{end}}>
|
|
External auth disabled
|
|
</option>
|
|
<option value="pre_login_disabled" data-i18n="filters.hook_pre_login_disabled" {{if .User.Filters.Hooks.PreLoginDisabled}}selected{{end}}>
|
|
Pre-login disabled
|
|
</option>
|
|
<option value="check_password_disabled" data-i18n="filters.hook_check_password_disabled" {{if .User.Filters.Hooks.CheckPasswordDisabled}}selected{{end}}>
|
|
Check password disabled
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<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}}" />
|
|
</div>
|
|
<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}}" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row align-items-center mt-10">
|
|
<label data-i18n="filters.is_anonymous" class="col-md-3 col-form-label" for="idAnonymous">Is Anonymous</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="idAnonymous" name="is_anonymous" {{if .User.Filters.IsAnonymous}}checked{{end}}/>
|
|
<label data-i18n="filters.is_anonymous_help" class="form-check-label fw-semibold text-gray-800" for="idAnonymous">
|
|
Anonymous users are supported for FTP and WebDAV protocols and have read-only access
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row align-items-center mt-10">
|
|
<label data-i18n="filters.disable_fs_checks" class="col-md-3 col-form-label" for="idDisableFsChecks">Disable filesystem checks</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="idDisableFsChecks" name="disable_fs_checks" {{if .User.Filters.DisableFsChecks}}checked{{end}}/>
|
|
<label data-i18n="filters.disable_fs_checks_help" class="form-check-label fw-semibold text-gray-800" for="idDisableFsChecks">
|
|
Disable checks for existence and automatic creation of home directory and virtual folders
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row align-items-center mt-10">
|
|
<label data-i18n="general.api_key_auth" class="col-md-3 col-form-label" for="idAllowAPIKeyAuth">API key authentication</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="idAllowAPIKeyAuth" name="allow_api_key_auth" {{if .User.Filters.AllowAPIKeyAuth}}checked{{end}}/>
|
|
<label data-i18n="filters.api_key_auth_help" class="form-check-label fw-semibold text-gray-800" for="idAllowAPIKeyAuth">
|
|
Allow to impersonate this user, in REST API, with an API key
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
<div class="col-md-9">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- 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>
|
|
</div>
|
|
</div>
|
|
{{- 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}}
|
|
<button type="submit" id="form_generate_submit" class="btn btn-primary px-10 me-10" name="form_action" value="export_from_template">
|
|
<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>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
{{- 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(){
|
|
onFilesystemChanged('{{.User.FsConfig.Provider.Name}}');
|
|
|
|
$('#idFilesystem').on("change", function(){
|
|
onFilesystemChanged(this.value);
|
|
});
|
|
});
|
|
|
|
$(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');
|
|
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);
|
|
}
|
|
}
|
|
let submitButton = document.querySelector('#form_submit');
|
|
submitButton.setAttribute('data-kt-indicator', 'on');
|
|
submitButton.disabled = true;
|
|
//{{- if eq .Mode 3}}
|
|
let generateButton = document.querySelector('#form_generate_submit');
|
|
generateButton.setAttribute('data-kt-indicator', 'on');
|
|
generateButton.disabled = true;
|
|
//{{- end}}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
{{- end}}
|