mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
feat: implement automatic synchronization for ldap users (#371)
Signed-off-by: Товарищ программист <2962928213@qq.com>
This commit is contained in:

committed by
GitHub

parent
4ca5f4b196
commit
f43d01c5c2
@ -151,6 +151,9 @@ func (c *ApiController) AddLdap() {
|
||||
if affected {
|
||||
resp.Data2 = ldap
|
||||
}
|
||||
if ldap.AutoSync != 0 {
|
||||
object.GetLdapAutoSynchronizer().StartAutoSync(ldap.Id)
|
||||
}
|
||||
|
||||
c.Data["json"] = resp
|
||||
c.ServeJSON()
|
||||
@ -172,6 +175,9 @@ func (c *ApiController) UpdateLdap() {
|
||||
if affected {
|
||||
resp.Data2 = ldap
|
||||
}
|
||||
if ldap.AutoSync != 0 {
|
||||
object.GetLdapAutoSynchronizer().StartAutoSync(ldap.Id)
|
||||
}
|
||||
|
||||
c.Data["json"] = resp
|
||||
c.ServeJSON()
|
||||
@ -187,6 +193,7 @@ func (c *ApiController) DeleteLdap() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
object.GetLdapAutoSynchronizer().StopAutoSync(ldap.Id)
|
||||
c.Data["json"] = wrapActionResponse(object.DeleteLdap(&ldap))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
Reference in New Issue
Block a user