more checking when creating ldap group
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -26,6 +26,19 @@ func GroupGetByName(groupname string) (Group, error) {
|
||||
return g, nil
|
||||
}
|
||||
|
||||
// GroupGetByName queries the database for a group with the specified LDAP distinguishedName
|
||||
func GroupGetByLdapDn(ldapDn string) (Group, error) {
|
||||
var g Group
|
||||
|
||||
// Query database for matching group object
|
||||
err := db.QueryRowx("SELECT * FROM groups WHERE LdapGroup = 1 AND LdapDn = ?", ldapDn).StructScan(&g)
|
||||
if err != nil {
|
||||
return g, errors.New("group not found")
|
||||
}
|
||||
|
||||
return g, nil
|
||||
}
|
||||
|
||||
// GroupList returns a list of all groups in database
|
||||
func GroupList() ([]Group, error) {
|
||||
var results []Group
|
||||
|
Reference in New Issue
Block a user