|
@@ -229,13 +229,17 @@ func (ldap *ldapHandler) convertGroup(ldapUser *ldap.Entry) UserAccount {
|
|
|
|
|
|
func (ldap *ldapHandler) TestConnection(w http.ResponseWriter, r *http.Request) {
|
|
func (ldap *ldapHandler) TestConnection(w http.ResponseWriter, r *http.Request) {
|
|
//marshall it and return the connection status
|
|
//marshall it and return the connection status
|
|
|
|
+ log.Println("EXCEC")
|
|
userList, err := ldap.getAllUser(10)
|
|
userList, err := ldap.getAllUser(10)
|
|
|
|
+ log.Println(userList)
|
|
if err != nil {
|
|
if err != nil {
|
|
empty, err := json.Marshal(syncorizeUserReturnInterface{})
|
|
empty, err := json.Marshal(syncorizeUserReturnInterface{})
|
|
if err != nil {
|
|
if err != nil {
|
|
common.SendErrorResponse(w, "Error while marshalling information")
|
|
common.SendErrorResponse(w, "Error while marshalling information")
|
|
|
|
+ return
|
|
}
|
|
}
|
|
common.SendJSONResponse(w, string(empty))
|
|
common.SendJSONResponse(w, string(empty))
|
|
|
|
+ return
|
|
}
|
|
}
|
|
returnJSON := syncorizeUserReturnInterface{Userinfo: userList, Length: len(userList), Error: ""}
|
|
returnJSON := syncorizeUserReturnInterface{Userinfo: userList, Length: len(userList), Error: ""}
|
|
accountJSON, err := json.Marshal(returnJSON)
|
|
accountJSON, err := json.Marshal(returnJSON)
|
|
@@ -243,8 +247,10 @@ func (ldap *ldapHandler) TestConnection(w http.ResponseWriter, r *http.Request)
|
|
empty, err := json.Marshal(syncorizeUserReturnInterface{})
|
|
empty, err := json.Marshal(syncorizeUserReturnInterface{})
|
|
if err != nil {
|
|
if err != nil {
|
|
common.SendErrorResponse(w, "Error while marshalling information")
|
|
common.SendErrorResponse(w, "Error while marshalling information")
|
|
|
|
+ return
|
|
}
|
|
}
|
|
common.SendJSONResponse(w, string(empty))
|
|
common.SendJSONResponse(w, string(empty))
|
|
|
|
+ return
|
|
}
|
|
}
|
|
common.SendJSONResponse(w, string(accountJSON))
|
|
common.SendJSONResponse(w, string(accountJSON))
|
|
}
|
|
}
|