add support for http basic auth for calendars

This commit is contained in:
Robin Appelman
2016-09-08 17:36:30 +02:00
parent a2497d7564
commit 90207f9b68
5 changed files with 28 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ module.exports = NodeHelper.create({
socketNotificationReceived: function(notification, payload) {
if (notification === "ADD_CALENDAR") {
//console.log('ADD_CALENDAR: ');
this.createFetcher(payload.url, payload.fetchInterval, payload.maximumEntries, payload.maximumNumberOfDays);
this.createFetcher(payload.url, payload.fetchInterval, payload.maximumEntries, payload.maximumNumberOfDays, payload.user, payload.pass);
}
},
@@ -37,7 +37,7 @@ module.exports = NodeHelper.create({
* attribute reloadInterval number - Reload interval in milliseconds.
*/
createFetcher: function(url, fetchInterval, maximumEntries, maximumNumberOfDays) {
createFetcher: function(url, fetchInterval, maximumEntries, maximumNumberOfDays, user, pass) {
var self = this;
if (!validUrl.isUri(url)) {
@@ -48,7 +48,7 @@ module.exports = NodeHelper.create({
var fetcher;
if (typeof self.fetchers[url] === "undefined") {
console.log("Create new calendar fetcher for url: " + url + " - Interval: " + fetchInterval);
fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries, maximumNumberOfDays);
fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries, maximumNumberOfDays, user, pass);
fetcher.onReceive(function(fetcher) {
//console.log('Broadcast events.');