Integrate feedback.
This commit is contained in:
committed by
Ralf Haferkamp
parent
bea3ec6207
commit
3f39bb530e
@@ -84,12 +84,11 @@ services:
|
||||
OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-info}
|
||||
OCIS_LOG_COLOR: "${OCIS_LOG_COLOR:-false}"
|
||||
GRAPH_LOG_LEVEL: "debug"
|
||||
PROXY_TLS: "false" # do not use SSL between Traefik and oCIS
|
||||
# INSECURE: needed if oCIS / Traefik is using self generated certificates
|
||||
OCIS_INSECURE: "${INSECURE:-false}"
|
||||
# basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect)
|
||||
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-true}"
|
||||
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}"
|
||||
# admin user password
|
||||
volumes:
|
||||
- ocis-config:/etc/ocis
|
||||
|
||||
@@ -178,19 +178,21 @@ func (i *LDAP) DeleteUser(ctx context.Context, nameOrID string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Find all the groups that this user was a member of and remove it from there
|
||||
groupEntries, err := i.getLDAPGroupsByFilter(fmt.Sprintf("(%s=%s)", i.groupAttributeMap.member, e.DN), true, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, group := range groupEntries {
|
||||
logger.Debug().Str("group", group.DN).Str("user", e.DN).Msg("Cleaning up group membership")
|
||||
if !i.refintEnabled {
|
||||
// Find all the groups that this user was a member of and remove it from there
|
||||
groupEntries, err := i.getLDAPGroupsByFilter(fmt.Sprintf("(%s=%s)", i.groupAttributeMap.member, e.DN), true, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, group := range groupEntries {
|
||||
logger.Debug().Str("group", group.DN).Str("user", e.DN).Msg("Cleaning up group membership")
|
||||
|
||||
if mr, err := i.removeEntryByDNAndAttributeFromEntry(group, e.DN, i.groupAttributeMap.member); err == nil {
|
||||
if err = i.conn.Modify(mr); err != nil {
|
||||
// Errors when deleting the memberships are only logged as warnings but not returned
|
||||
// to the user as we already successfully deleted the users itself
|
||||
logger.Warn().Str("group", group.DN).Str("user", e.DN).Err(err).Msg("failed to remove member")
|
||||
if mr, err := i.removeEntryByDNAndAttributeFromEntry(group, e.DN, i.groupAttributeMap.member); err == nil {
|
||||
if err = i.conn.Modify(mr); err != nil {
|
||||
// Errors when deleting the memberships are only logged as warnings but not returned
|
||||
// to the user as we already successfully deleted the users itself
|
||||
logger.Warn().Str("group", group.DN).Str("user", e.DN).Err(err).Msg("failed to remove member")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -553,8 +555,7 @@ func (i *LDAP) renameMemberInGroup(ctx context.Context, group *ldap.Entry, oldMe
|
||||
var lerr *ldap.Error
|
||||
if errors.As(err, &lerr) {
|
||||
if lerr.ResultCode == ldap.LDAPResultNoSuchObject {
|
||||
groupID := group.GetEqualFoldAttributeValue(i.groupAttributeMap.id)
|
||||
logger.Warn().Str("group", groupID).Msg("Group no longer exists")
|
||||
logger.Warn().Str("group", group.DN).Msg("Group no longer exists")
|
||||
return nil
|
||||
} else if lerr.ResultCode == ldap.LDAPResultNoSuchAttribute {
|
||||
logger.Warn().
|
||||
|
||||
Reference in New Issue
Block a user