3
0

Allow importer to suspend inactive users

This commit is contained in:
Tomaž Jerman
2020-07-17 14:02:42 +02:00
parent 7536d37021
commit 88e4f90cb8
+9
View File
@@ -35,6 +35,8 @@ func importUsers(ctx context.Context, is *types.ImportSource, ns *cct.Namespace)
}
ww.Write(header)
now := time.Now()
// create users
for {
looper:
@@ -100,6 +102,13 @@ func importUsers(ctx context.Context, is *types.ImportSource, ns *cct.Namespace)
if val == "1" {
goto looper
}
case "isactive":
if strings.ToLower(val) != "true" {
u.SuspendedAt = &now
} else {
u.SuspendedAt = nil
}
}
}