From 29200ae418f00acadcad28f5e4efc54709db6428 Mon Sep 17 00:00:00 2001 From: ivanszabo Date: Mon, 14 Apr 2025 12:21:27 +0200 Subject: [PATCH] =?UTF-8?q?Jelsz=C3=B3=20m=C3=B3dos=C3=ADt=C3=A1sa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SystemController.cs | 43 ++++ .../Controllers/UserController.cs | 57 +++++ .../appsettings.Development.json | 3 + src/WorkFlowCheck.BL/Infra/DIConfig.cs | 1 + .../Services/Interfaces/ISystemService.cs | 13 ++ .../Services/Interfaces/IUserService.cs | 1 + .../Services/SystemService.cs | 49 ++++ src/WorkFlowCheck.BL/Services/UserService.cs | 49 +++- .../DTO/UserChangePassword2FADTO.cs | 29 +++ src/WorkFlowCheck.Web/Helpers/SystemHelper.cs | 42 ++++ .../Pages/Account/ChangePassword.cshtml | 212 ++++++++++++++++++ .../Pages/Account/ChangePassword.cshtml.cs | 98 ++++++++ .../Pages/Shared/_Layout.cshtml | 25 ++- .../Pages/_ViewImports.cshtml | 1 + src/WorkFlowCheck.Web/Program.cs | 6 + .../Services/Interfaces/IUserService.cs | 3 +- src/WorkFlowCheck.Web/Services/UserService.cs | 44 +++- src/WorkFlowCheck.Web/wwwroot/js/site.js | 9 +- 18 files changed, 676 insertions(+), 9 deletions(-) create mode 100644 src/WorkFlowCheck.API/Controllers/SystemController.cs create mode 100644 src/WorkFlowCheck.BL/Services/Interfaces/ISystemService.cs create mode 100644 src/WorkFlowCheck.BL/Services/SystemService.cs create mode 100644 src/WorkFlowCheck.Common/DTO/UserChangePassword2FADTO.cs create mode 100644 src/WorkFlowCheck.Web/Helpers/SystemHelper.cs create mode 100644 src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml create mode 100644 src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml.cs diff --git a/src/WorkFlowCheck.API/Controllers/SystemController.cs b/src/WorkFlowCheck.API/Controllers/SystemController.cs new file mode 100644 index 0000000..54a44e1 --- /dev/null +++ b/src/WorkFlowCheck.API/Controllers/SystemController.cs @@ -0,0 +1,43 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WorkFlowCheck.BL.Services.Interfaces; +using WorkFlowCheck.Common.DTO; + +namespace WorkFlowCheck.API.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class SystemController : ControllerBase + { + + private readonly ISystemService _systemService; + + public SystemController(ISystemService systemService) + { + _systemService = systemService; + } + + [HttpGet("GetDatabaseAndVersionInfo")] + public async Task> GetDatabaseAndVersionInfo() + { + var retVal = new ApiResponseDTO() + { + IsSuccess = true, + }; + var result = await _systemService.GetDatabaseAndVersionInfoAsync(); + + if (result != null) + { + retVal.IsSuccess = true; + retVal.Data = result; + } + else + { + retVal.IsSuccess = false; + retVal.Errors.Add("No data!"); + } + + return retVal; + } + } +} diff --git a/src/WorkFlowCheck.API/Controllers/UserController.cs b/src/WorkFlowCheck.API/Controllers/UserController.cs index 6922edd..707c6ea 100644 --- a/src/WorkFlowCheck.API/Controllers/UserController.cs +++ b/src/WorkFlowCheck.API/Controllers/UserController.cs @@ -257,6 +257,62 @@ namespace WorkFlowCheck.API.Controllers } return retVal; } + [HttpPost("Authenticate2F2ChangePassword")] + public async Task> Authenticate2F2ChangePassword([FromBody] UserChangePassword2FADTO userChangePassword2FADTO) + { + var retVal = new ApiResponseDTO() + { + IsSuccess = true + }; + if (string.IsNullOrEmpty(userChangePassword2FADTO.UserName) || + string.IsNullOrEmpty(userChangePassword2FADTO.OldPassword) || + string.IsNullOrEmpty(userChangePassword2FADTO.NewPassword1) || + string.IsNullOrEmpty(userChangePassword2FADTO.NewPassword2) || + string.IsNullOrEmpty(userChangePassword2FADTO.Code) || + string.IsNullOrEmpty(userChangePassword2FADTO.Token2FA)) + { + retVal.IsSuccess = false; + retVal.Errors.Add("Nem megfelelo felhasználói név vagy jelszó"); + return retVal; + } + try + { + var userDTO_Response = await _userService.Authenticate2F2ChangePassword(userChangePassword2FADTO.UserName, + userChangePassword2FADTO.OldPassword, + userChangePassword2FADTO.NewPassword1, + userChangePassword2FADTO.Code, + userChangePassword2FADTO.Token2FA); + if (userDTO_Response != null) + { + if (string.IsNullOrEmpty(userDTO_Response.UserName) == false) + { + retVal.IsSuccess = true; + retVal.Data = userDTO_Response; + Log.Information($"Sikeres azonosítás! {userChangePassword2FADTO.UserName}"); + } + else + { + var error = $"Nem megfelelo felhasználó vagy jelszó! {userChangePassword2FADTO.UserName}"; + retVal.IsSuccess = false; + retVal.Errors.Add(error); + Log.Information(error); + } + } + else + { + var error = $"Nem megfelelo felhasználó vagy jelszó! {userChangePassword2FADTO.UserName}"; + retVal.IsSuccess = false; + retVal.Errors.Add(error); + Log.Information(error); + } + } + catch (Exception ex) + { + + Log.Error(ex.Message); + } + return retVal; + } [HttpPost("AuthenticateNFC")] public async Task> AuthenticateNFC([FromBody] UserSimpleDTO userSimpleDTO) { @@ -695,5 +751,6 @@ namespace WorkFlowCheck.API.Controllers } return retVal; } + } } diff --git a/src/WorkFlowCheck.API/appsettings.Development.json b/src/WorkFlowCheck.API/appsettings.Development.json index 0c208ae..8526c55 100644 --- a/src/WorkFlowCheck.API/appsettings.Development.json +++ b/src/WorkFlowCheck.API/appsettings.Development.json @@ -1,4 +1,7 @@ { + "ConnectionStrings": { + "DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False" + }, "Logging": { "LogLevel": { "Default": "Information", diff --git a/src/WorkFlowCheck.BL/Infra/DIConfig.cs b/src/WorkFlowCheck.BL/Infra/DIConfig.cs index ffaedfa..dde87bf 100644 --- a/src/WorkFlowCheck.BL/Infra/DIConfig.cs +++ b/src/WorkFlowCheck.BL/Infra/DIConfig.cs @@ -18,6 +18,7 @@ namespace WorkFlowCheck.BL.Infra service.AddScoped(); service.AddScoped(); service.AddScoped(); + service.AddScoped(); } } } diff --git a/src/WorkFlowCheck.BL/Services/Interfaces/ISystemService.cs b/src/WorkFlowCheck.BL/Services/Interfaces/ISystemService.cs new file mode 100644 index 0000000..9d1ce47 --- /dev/null +++ b/src/WorkFlowCheck.BL/Services/Interfaces/ISystemService.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WorkFlowCheck.BL.Services.Interfaces +{ + public interface ISystemService + { + Task GetDatabaseAndVersionInfoAsync(); + } +} diff --git a/src/WorkFlowCheck.BL/Services/Interfaces/IUserService.cs b/src/WorkFlowCheck.BL/Services/Interfaces/IUserService.cs index 707c5ce..d56bc58 100644 --- a/src/WorkFlowCheck.BL/Services/Interfaces/IUserService.cs +++ b/src/WorkFlowCheck.BL/Services/Interfaces/IUserService.cs @@ -16,6 +16,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces Task Authenticate(string UserName, string Password); Task Authenticate2F1(string UserName, string Password); Task Authenticate2F2(string UserName, string Password, string Code, string token2FA); + Task Authenticate2F2ChangePassword(string UserName, string OldPassword, string NewPassword, string Code, string token2FA); Task AuthenticateNFC(string NFCCode); diff --git a/src/WorkFlowCheck.BL/Services/SystemService.cs b/src/WorkFlowCheck.BL/Services/SystemService.cs new file mode 100644 index 0000000..7b400b3 --- /dev/null +++ b/src/WorkFlowCheck.BL/Services/SystemService.cs @@ -0,0 +1,49 @@ +using AutoMapper; +using DocumentFormat.OpenXml.InkML; +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WorkFlowCheck.BL.Services.Interfaces; +using WorkFlowCheck.DL; + +namespace WorkFlowCheck.BL.Services +{ + public class SystemService : ISystemService + { + public readonly AppDbContext _dbContext; + public readonly IMapper _mapper; + public readonly IConfiguration _config; + public SystemService(AppDbContext dbContext, + IMapper mapper, + IConfiguration configuration) + { + _config = configuration; + _dbContext = dbContext; + _mapper = mapper; + } + public async Task GetDatabaseAndVersionInfoAsync() + { + var retVal = ""; + var connection = _dbContext.Database.GetDbConnection(); + var typeName = connection.GetType().Name; + + //if (typeName.Contains("Npgsql")) + //{ + // var builder = new NpgsqlConnectionStringBuilder(connection.ConnectionString); + // retVal= builder.Database; + //} + + if (typeName.Contains("SqlConnection")) + { + var builder = new SqlConnectionStringBuilder(connection.ConnectionString); + retVal= builder.InitialCatalog; + } + return retVal; + } + } +} diff --git a/src/WorkFlowCheck.BL/Services/UserService.cs b/src/WorkFlowCheck.BL/Services/UserService.cs index f22f445..64246d9 100644 --- a/src/WorkFlowCheck.BL/Services/UserService.cs +++ b/src/WorkFlowCheck.BL/Services/UserService.cs @@ -208,7 +208,54 @@ namespace WorkFlowCheck.BL.Services } return retVal; - + + } + public async Task Authenticate2F2ChangePassword(string userName, string oldPassword, string newPassword, string code, string token2FA) + { + var retVal = new UserDTO() { RoleDTO = new List() }; + try + { + var user = await _dbContext.Users + .Include(i => i.UserRoles) + .ThenInclude(i => i.Role) + .Where(w => w.UserName == userName && w.Active != false) + .FirstOrDefaultAsync(); + if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, oldPassword)) + { + if (CodeGenerator2F.ValidateToken2F(token2FA, userName, oldPassword, code)) + { + user.PasswordHash = PasswordHasher.HashPassword(newPassword); + + + var userDTO = new UserDTO() + { + Id = user.Id, + UserName = user.UserName, + RoleDTO = new List(), + }; + foreach (var item in user.UserRoles) + { + userDTO.RoleDTO.Add(new RoleDTO() + { + Id = item.Role.Id, + RoleName = item.Role.RoleName, + }); + } + + user.PasswordHash = PasswordHasher.HashPassword(newPassword); + user.JwtToken = GenerateJwtToken(userDTO); + await _dbContext.SaveChangesAsync(); + + retVal = _mapper.Map(user); + return retVal; + } + } + } + catch (Exception ex) + { + Log.Error(ex.Message); + } + return retVal; } public async Task AuthenticateNFC(string NFCCode) { diff --git a/src/WorkFlowCheck.Common/DTO/UserChangePassword2FADTO.cs b/src/WorkFlowCheck.Common/DTO/UserChangePassword2FADTO.cs new file mode 100644 index 0000000..d4f7cd9 --- /dev/null +++ b/src/WorkFlowCheck.Common/DTO/UserChangePassword2FADTO.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WorkFlowCheck.Common.DTO +{ + public class UserChangePassword2FADTO + { + public int UserId { get; set; } + [DisplayName("Felhasználó")] + public string UserName { get; set; } = null!; + + [DisplayName("Régi jelszó")] + public string OldPassword { get; set; } = null!; + + [DisplayName("Új jelszó")] + public string NewPassword1 { get; set; } = null!; + + [DisplayName("Jelszó megerősítése")] + public string NewPassword2 { get; set; } = null!; + + [DisplayName("Ellenőrző kód")] + public string Code { get; set; } = null!; + public string Token2FA { get; set; } = null!; + } +} diff --git a/src/WorkFlowCheck.Web/Helpers/SystemHelper.cs b/src/WorkFlowCheck.Web/Helpers/SystemHelper.cs new file mode 100644 index 0000000..ca9d9a6 --- /dev/null +++ b/src/WorkFlowCheck.Web/Helpers/SystemHelper.cs @@ -0,0 +1,42 @@ +using Serilog; +using System.Net.Http; +using WorkFlowCheck.Common.DTO; + +namespace WorkFlowCheck.Web.Helpers +{ + public static class SystemHelper + { + public static string DatabaseName = ""; + public async static Task GetAPIInfoAsync(IConfiguration configuration) + { + using (var httpClient = new HttpClient()) + { + + + var apiBaseUrl = configuration["ApiBaseUrl"]; // API-cím elérése a konfigurációból + httpClient.BaseAddress = new Uri(apiBaseUrl); + + var apiKey = configuration["ApiKey"]; + httpClient.DefaultRequestHeaders.Add("X-Api-Key", apiKey); + + string endpoint = $"{httpClient.BaseAddress}api/System/GetDatabaseAndVersionInfo"; + var retVal = new RoleDTO(); + try + { + var response = await httpClient.GetFromJsonAsync>(endpoint); + if (response != null) + { + if (response.IsSuccess) + { + DatabaseName = response.Data; + } + } + } + catch (Exception ex) + { + Log.Error(ex.Message); + } + } + } + } +} diff --git a/src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml b/src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml new file mode 100644 index 0000000..038420b --- /dev/null +++ b/src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml @@ -0,0 +1,212 @@ +@page "{userId:int?}" +@model WorkFlowCheck.Web.Pages.Account.ChangePasswordModel +@using WorkFlowCheck.Common.Helper +@using WorkFlowCheck.Common.DTO +@using Microsoft.AspNetCore.Antiforgery +@inject IAntiforgery Antiforgery +@{ + Layout = null; + ViewData["Title"] = "Jelszó módosítása"; +} + + + + + + + @ViewData["Title"] + + + +
+

Jelszó módosítása

+ + + +
+ + + +
+ + + +
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml.cs b/src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml.cs new file mode 100644 index 0000000..5df6757 --- /dev/null +++ b/src/WorkFlowCheck.Web/Pages/Account/ChangePassword.cshtml.cs @@ -0,0 +1,98 @@ +using FluentValidation; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity.Data; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Net.NetworkInformation; +using System.Security.Claims; +using System.Text.Json; +using WorkFlowCheck.Common.DTO; +using WorkFlowCheck.Web.Services.Interfaces; + +namespace WorkFlowCheck.Web.Pages.Account +{ + [Authorize] + [ValidateAntiForgeryToken] + public class ChangePasswordModel : PageModel + { + private readonly IUserService _userService; + + [BindProperty] + public UserChangePassword2FADTO UserChangePassword2FADTO { get; set; } + + public string ErrorMessage { get; set; } + + public ChangePasswordModel(IUserService userService) + { + _userService = userService; + } + + public async Task OnGet() + { + var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); + var user = await _userService.GetUser(int.Parse(userId)); + if (user != null && user.Id > 0) + { + + UserChangePassword2FADTO = new UserChangePassword2FADTO() + { + UserName = user.UserName, + UserId = user.Id, + }; + } + } + public async Task OnPostLogin2F1([FromBody] UserSimpleDTO userSimpleDTO) + { + + if (userSimpleDTO != null) + { + var response = await _userService.Authenticate2F1(userSimpleDTO.UserName, userSimpleDTO.Password); + + if (response.IsSuccess) + { + return new JsonResult(new { success = true, data = response.Data }); + } + else + { + ErrorMessage = "Hibás bejelentkezés!"; + return new JsonResult(new { success = false }); + } + } + else + { + ErrorMessage = "Hibás bejelentkezés!"; + return new JsonResult(new { success = false }); + } + } + public async Task OnPostLogin2F2([FromBody] UserChangePassword2FADTO userChangePassword2FADTO) + { + var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); + var user = await _userService.GetUser(int.Parse(userId)); + userChangePassword2FADTO.UserId = user.Id; + var response = await _userService.Authenticate2F2ChangePassword(userChangePassword2FADTO.UserName, + userChangePassword2FADTO.OldPassword, + userChangePassword2FADTO.NewPassword1, + userChangePassword2FADTO.Code, + userChangePassword2FADTO.Token2FA); + + if (response.IsSuccess) + { + + var token = response.Data.JwtToken; + + Response.Cookies.Append("AuthToken", token, new CookieOptions + { + HttpOnly = true, + Secure = true, + SameSite = SameSiteMode.Strict, + Expires = DateTimeOffset.UtcNow.AddMinutes(30) + }); + + return new JsonResult(new { success = true }); + } + + ErrorMessage = "Hibás bejelentkezés!"; + return new JsonResult(new { success = false }); + } + } +} diff --git a/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml b/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml index 3e42c18..db0b740 100644 --- a/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml +++ b/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml @@ -1,4 +1,6 @@ - + + + @@ -64,11 +66,24 @@ @@ -138,7 +153,7 @@
- © @DateTime.Now.Year - Workflow Check App - Version v1.1.003 Privacy + © @DateTime.Now.Year - Workflow Check App - Version v1.1.003 (@SystemHelper.DatabaseName)Privacy
diff --git a/src/WorkFlowCheck.Web/Pages/_ViewImports.cshtml b/src/WorkFlowCheck.Web/Pages/_ViewImports.cshtml index 0ad9d51..30510b3 100644 --- a/src/WorkFlowCheck.Web/Pages/_ViewImports.cshtml +++ b/src/WorkFlowCheck.Web/Pages/_ViewImports.cshtml @@ -1,3 +1,4 @@ @using WorkFlowCheck.Web +@using WorkFlowCheck.Web.Helpers @namespace WorkFlowCheck.Web.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/WorkFlowCheck.Web/Program.cs b/src/WorkFlowCheck.Web/Program.cs index 2823377..9369f12 100644 --- a/src/WorkFlowCheck.Web/Program.cs +++ b/src/WorkFlowCheck.Web/Program.cs @@ -5,6 +5,7 @@ using Microsoft.IdentityModel.Tokens; using Serilog; using System.Text; using WorkFlowCheck.Common.DTO; +using WorkFlowCheck.Web.Helpers; using WorkFlowCheck.Web.Middleware; using WorkFlowCheck.Web.Services; using WorkFlowCheck.Web.Services.Interfaces; @@ -61,6 +62,11 @@ builder.WebHost.ConfigureKestrel(options => var app = builder.Build(); +using (var scope = app.Services.CreateScope()) +{ + var config = scope.ServiceProvider.GetRequiredService(); + await SystemHelper.GetAPIInfoAsync(config); +} //----------------- Munkakönyvtárak létrehozása ----------------------------- string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images"); diff --git a/src/WorkFlowCheck.Web/Services/Interfaces/IUserService.cs b/src/WorkFlowCheck.Web/Services/Interfaces/IUserService.cs index bb6becd..b61951d 100644 --- a/src/WorkFlowCheck.Web/Services/Interfaces/IUserService.cs +++ b/src/WorkFlowCheck.Web/Services/Interfaces/IUserService.cs @@ -9,7 +9,8 @@ namespace WorkFlowCheck.Web.Services.Interfaces Task> UpdateUser(UserDTO userDTO); Task> Authenticate(string username, string password); Task> Authenticate2F1(string username, string password); - Task> Authenticate2F2(string userName, string password, string code, string token2FA); + Task> Authenticate2F2(string username, string password, string code, string token2FA); + Task> Authenticate2F2ChangePassword(string username, string oldpassword,string newpassword, string code, string token2FA); Task DeleteUser(int id); Task GetRole(int id); diff --git a/src/WorkFlowCheck.Web/Services/UserService.cs b/src/WorkFlowCheck.Web/Services/UserService.cs index eccde4c..dbbec88 100644 --- a/src/WorkFlowCheck.Web/Services/UserService.cs +++ b/src/WorkFlowCheck.Web/Services/UserService.cs @@ -195,6 +195,48 @@ namespace WorkFlowCheck.Web.Services }; } } + public async Task> Authenticate2F2ChangePassword(string username, string oldpassword, string newpassword, string code, string token2FA) + { + try + { + + string endpoint = $"{_httpClient.BaseAddress}api/User/Authenticate2F2ChangePassword"; + + var userSimpleDTO = new UserChangePassword2FADTO() + { + UserName = username, + OldPassword = oldpassword, + NewPassword1 = newpassword, + NewPassword2 = newpassword, + Code = code, + Token2FA = token2FA + }; + + + using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, userSimpleDTO)) + { + httpResponseMessage.EnsureSuccessStatusCode(); + + var jsonString = await httpResponseMessage.Content.ReadAsStringAsync(); + var response = JsonConvert.DeserializeObject>(jsonString); + + return response ?? new ApiResponseDTO + { + IsSuccess = false, + }; + } + } + catch (Exception ex) + { + + return new ApiResponseDTO + { + IsSuccess = false + }; + } + } + + public async Task DeleteUser(int id) { string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteUser/{id}"; @@ -522,6 +564,6 @@ namespace WorkFlowCheck.Web.Services } } - + } } diff --git a/src/WorkFlowCheck.Web/wwwroot/js/site.js b/src/WorkFlowCheck.Web/wwwroot/js/site.js index 66f2e2a..bb40455 100644 --- a/src/WorkFlowCheck.Web/wwwroot/js/site.js +++ b/src/WorkFlowCheck.Web/wwwroot/js/site.js @@ -77,7 +77,8 @@ function showMessageModal(options) { var defaults = { title: 'Üzenet', message: 'Ez egy információs üzenet.', - okText: 'OK' + okText: 'OK', + redirectUrl: null }; var settings = $.extend({}, defaults, options); @@ -87,6 +88,12 @@ function showMessageModal(options) { $('#messageModalBody').html(settings.message); $('#messageModalOkBtn').text(settings.okText); + $('#messageModalOkBtn').off('click').on('click', function () { + if (settings.redirectUrl) { + window.location.href = settings.redirectUrl; + } + }); + // Modal megnyitása var modal = new bootstrap.Modal(document.getElementById('messageModal'), { backdrop: 'static',