aboutsummaryrefslogtreecommitdiffhomepage
path: root/ui/form
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-06-19 22:58:29 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-06-19 22:58:29 -0700
commitbddca15b69692bd055c507f2469e68dca1e56098 (patch)
tree913989e170cc3ac46558c682f8ec10813a0ae3c5 /ui/form
parent261695c14c2d768f392cfb774e7940660edaa3d9 (diff)
Add new fields for feed username/password
Diffstat (limited to 'ui/form')
-rw-r--r--ui/form/feed.go6
-rw-r--r--ui/form/subscription.go4
2 files changed, 10 insertions, 0 deletions
diff --git a/ui/form/feed.go b/ui/form/feed.go
index 896a6d7..1a3766b 100644
--- a/ui/form/feed.go
+++ b/ui/form/feed.go
@@ -21,6 +21,8 @@ type FeedForm struct {
RewriteRules string
Crawler bool
CategoryID int64
+ Username string
+ Password string
}
// ValidateModification validates FeedForm fields
@@ -42,6 +44,8 @@ func (f FeedForm) Merge(feed *model.Feed) *model.Feed {
feed.Crawler = f.Crawler
feed.ParsingErrorCount = 0
feed.ParsingErrorMsg = ""
+ feed.Username = f.Username
+ feed.Password = f.Password
return feed
}
@@ -60,5 +64,7 @@ func NewFeedForm(r *http.Request) *FeedForm {
RewriteRules: r.FormValue("rewrite_rules"),
Crawler: r.FormValue("crawler") == "1",
CategoryID: int64(categoryID),
+ Username: r.FormValue("username"),
+ Password: r.FormValue("password"),
}
}
diff --git a/ui/form/subscription.go b/ui/form/subscription.go
index 7d2caaf..015f60f 100644
--- a/ui/form/subscription.go
+++ b/ui/form/subscription.go
@@ -16,6 +16,8 @@ type SubscriptionForm struct {
URL string
CategoryID int64
Crawler bool
+ Username string
+ Password string
}
// Validate makes sure the form values are valid.
@@ -38,5 +40,7 @@ func NewSubscriptionForm(r *http.Request) *SubscriptionForm {
URL: r.FormValue("url"),
Crawler: r.FormValue("crawler") == "1",
CategoryID: int64(categoryID),
+ Username: r.FormValue("username"),
+ Password: r.FormValue("password"),
}
}