if test are hard :)
This commit is contained in:
4
httpd.go
4
httpd.go
@@ -120,8 +120,8 @@ func (h *HttpServer) ajaxHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
webuser := strings.Replace(r.TLS.PeerCertificates[0].Subject.CommonName, " ", "", -1)
|
||||
_, _, _, profilePath := h.ovpn.AuthLoop(h.minProfile, webuser, "", false)
|
||||
if inArray(h.neededProfiles, profilePath) {
|
||||
http.Error(w, fmt.Sprintf("You need on of %s profile", h.neededProfiles), 403)
|
||||
if !inArray(h.neededProfiles, profilePath) {
|
||||
http.Error(w, fmt.Sprintf("You need on of %s profile and you have %s", h.neededProfiles, profilePath), 403)
|
||||
return
|
||||
}
|
||||
log.Printf("%s is connected via the web interfaces\n", webuser)
|
||||
|
||||
Reference in New Issue
Block a user