protected void Page_Load(object sender, EventArgs e) { // Setup title CurrentMaster.Title.TitleText = GetString("ViewRequest.Title"); CurrentMaster.Title.TitleImage = GetImageUrl("Objects/__GLOBAL__/Object.png"); guid = QueryHelper.GetGuid("guid", Guid.Empty); if (guid != Guid.Empty) { // Find the root log RequestLog log = CMSFunctions.FindRequestLog(guid); if (log != null) { // Setup the logs RequestLogs logs = log.ParentLogs; plcLogs.Controls.Add(new LiteralControl("<div><strong> " + logs.RequestURL + "</strong> (" + logs.RequestTime.ToString("hh:MM:ss") + ")</div><br />")); logFiles.Log = logs.FilesLog; logCache.Log = logs.CacheLog; logOutput.Log = logs.OutputLog; logSec.Log = logs.SecurityLog; logMac.Log = logs.MacrosLog; logSQL.Log = logs.QueryLog; logState.Log = logs.ViewStateLog; logReq.Log = logs.RequestLog; logFarm.Log = logs.WebFarmLog; } } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); Visible = false; // Load the security log if (InitFromRequest) { ltlInfo.Visible = false; if (SettingsKeyProvider.DevelopmentMode) { Guid requestGuid = QueryHelper.GetGuid("requestguid", Guid.Empty); if (requestGuid != Guid.Empty) { RequestLog log = CMSFunctions.FindRequestLog(requestGuid); if (log != null) { var logs = log.ParentLogs; if (logs != null) { Log = logs.SecurityLog; } } } } if (Log == null) { return; } } if (Log != null) { // Get the log table DataTable dt = Log.LogTable; if (!DataHelper.DataSourceIsEmpty(dt)) { // Check the duplicity if (!dt.Columns.Contains("Duplicit")) { DataHelper.MarkDuplicitRows(dt, "Indent <= 0", "Duplicit", "UserName", "SecurityOperation", "Resource", "Name", "SiteName"); } Visible = true; int index = 1; gridSec.Columns[index++].HeaderText = GetString("SecurityLog.UserName"); gridSec.Columns[index++].HeaderText = GetString("SecurityLog.Operation"); gridSec.Columns[index++].HeaderText = GetString("SecurityLog.Result"); gridSec.Columns[index++].HeaderText = GetString("SecurityLog.Resource"); gridSec.Columns[index++].HeaderText = GetString("SecurityLog.Name"); gridSec.Columns[index++].HeaderText = GetString("SecurityLog.Site"); gridSec.Columns[index++].HeaderText = GetString("General.Context"); if (DisplayHeader) { ltlInfo.Text = "<div class=\"LogInfo\">" + GetString("SecurityLog.Info") + "</div>"; } gridSec.DataSource = dt; gridSec.DataBind(); } } }