common.go
func (l *LoginShare) Request(w http.ResponseWriter, r *http.Request) {
	lsr, err := l.validateRequest(r)
	if err != nil {
		w.WriteHeader(http.StatusBadRequest)
		log.Printf("invalid loginshare request from %s", r.RemoteAddr)
		return
	}

	if l.interfaceAllowed(lsr.Interface) == false {
		w.WriteHeader(http.StatusForbidden)
		log.Printf("loginshare request from %s for unpermitted interface", r.RemoteAddr)
		return
	}

	w.Header().Add("Content-Type", "application/xml")
	xw := xml.NewEncoder(w)
	resp, err := l.OnNewAuth(lsr)
	if err != nil {
		log.Printf("loginshare request from %s failed: %s", r.RemoteAddr, err)
		resp.StaffRecord = Staff{} // make sure we don't give up any info if partially populated
		resp.Result = 0
		resp.Message = err.Error()
		xw.Encode(resp)
		return
	}

	xw.Encode(resp)
	return
}
func (l *LoginShare) Request(w http.ResponseWriter, r *http.Request) {
	lsr, err := l.validateRequest(r)
	if err != nil {
		w.WriteHeader(http.StatusBadRequest)
		log.Printf("invalid loginshare request from %s", r.RemoteAddr)
		return
	}

	if l.interfaceAllowed(lsr.Interface) == false {
		w.WriteHeader(http.StatusForbidden)
		log.Printf("loginshare request from %s for unpermitted interface", r.RemoteAddr)
		return
	}

	w.Header().Add("Content-Type", "application/xml")
	xw := xml.NewEncoder(w)
	resp, err := l.OnNewAuth(lsr)
	if err != nil {
		log.Printf("loginshare request from %s failed: %s", r.RemoteAddr, err)
		resp.StaffRecord = Staff{} // make sure we don't give up any info if partially populated
		resp.Result = 0
		resp.Message = err.Error()
		xw.Encode(resp)
		return
	}

	xw.Encode(resp)
	return
}
// Request implements the http.Handler interface to provide a drop-in Loginshare
// request/response handler