Skip to content

Commit

Permalink
(*) Updated support for anonymous access.
Browse files Browse the repository at this point in the history
  • Loading branch information
nils committed Nov 25, 2015
1 parent a1295e6 commit b3a151c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,32 @@ protected void Page_Load(object sender, EventArgs e)
try
{
// Get previous page title and URL
SPSecurity.RunWithElevatedPrivileges(delegate()
SPSecurity.RunWithElevatedPrivileges(delegate
{
var idStr = HttpContext.Current.Request.QueryString["List"];
var idViewStr = HttpContext.Current.Request.QueryString["View"];
var fieldTitle = HttpContext.Current.Request.QueryString["T"];
var fieldAuthor = HttpContext.Current.Request.QueryString["A"];
var fieldDate = HttpContext.Current.Request.QueryString["D"];
var fieldBody = HttpContext.Current.Request.QueryString["B"];
var RelURL = HttpContext.Current.Request.QueryString["U"];
var web = SPContext.Current.Web;
var feed = new RssFeedDto();
if (PopulateFromList(feed, web, idStr, idViewStr, fieldTitle, fieldAuthor, fieldDate, fieldBody, RelURL))
using (SPSite site = new SPSite(SPContext.Current.Web.Url))
{
BindData(feed);
Response.AppendHeader("ETag", feed.ETag);
Response.AppendHeader("Last-Modified", feed.LastBuildDate.ToString());
Response.ContentType = "text/xml";
Response.ContentEncoding = Encoding.UTF8;
using (SPWeb web = site.OpenWeb())
{
var idStr = HttpContext.Current.Request.QueryString["List"];
var idViewStr = HttpContext.Current.Request.QueryString["View"];
var fieldTitle = HttpContext.Current.Request.QueryString["T"];
var fieldAuthor = HttpContext.Current.Request.QueryString["A"];
var fieldDate = HttpContext.Current.Request.QueryString["D"];
var fieldBody = HttpContext.Current.Request.QueryString["B"];
var relUrl = HttpContext.Current.Request.QueryString["U"];
var feed = new RssFeedDto();
if (PopulateFromList(feed, web, idStr, idViewStr, fieldTitle, fieldAuthor, fieldDate,
fieldBody,
relUrl))
{
BindData(feed);
Response.AppendHeader("ETag", feed.ETag);
Response.AppendHeader("Last-Modified", feed.LastBuildDate.ToString());
Response.ContentType = "text/xml";
Response.ContentEncoding = Encoding.UTF8;
}
}
}

});
}
catch (Exception ex)
Expand Down
Binary file modified bin/SPGenericListRSS.wsp
Binary file not shown.

0 comments on commit b3a151c

Please sign in to comment.