From 5719ce8f5d1f7d201949b93888f6a22e8c1c5480 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 2 Apr 2024 14:41:15 +1100 Subject: [PATCH] creating ldap user was not setting ldapuser flag --- controllers/auth.go | 1 + models/secret.go | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/controllers/auth.go b/controllers/auth.go index 8ca6a63..37c70af 100644 --- a/controllers/auth.go +++ b/controllers/auth.go @@ -124,6 +124,7 @@ func AddUser(c *gin.Context) { u := models.User{} u.UserName = input.UserName u.Password = input.Password + u.LdapUser = input.LdapUser // Determine which GroupId to save // Can be specified either by GroupName or GroupId in the request diff --git a/models/secret.go b/models/secret.go index 9f59079..e1edd97 100644 --- a/models/secret.go +++ b/models/secret.go @@ -176,13 +176,8 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) { r.User.UserName = r.UserUserName // For debugging purposes - debugPrint := utils.PrintStructContents(&r, 0) - log.Println(debugPrint) - - //log.Printf("SecretsGetAllowed performed debug print\n") - - // Append the secrets to the query output, don't decrypt the secrets (we didn't SELECT them anyway) - //secretResults = append(secretResults, r) + //debugPrint := utils.PrintStructContents(&r, 0) + //log.Println(debugPrint) // Use generics and the GetID() method on the UserSecret struct // to avoid adding this element to the results