func (h *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { user, _, err := authorizeSession(r, kSessionStore) if err == errNotLoggedIn { http_util.Redirect( w, r, http_util.NewUrl("/auth/login", "prev", r.URL.String()).String()) return } if err != nil { http_util.ReportError(w, "Error reading database.", err) return } logging.SetUserName(r, user.Name) h.ServeMux.ServeHTTP(w, r) }
func (v *view) EntryLink(id int64) *url.URL { return http_util.NewUrl( "/vsafe/single", "id", strconv.FormatInt(id, 10), "prev", v.Url.String()) }