Allow importer to suspend inactive users
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user