if weblog is offline, display error message as rss item instead of 404 http error.

This commit is contained in:
Tobi Schäfer 2001-10-22 09:45:13 +00:00
parent 4b5b1bd851
commit 65d50f8439

View file

@ -1,10 +1,10 @@
if (!this.online)
res.redirect("notfound");
res.contentType = "text/xml";
var base = "http://" + getProperty("server") + getProperty("baseURI");
var now = new Date();
var param1 = new Object();
if (this.online) {
var size = this.allstories.size();
var max = req.data.max ? req.data.max : 7;
if (max > size)
@ -20,6 +20,13 @@ for (var i=0; i<max; i++) {
items += this.renderSkinAsString("rssItem", param1);
}
}
}
else {
param1.itemLink = "";
param1.itemTitle = encodeXml("Access denied");
param1.itemDescription = encodeXml("This weblog is offline.");
items = this.renderSkinAsString("rssItem", param1);
}
var param2 = new Object();
param2.title = encodeXml(this.title);
@ -33,5 +40,4 @@ param2.webMaster = this.creator.email;
param2.language = this.language;
param2.items = items;
res.contentType = "text/xml";
this.renderSkin("rssChannel", param2);