Possible to check who is subscribing on what?

Vote:
 
All subscribers and subscriptions should be saved in a file somewhere. Possible to open this (eg in notepad) and get a quick overview of all users and their subscriptions? regs, Andreas
#13160
Mar 25, 2008 18:35
Vote:
 
using System; using EPiServer; using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.Filters; using EPiServer.Personalization; using EPiServer.PlugIn; using EPiServer.Security; namespace testsite.Plugins { [GuiPlugIn("AbonnentListe", "Hvem abonnerer på hva?", PlugInArea.AdminMenu, "~/Plugins/AbonnentListe.aspx")] public partial class AbonnentListe : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ListeTekst.Text = ""; SidCollection sids = GetAllUsers(); PageDataCollection sPages = GetSubscriberPages(); FindSubscriptions(sids, sPages); DataBind(); } private void FindSubscriptions(SidCollection sids, PageDataCollection sPages) { foreach (PageData page in sPages) { ListeTekst.Text += string.Format("{0} - {1}", page.PageName, page.LinkURL); foreach (UserSid sid in sids) { PersonalizedData pData = PersonalizedData.Load(sid.ID); SubscriptionInfo subInfo= new SubscriptionInfo(pData); if(subInfo.IsSubscribingTo(page.PageLink)) { ListeTekst.Text += String.Format("{0} {1}{2}{3}", sid.FirstName, sid.LastName, sid.Email, sid.Name); } } } } private static PageDataCollection GetSubscriberPages() { PageDataCollection oPages; PropertyCriteriaCollection col = new PropertyCriteriaCollection(); Statsbygg.Intranet.Custom.Library.CommonFunctions.addPropertyCriteria(col, "EPSUBSCRIBE", "true", PropertyDataType.Boolean, CompareCondition.Equal); oPages = EPiServer.Global.EPDataFactory.FindPagesWithCriteria(Global.EPConfig.StartPage, col, AccessLevel.Read); return oPages; } private static SidCollection GetAllUsers() { SidCollection subscribingSids = new SidCollection(); SidCollection foundUsers = UserSid.Search(SecurityIdentityType.AnyUserSid, false, null, null, null, null, null); foreach (UserSid sid in foundUsers) { subscribingSids.Add(sid); } return subscribingSids; } } }
#15482
Mar 25, 2008 18:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.