|
@@ -337,8 +337,9 @@ func (ldap *ldapHandler) SynchronizeUserFromLDAP() error {
|
|
|
//functions basically same as arozos's original function
|
|
|
func (ldap *ldapHandler) HandleLoginPage(w http.ResponseWriter, r *http.Request) {
|
|
|
checkLDAPenabled := ldap.readSingleConfig("enabled")
|
|
|
- if checkLDAPenabled == "true" {
|
|
|
+ if checkLDAPenabled == "false" {
|
|
|
common.SendTextResponse(w, "LDAP not enabled.")
|
|
|
+ return
|
|
|
}
|
|
|
//load the template from file and inject necessary variables
|
|
|
red, _ := common.Mv(r, "redirect", false)
|
|
@@ -364,8 +365,9 @@ func (ldap *ldapHandler) HandleLoginPage(w http.ResponseWriter, r *http.Request)
|
|
|
|
|
|
func (ldap *ldapHandler) HandleNewPasswordPage(w http.ResponseWriter, r *http.Request) {
|
|
|
checkLDAPenabled := ldap.readSingleConfig("enabled")
|
|
|
- if checkLDAPenabled == "true" {
|
|
|
+ if checkLDAPenabled == "false" {
|
|
|
common.SendTextResponse(w, "LDAP not enabled.")
|
|
|
+ return
|
|
|
}
|
|
|
//get the parameter from the request
|
|
|
acc, err := common.Mv(r, "username", false)
|
|
@@ -404,8 +406,9 @@ func (ldap *ldapHandler) HandleNewPasswordPage(w http.ResponseWriter, r *http.Re
|
|
|
|
|
|
func (ldap *ldapHandler) HandleLogin(w http.ResponseWriter, r *http.Request) {
|
|
|
checkLDAPenabled := ldap.readSingleConfig("enabled")
|
|
|
- if checkLDAPenabled == "true" {
|
|
|
+ if checkLDAPenabled == "false" {
|
|
|
common.SendTextResponse(w, "LDAP not enabled.")
|
|
|
+ return
|
|
|
}
|
|
|
//Get username from request using POST mode
|
|
|
username, err := common.Mv(r, "username", true)
|
|
@@ -468,8 +471,9 @@ func (ldap *ldapHandler) HandleLogin(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
func (ldap *ldapHandler) HandleSetPassword(w http.ResponseWriter, r *http.Request) {
|
|
|
checkLDAPenabled := ldap.readSingleConfig("enabled")
|
|
|
- if checkLDAPenabled == "true" {
|
|
|
+ if checkLDAPenabled == "false" {
|
|
|
common.SendTextResponse(w, "LDAP not enabled.")
|
|
|
+ return
|
|
|
}
|
|
|
//get paramters from request
|
|
|
username, err := common.Mv(r, "username", true)
|