|
@@ -504,3 +504,21 @@ func (ldap *ldapHandler) HandleSetPassword(w http.ResponseWriter, r *http.Reques
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//CheckOAuth check if oauth is enabled
|
|
|
+func (ldap *ldapHandler) HandleCheckLDAP(w http.ResponseWriter, r *http.Request) {
|
|
|
+ enabledB := false
|
|
|
+ enabled := ldap.readSingleConfig("enabled")
|
|
|
+ if enabled == "true" {
|
|
|
+ enabledB = true
|
|
|
+ }
|
|
|
+
|
|
|
+ type returnFormat struct {
|
|
|
+ Enabled bool `json:"enabled"`
|
|
|
+ }
|
|
|
+ json, err := json.Marshal(returnFormat{Enabled: enabledB})
|
|
|
+ if err != nil {
|
|
|
+ common.SendErrorResponse(w, "Error occurred while marshalling JSON response")
|
|
|
+ }
|
|
|
+ common.SendJSONResponse(w, string(json))
|
|
|
+}
|