mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Add new fields for feed username/password
This commit is contained in:
parent
261695c14c
commit
bddca15b69
27 changed files with 203 additions and 68 deletions
|
@ -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"),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue