aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <nilix@nilfm.cc>2022-06-03 18:53:35 -0600
committerDerek Stevens <nilix@nilfm.cc>2022-06-03 18:53:35 -0600
commit4d62b07047a2e6ffb2e1fb52310738ef56bd2a30 (patch)
tree7c4e8bff949a7fe7671e3a0f6187d0ed874dcf87
parentb364581c6e1868574150f2f1c414a8ffcb80695a (diff)
indentalUserDB: properly handle data with colonsv0.1.2
-rw-r--r--indentalUserDB/indentalUserDB.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/indentalUserDB/indentalUserDB.go b/indentalUserDB/indentalUserDB.go
index b67f53b..cdf73e9 100644
--- a/indentalUserDB/indentalUserDB.go
+++ b/indentalUserDB/indentalUserDB.go
@@ -185,7 +185,7 @@ func readDB(filePath string) (map[string]*auth.User, error) {
if strings.Contains(l, ":") {
kvp := strings.Split(l, ":")
k := strings.TrimSpace(kvp[0])
- v := strings.TrimSpace(kvp[1])
+ v := strings.TrimSpace(strings.Join(kvp[1:], ":"))
switch k {
case "pass":
pass = v
@@ -241,8 +241,8 @@ func writeDB(filePath string, users map[string]*auth.User) error {
user.Name,
user.Pass,
user.Session,
- user.LoginTime.Format(timeFmt),
- user.LastSeen.Format(timeFmt)))
+ user.LoginTime.UTC().Format(timeFmt),
+ user.LastSeen.UTC().Format(timeFmt)))
for k, v := range user.Data {
f.WriteString(fmt.Sprintf("\t\t%s: %s\n", k, v))
}