mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
Merge pull request #8238 from swordqiu/hotfix/qj-ldap-sync-not-update-email-phone
fix: ldap sync not update user's phone and email
This commit is contained in:
@@ -145,6 +145,8 @@ func syncScopeResourceCount(ctx context.Context, regionId string, serviceId stri
|
||||
ownerList = append(ownerList, scopeRes.OwnerId)
|
||||
}
|
||||
|
||||
scopeRes.SetModelManager(models.ScopeResourceManager, &scopeRes)
|
||||
|
||||
err := models.ScopeResourceManager.TableSpec().InsertOrUpdate(ctx, &scopeRes)
|
||||
if err != nil {
|
||||
log.Errorf("table insert error %s", err)
|
||||
|
||||
@@ -241,13 +241,13 @@ func (self *SLDAPDriver) syncUserDB(ctx context.Context, ui SUserInfo, domainId
|
||||
// } else {
|
||||
// user.Enabled = tristate.False
|
||||
// }
|
||||
if val, ok := ui.Extra["email"]; ok && len(val) > 0 && len(user.Email) > 0 {
|
||||
if val, ok := ui.Extra["email"]; ok && len(val) > 0 && len(user.Email) == 0 {
|
||||
user.Email = val
|
||||
}
|
||||
if val, ok := ui.Extra["displayname"]; ok && len(val) > 0 && len(user.Displayname) > 0 {
|
||||
if val, ok := ui.Extra["displayname"]; ok && len(val) > 0 && len(user.Displayname) == 0 {
|
||||
user.Displayname = val
|
||||
}
|
||||
if val, ok := ui.Extra["mobile"]; ok && len(val) > 0 && len(user.Mobile) > 0 {
|
||||
if val, ok := ui.Extra["mobile"]; ok && len(val) > 0 && len(user.Mobile) == 0 {
|
||||
user.Mobile = val
|
||||
}
|
||||
})
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
@@ -222,6 +223,7 @@ func verifyCommon(ctx context.Context, w http.ResponseWriter, tokenStr string) (
|
||||
token := SAuthToken{}
|
||||
err := token.ParseFernetToken(tokenStr)
|
||||
if err != nil {
|
||||
log.Errorf("ParseFernetToken %s fail: %s", tokenStr, err)
|
||||
return nil, httperrors.NewInvalidCredentialError("invalid token")
|
||||
}
|
||||
return &token, nil
|
||||
|
||||
Reference in New Issue
Block a user