prevent logging of error for personalized pages
This commit is contained in:
parent
66d07fbed3
commit
62ad99d0b6
|
@ -143,9 +143,8 @@ namespace Oqtane.Controllers
|
|||
{
|
||||
_logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized File Get Attempt {Name} For Folder {FolderId}", name, folderId);
|
||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||
file = null;
|
||||
}
|
||||
return file;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,8 +106,11 @@ namespace Oqtane.Controllers
|
|||
}
|
||||
else
|
||||
{
|
||||
_logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized Page Get Attempt {SiteId} {Path}", siteid, path);
|
||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||
if (page != null)
|
||||
{
|
||||
_logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized Page Get Attempt {SiteId} {Path}", siteid, path);
|
||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -177,8 +180,8 @@ namespace Oqtane.Controllers
|
|||
page = new Page();
|
||||
page.SiteId = parent.SiteId;
|
||||
page.ParentId = parent.PageId;
|
||||
page.Name = user.DisplayName != null ? user.DisplayName : user.Username;
|
||||
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(page.Name);
|
||||
page.Name = user.Username;
|
||||
page.Path = parent.Path + "/" + page.Name;
|
||||
page.Title = page.Name + " - " + parent.Name;
|
||||
page.Order = 0;
|
||||
page.IsNavigation = false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user