mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
removed unused methods
these methods were used in the old UIs Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -435,19 +434,6 @@ func (a *Admin) validate() error {
|
||||
return a.validateGroups()
|
||||
}
|
||||
|
||||
// GetGroupsAsString returns the user's groups as a string
|
||||
func (a *Admin) GetGroupsAsString() string {
|
||||
if len(a.Groups) == 0 {
|
||||
return ""
|
||||
}
|
||||
var groups []string
|
||||
for _, g := range a.Groups {
|
||||
groups = append(groups, g.Name)
|
||||
}
|
||||
sort.Strings(groups)
|
||||
return strings.Join(groups, ",")
|
||||
}
|
||||
|
||||
// CheckPassword verifies the admin password
|
||||
func (a *Admin) CheckPassword(password string) (bool, error) {
|
||||
if config.PasswordCaching {
|
||||
@@ -579,19 +565,6 @@ func (a *Admin) HasPermission(perm string) bool {
|
||||
return util.Contains(a.Permissions, perm)
|
||||
}
|
||||
|
||||
// GetPermissionsAsString returns permission as string
|
||||
func (a *Admin) GetPermissionsAsString() string {
|
||||
return strings.Join(a.Permissions, ", ")
|
||||
}
|
||||
|
||||
// GetLastLoginAsString returns the last login as string
|
||||
func (a *Admin) GetLastLoginAsString() string {
|
||||
if a.LastLogin > 0 {
|
||||
return util.GetTimeFromMsecSinceEpoch(a.LastLogin).UTC().Format(iso8601UTCFormat)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetAllowedIPAsString returns the allowed IP as comma separated string
|
||||
func (a *Admin) GetAllowedIPAsString() string {
|
||||
return strings.Join(a.Filters.AllowList, ",")
|
||||
|
||||
Reference in New Issue
Block a user