From 8fec84c118846bd9995736a673b145595da9e14f Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 16 Jan 2024 15:18:42 +1100 Subject: [PATCH] another fix --- models/setup.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/setup.go b/models/setup.go index 7293111..7354ce9 100644 --- a/models/setup.go +++ b/models/setup.go @@ -275,6 +275,12 @@ func CreateTables() { } } + // Set any unassigned secrets to the default safe id + if _, err = db.Exec("UPDATE users SET LdapUser = 0 WHERE LdapUser is null;"); err != nil { + log.Printf("Error setting LdapUser flag to false for existing users : '%s'", err) + os.Exit(1) + } + // Remove LdapGroup column from roles table ldapCheck, _ := CheckColumnExists("roles", "LdapGroup") if ldapCheck {