diff options
Diffstat (limited to 'server/ui/controller/integrations.go')
-rw-r--r-- | server/ui/controller/integrations.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/ui/controller/integrations.go b/server/ui/controller/integrations.go index a3e545e..ceac09a 100644 --- a/server/ui/controller/integrations.go +++ b/server/ui/controller/integrations.go @@ -5,7 +5,9 @@ package controller import ( + "crypto/md5" "errors" + "fmt" "github.com/miniflux/miniflux2/integration" "github.com/miniflux/miniflux2/model" @@ -38,6 +40,9 @@ func (c *Controller) ShowIntegrations(ctx *core.Context, request *core.Request, InstapaperEnabled: integration.InstapaperEnabled, InstapaperUsername: integration.InstapaperUsername, InstapaperPassword: integration.InstapaperPassword, + FeverEnabled: integration.FeverEnabled, + FeverUsername: integration.FeverUsername, + FeverPassword: integration.FeverPassword, }, })) } @@ -54,6 +59,12 @@ func (c *Controller) UpdateIntegration(ctx *core.Context, request *core.Request, integrationForm := form.NewIntegrationForm(request.Request()) integrationForm.Merge(integration) + if integration.FeverEnabled { + integration.FeverToken = fmt.Sprintf("%x", md5.Sum([]byte(integration.FeverUsername+":"+integration.FeverPassword))) + } else { + integration.FeverToken = "" + } + err = c.store.UpdateIntegration(integration) if err != nil { response.HTML().ServerError(err) |