mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 15:10:23 +00:00
WebAdmin: hide certs if they cannot be used
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
ae5ecbe909
commit
27e98b85ce
2 changed files with 5 additions and 1 deletions
|
@ -39,6 +39,7 @@ import (
|
|||
"github.com/drakkan/sftpgo/v2/internal/acme"
|
||||
"github.com/drakkan/sftpgo/v2/internal/common"
|
||||
"github.com/drakkan/sftpgo/v2/internal/dataprovider"
|
||||
"github.com/drakkan/sftpgo/v2/internal/ftpd"
|
||||
"github.com/drakkan/sftpgo/v2/internal/kms"
|
||||
"github.com/drakkan/sftpgo/v2/internal/logger"
|
||||
"github.com/drakkan/sftpgo/v2/internal/mfa"
|
||||
|
@ -46,6 +47,7 @@ import (
|
|||
"github.com/drakkan/sftpgo/v2/internal/smtp"
|
||||
"github.com/drakkan/sftpgo/v2/internal/util"
|
||||
"github.com/drakkan/sftpgo/v2/internal/vfs"
|
||||
"github.com/drakkan/sftpgo/v2/internal/webdavd"
|
||||
)
|
||||
|
||||
type userPageMode int
|
||||
|
@ -187,6 +189,7 @@ type userPage struct {
|
|||
Roles []dataprovider.Role
|
||||
CanImpersonate bool
|
||||
FsWrapper fsWrapper
|
||||
CanUseTLSCerts bool
|
||||
}
|
||||
|
||||
type adminPage struct {
|
||||
|
@ -962,6 +965,7 @@ func (s *httpdServer) renderUserPage(w http.ResponseWriter, r *http.Request, use
|
|||
Groups: groups,
|
||||
Roles: roles,
|
||||
CanImpersonate: os.Getuid() == 0,
|
||||
CanUseTLSCerts: ftpd.GetStatus().IsActive || webdavd.GetStatus().IsActive,
|
||||
FsWrapper: fsWrapper{
|
||||
Filesystem: user.FsConfig,
|
||||
IsUserPage: true,
|
||||
|
|
|
@ -210,7 +210,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-10">
|
||||
<div class="card mt-10 {{if not .CanUseTLSCerts}}d-none{{end}}">
|
||||
<div class="card-header bg-light">
|
||||
<h3 data-i18n="user.tls_certs" class="card-title section-title-inner">TLS certificates</h3>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue