|
|
@@ -1,5 +1,7 @@
|
|
|
-using GreenTree.Nachtragsmanagement.Core.Authentication;
|
|
|
+using GreenTree.Nachtragsmanagement.Core;
|
|
|
+using GreenTree.Nachtragsmanagement.Core.Authentication;
|
|
|
using GreenTree.Nachtragsmanagement.Services.Appendix;
|
|
|
+using GreenTree.Nachtragsmanagement.Services.Configuration;
|
|
|
using GreenTree.Nachtragsmanagement.Services.Deviation;
|
|
|
using GreenTree.Nachtragsmanagement.Services.Logging;
|
|
|
using GreenTree.Nachtragsmanagement.Services.Site;
|
|
|
@@ -21,6 +23,7 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
private readonly IAppendixService _appendixService;
|
|
|
private readonly IDeviationService _deviationService;
|
|
|
private readonly ISiteService _siteService;
|
|
|
+ private readonly IConfigurationService _configurationService;
|
|
|
private readonly ILogger _logger;
|
|
|
|
|
|
public GlobalController(
|
|
|
@@ -29,6 +32,7 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
IAppendixService appendixService,
|
|
|
IDeviationService deviationService,
|
|
|
ISiteService siteService,
|
|
|
+ IConfigurationService configurationService,
|
|
|
ILogger logger)
|
|
|
{
|
|
|
_userHelper = userHelper;
|
|
|
@@ -36,6 +40,7 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
_appendixService = appendixService;
|
|
|
_deviationService = deviationService;
|
|
|
_siteService = siteService;
|
|
|
+ _configurationService = configurationService;
|
|
|
_logger = logger;
|
|
|
}
|
|
|
|
|
|
@@ -112,8 +117,10 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
/// </summary>
|
|
|
/// <param name="cookies">Cookie names.</param>
|
|
|
/// <param name="sessionVariables">Session variable names.</param>
|
|
|
+ /// <param name="userConfigItemNames">Names of userConfigItems.</param>
|
|
|
[HttpPost]
|
|
|
- public ActionResult DeleteCookiesAndSessionVariables(string[] cookies, string[] sessionVariables)
|
|
|
+ public ActionResult DeleteCookiesSessionVariablesAndUserConfigs(string[] cookies, string[] sessionVariables,
|
|
|
+ string[] userConfigItemNames)
|
|
|
{
|
|
|
if (cookies != null && cookies.Length > 0)
|
|
|
{
|
|
|
@@ -140,6 +147,19 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (userConfigItemNames != null && userConfigItemNames.Length > 0)
|
|
|
+ {
|
|
|
+ var user = CommonHelper.UserContext().CurrentUser;
|
|
|
+
|
|
|
+ foreach (var userConfigItemName in userConfigItemNames)
|
|
|
+ {
|
|
|
+ var userConfigItem = _configurationService.GetUserConfigItemByNameAndUserId(userConfigItemName, user.Id);
|
|
|
+
|
|
|
+ if (userConfigItem != null)
|
|
|
+ _configurationService.DeleteUserConfigItem(userConfigItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return new JsonResult
|
|
|
{
|
|
|
Data = "success"
|