diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-07 16:16:40 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-08 00:34:53 (GMT) |
commit | a1b290f026011276f9c16f6af390a2aceb2f9ccc (patch) | |
tree | 2f7be9167b918b16c82d3f71f057a610f6ca749e /src/helsinki.at/rhimportd/ctrlWebSimple.go | |
parent | 6e5d14f4a2189dbc0f0404c398d11878e356ecd7 (diff) |
moved DB into seperate module
Diffstat (limited to 'src/helsinki.at/rhimportd/ctrlWebSimple.go')
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlWebSimple.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSimple.go b/src/helsinki.at/rhimportd/ctrlWebSimple.go index 8080514..f4c64ee 100644 --- a/src/helsinki.at/rhimportd/ctrlWebSimple.go +++ b/src/helsinki.at/rhimportd/ctrlWebSimple.go @@ -67,7 +67,7 @@ func webSimpleResponse(w http.ResponseWriter) { encoder.Encode(respdata) } -func webSimpleParseRequest(conf *rhimport.Config, trusted bool, r *http.Request) (ctx *rhimport.ImportContext, err error) { +func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RDDB, trusted bool, r *http.Request) (ctx *rhimport.ImportContext, err error) { decoder := json.NewDecoder(r.Body) var reqdata webSimpleRequestData @@ -80,7 +80,7 @@ func webSimpleParseRequest(conf *rhimport.Config, trusted bool, r *http.Request) if trusted { username = r.Header.Get("X-Forwarded-User") } - ctx = rhimport.NewImportContext(conf, username, reqdata.GroupName) + ctx = rhimport.NewImportContext(conf, rddb, username, reqdata.GroupName) ctx.Password = reqdata.Password ctx.Trusted = trusted ctx.Cart = reqdata.Cart @@ -93,12 +93,12 @@ func webSimpleParseRequest(conf *rhimport.Config, trusted bool, r *http.Request) return } -func webSimpleHandler(conf *rhimport.Config, trusted bool, w http.ResponseWriter, r *http.Request) { +func webSimpleHandler(conf *rhimport.Config, rddb *rhimport.RDDB, trusted bool, w http.ResponseWriter, r *http.Request) { rhdl.Printf("SimpleHandler: request for '%s'", html.EscapeString(r.URL.Path)) var ctx *rhimport.ImportContext var err error - if ctx, err = webSimpleParseRequest(conf, trusted, r); err != nil { + if ctx, err = webSimpleParseRequest(conf, rddb, trusted, r); err != nil { webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error()) return } |