diff options
Diffstat (limited to 'src/helsinki.at/rhimportd')
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlTelnet.go | 2 | ||||
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlWebSimple.go | 9 | ||||
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlWebSocket.go | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlTelnet.go b/src/helsinki.at/rhimportd/ctrlTelnet.go index 3b703dd..da117f3 100644 --- a/src/helsinki.at/rhimportd/ctrlTelnet.go +++ b/src/helsinki.at/rhimportd/ctrlTelnet.go @@ -153,7 +153,7 @@ func telnetSet(c *telgo.Client, args []string, conf *rhimport.Config, rddb *rhim var ctx *rhimport.Context if c.UserData == nil { - c.UserData = rhimport.NewContext(conf, rddb, "") + c.UserData = rhimport.NewContext(conf, rddb) ctx = c.UserData.(*rhimport.Context) ctx.Trusted = false } else { 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 diff --git a/src/helsinki.at/rhimportd/ctrlWebSocket.go b/src/helsinki.at/rhimportd/ctrlWebSocket.go index 2345db7..5e970a1 100644 --- a/src/helsinki.at/rhimportd/ctrlWebSocket.go +++ b/src/helsinki.at/rhimportd/ctrlWebSocket.go @@ -193,7 +193,8 @@ func webSocketDone(res rhimport.Result, userdata interface{}) bool { } func (self *webSocketSession) startNewSession(reqdata *webSocketRequestData, conf *rhimport.Config, sessions *rhimport.SessionStoreChan) (int, string) { - ctx := rhimport.NewContext(conf, nil, reqdata.UserName) + ctx := rhimport.NewContext(conf, nil) + ctx.UserName = reqdata.UserName ctx.Password = reqdata.Password ctx.Trusted = false ctx.ShowId = reqdata.ShowId |