transform email addresses to lower case in ldap sync (#14)

This commit is contained in:
Christoph Haas 2021-04-22 20:41:30 +02:00
parent e052f400aa
commit 97edd103be

View File

@ -1,6 +1,7 @@
package server package server
import ( import (
"strings"
"time" "time"
"github.com/h44z/wg-portal/internal/ldap" "github.com/h44z/wg-portal/internal/ldap"
@ -117,7 +118,7 @@ func (s Server) UserChangedInLdap(user *users.User, ldapData *ldap.RawLdapData)
if user.Lastname != ldapData.Attributes[s.config.LDAP.LastNameAttribute] { if user.Lastname != ldapData.Attributes[s.config.LDAP.LastNameAttribute] {
return true return true
} }
if user.Email != ldapData.Attributes[s.config.LDAP.EmailAttribute] { if user.Email != strings.ToLower(ldapData.Attributes[s.config.LDAP.EmailAttribute]) {
return true return true
} }
if user.Phone != ldapData.Attributes[s.config.LDAP.PhoneAttribute] { if user.Phone != ldapData.Attributes[s.config.LDAP.PhoneAttribute] {