summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-01-08 00:55:14 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2016-01-08 01:04:36 (GMT)
commit9cd0b1783c0c90c68c4840b5d317e9135e07774e (patch)
treeeef67576318871139648e704039067949f520d9a
parent2e548139a6806bab10d1b184e0120dbcb1f99c1f (diff)
moved all db handling directly to context
-rw-r--r--core.go4
-rw-r--r--fetcher.go2
2 files changed, 5 insertions, 1 deletions
diff --git a/core.go b/core.go
index 8b6f982..98acd35 100644
--- a/core.go
+++ b/core.go
@@ -162,6 +162,10 @@ func (ctx *Context) getPassword(cached bool) (err error) {
return
}
+func (ctx *Context) CheckPassword() (bool, error) {
+ return ctx.db.CheckPassword(ctx.UserName, ctx.Password)
+}
+
func (ctx *Context) getGroupOfCart() (err error) {
ctx.GroupName, err = ctx.db.GetGroupOfCart(ctx.Cart)
return
diff --git a/fetcher.go b/fetcher.go
index e5fa29f..2d99be4 100644
--- a/fetcher.go
+++ b/fetcher.go
@@ -259,7 +259,7 @@ func fetcherInit() {
func checkPassword(ctx *Context, result *Result) (err error) {
ok := false
- if ok, err = ctx.db.CheckPassword(ctx.UserName, ctx.Password); err != nil {
+ if ok, err = ctx.CheckPassword(); err != nil {
return
}
if !ok {