diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-01-05 14:59:12 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-01-05 14:59:12 (GMT) |
commit | c9f434c9604bf564f02ba46e445b1ab08748adac (patch) | |
tree | f2ec2085715a01f2c900ba2837e1fa593d7e11ac /src/helsinki.at/rhimportd/ctrlWebSimple.go | |
parent | ff149324fb78e2cb0ae2484c79c052f38c27d4d2 (diff) |
streamlined the usage of rhimport.NewContext
Diffstat (limited to 'src/helsinki.at/rhimportd/ctrlWebSimple.go')
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlWebSimple.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSimple.go b/src/helsinki.at/rhimportd/ctrlWebSimple.go index 9a408ed..61daf0a 100644 --- a/src/helsinki.at/rhimportd/ctrlWebSimple.go +++ b/src/helsinki.at/rhimportd/ctrlWebSimple.go @@ -99,12 +99,13 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trust return } - username := reqdata.UserName + ctx = rhimport.NewContext(conf, rddb) if trusted { - username = r.Header.Get("X-Forwarded-User") + ctx.UserName = r.Header.Get("X-Forwarded-User") + } else { + ctx.UserName = reqdata.UserName + ctx.Password = reqdata.Password } - ctx = rhimport.NewContext(conf, rddb, username) - ctx.Password = reqdata.Password ctx.Trusted = trusted ctx.ShowId = reqdata.ShowId ctx.ClearShowCarts = reqdata.ClearShowCarts |