Skip to content

Commit

Permalink
Add hidden settings to prevent read file
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Jul 8, 2019
1 parent 090a24c commit 0d1adf8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Grand.Core/Domain/Common/CommonSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,12 @@ public CommonSettings()
/// Gets or sets to edit product where auction ended
/// </summary>
public bool AllowEditProductEndedAuction { get; set; }

/// <summary>
/// Gets or sets - allow user to read "let's encrypted file"
/// </summary>
public bool AllowToReadLetsEncryptFile { get; set; }


}
}
10 changes: 10 additions & 0 deletions Grand.Web/Controllers/LetsEncryptController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Grand.Core;
using Grand.Core.Domain.Common;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.IO;
Expand All @@ -8,8 +9,17 @@ namespace Grand.Web.Controllers
[AllowAnonymous]
public partial class LetsEncryptController : Controller
{
private readonly CommonSettings _commonSettings;

public LetsEncryptController(CommonSettings commonSettings)
{
_commonSettings = commonSettings;
}
public virtual IActionResult Index(string fileName)
{
if(!_commonSettings.AllowToReadLetsEncryptFile)
return Content("");

if (fileName == null)
return Content("");

Expand Down

0 comments on commit 0d1adf8

Please sign in to comment.