public void CreatePlaceWebsiteInvalid() { ManagedAccount a = new ManagedAccount(Session); try { a.Create("Test User", "testpassword", "*****@*****.**", DateTime.UtcNow, AdminSecurityContext); TransitPlaceWebsite ta = new TransitPlaceWebsite(); ta.Name = "My Website"; ta.Description = "Lots of details."; ta.Url = "<script>attack!</script>"; ta.PlaceId = _place.Instance.Id; ManagedPlaceWebsite m_w = new ManagedPlaceWebsite(Session); m_w.CreateOrUpdate(ta, a.GetSecurityContext()); } finally { a.Delete(AdminSecurityContext); } }
private void RunThumbnail(ISession session, PlaceWebsite website, ManagedSecurityContext sec) { try { ManagedPlaceWebsite m_website = new ManagedPlaceWebsite(session, website); if (IsDebug) { EventLogManager.WriteEntry(string.Format("Thumbnail service updating {0}: {1}, {2}", website.Id, website.Name, website.Url), EventLogEntryType.Information); } m_website.UpdateThumbnail(); } catch (ThreadAbortException) { throw; } catch (Exception) { website.Modified = DateTime.UtcNow; session.Save(website); } }