diff --git a/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/0b339eb8-8667-4946-86cc-4b8548eebb0b.vsidx b/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/5fb404ac-eea9-4365-9d54-f44056d3de8f.vsidx similarity index 92% rename from CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/0b339eb8-8667-4946-86cc-4b8548eebb0b.vsidx rename to CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/5fb404ac-eea9-4365-9d54-f44056d3de8f.vsidx index 66d6e50..643d460 100644 Binary files a/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/0b339eb8-8667-4946-86cc-4b8548eebb0b.vsidx and b/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/5fb404ac-eea9-4365-9d54-f44056d3de8f.vsidx differ diff --git a/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/fba375c7-25e1-4403-b409-b2a913545ad4.vsidx b/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/b89bed3c-ce4e-4d88-88f2-5e38f888b785.vsidx similarity index 94% rename from CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/fba375c7-25e1-4403-b409-b2a913545ad4.vsidx rename to CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/b89bed3c-ce4e-4d88-88f2-5e38f888b785.vsidx index 48af498..19280fe 100644 Binary files a/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/fba375c7-25e1-4403-b409-b2a913545ad4.vsidx and b/CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/b89bed3c-ce4e-4d88-88f2-5e38f888b785.vsidx differ diff --git a/CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.suo b/CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.suo index 65811bb..dc7b429 100644 Binary files a/CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.suo and b/CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.suo differ diff --git a/CustomerOnlineV2/.vs/CustomerOnlineV2/DesignTimeBuild/.dtbcache.v2 b/CustomerOnlineV2/.vs/CustomerOnlineV2/DesignTimeBuild/.dtbcache.v2 index f14f389..701679b 100644 Binary files a/CustomerOnlineV2/.vs/CustomerOnlineV2/DesignTimeBuild/.dtbcache.v2 and b/CustomerOnlineV2/.vs/CustomerOnlineV2/DesignTimeBuild/.dtbcache.v2 differ diff --git a/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/e68d049b-dcdf-4fe5-ada1-de1d6150b93d.vsidx b/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/11384c65-95fb-4bc1-9dca-1108a96e5fb5.vsidx similarity index 61% rename from CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/e68d049b-dcdf-4fe5-ada1-de1d6150b93d.vsidx rename to CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/11384c65-95fb-4bc1-9dca-1108a96e5fb5.vsidx index bae0bce..17fe6c7 100644 Binary files a/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/e68d049b-dcdf-4fe5-ada1-de1d6150b93d.vsidx and b/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/11384c65-95fb-4bc1-9dca-1108a96e5fb5.vsidx differ diff --git a/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/69ee9263-a1ef-472d-8a39-cc72c085acb1.vsidx b/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/69ee9263-a1ef-472d-8a39-cc72c085acb1.vsidx new file mode 100644 index 0000000..d766c5b Binary files /dev/null and b/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/69ee9263-a1ef-472d-8a39-cc72c085acb1.vsidx differ diff --git a/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/70678d72-60b3-457b-9358-27c79374f28a.vsidx b/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/70678d72-60b3-457b-9358-27c79374f28a.vsidx deleted file mode 100644 index a7ef17a..0000000 Binary files a/CustomerOnlineV2/.vs/CustomerOnlineV2/FileContentIndex/70678d72-60b3-457b-9358-27c79374f28a.vsidx and /dev/null differ diff --git a/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.futdcache.v2 b/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.futdcache.v2 index 733c032..517f296 100644 Binary files a/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.futdcache.v2 and b/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.futdcache.v2 differ diff --git a/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.suo b/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.suo index 4c21fe0..c14600b 100644 Binary files a/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.suo and b/CustomerOnlineV2/.vs/CustomerOnlineV2/v17/.suo differ diff --git a/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.metadata.v7.bin b/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.metadata.v7.bin index dbcc5a5..89db829 100644 Binary files a/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.metadata.v7.bin and b/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.metadata.v7.bin differ diff --git a/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.projects.v7.bin b/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.projects.v7.bin index c9bdd22..fb7ffa0 100644 Binary files a/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.projects.v7.bin and b/CustomerOnlineV2/.vs/ProjectEvaluation/customeronlinev2.projects.v7.bin differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.dll b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.dll index eeb6bba..a507c5b 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.dll and b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb index 1917b99..2254df2 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.dll b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.dll index 72c2431..5a961d1 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.dll and b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb index 4648614..34acaf4 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Api/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.csproj.AssemblyReference.cache b/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.csproj.AssemblyReference.cache index 182cbb7..00cb5a9 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.csproj.AssemblyReference.cache and b/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.csproj.AssemblyReference.cache differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.dll b/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.dll index eeb6bba..a507c5b 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.dll and b/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.pdb b/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.pdb index 1917b99..2254df2 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Api/obj/Debug/net7.0/CustomerOnlineV2.Api.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs index 0aa4c6c..66c4718 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs @@ -1,4 +1,5 @@ -using CustomerOnlineV2.Common.Models.AccountModel; +using CustomerOnlineV2.Common.Models; +using CustomerOnlineV2.Common.Models.AccountModel; using CustomerOnlineV2.Repository.Repository.AccountRepository; using Microsoft.Extensions.Logging; @@ -19,5 +20,15 @@ namespace CustomerOnlineV2.Business.Business.AccountBusiness { return await _accountRepo.Login(model); } + + public async Task ChangePassword(ForceChangePasswordModel model, LoginResponse logindetails) + { + if (model.NewPassword != model.ConfirmNewPassword) + { + return new CommonResponse(ResponseHelper.FAILED, "New Password and confirm new password does not match!"); + } + + return await _accountRepo.ChangePassword(model, logindetails); + } } } diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/IAccountBusiness.cs b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/IAccountBusiness.cs index 8ca9202..99dcb0d 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/IAccountBusiness.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/IAccountBusiness.cs @@ -1,9 +1,11 @@ -using CustomerOnlineV2.Common.Models.AccountModel; +using CustomerOnlineV2.Common.Models; +using CustomerOnlineV2.Common.Models.AccountModel; namespace CustomerOnlineV2.Business.Business.AccountBusiness { public interface IAccountBusiness { Task Login(LoginModel model); + Task ChangePassword(ForceChangePasswordModel model, LoginResponse logindetails); } } diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/TransactionBusiness.cs b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/TransactionBusiness.cs index 9629508..8bed401 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/TransactionBusiness.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/TransactionBusiness.cs @@ -1,5 +1,6 @@ using CustomerOnlineV2.Api.API.TPApi; using CustomerOnlineV2.Common.Helper; +using CustomerOnlineV2.Common.Models; using CustomerOnlineV2.Common.Models.AccountModel; using CustomerOnlineV2.Common.Models.TransactionModel; using CustomerOnlineV2.Repository.Repository.TransactionRepository; @@ -25,13 +26,97 @@ namespace CustomerOnlineV2.Business.Business.TransactionBusiness { ExrateResponse _response = new ExrateResponse(); _logger.LogDebug("TRANSACTIONBUSINESS | DOCALCULATION | REQUEST | " + JsonConvert.SerializeObject(calcModel)); + _response = ValidateExrateRequest(calcModel); - ExratePayoutDetailsModel _partnerDetails = await _transactionRepo.GetPayoutDetails(calcModel, loginDetails); + if (_response.ResponseCode == ResponseHelper.SUCCESS) + { + ExratePayoutDetailsModel _partnerDetails = await _transactionRepo.GetPayoutDetails(calcModel, loginDetails); + + ExrateCalculateRequestModel _request = GenerateExrateParams(calcModel, loginDetails, _partnerDetails); + + _response = await _tpApi.GetExRate(_request); + } + return _response; + } + + private ExrateResponse ValidateExrateRequest(SendTransactionModel calcModel) + { + ExrateResponse _response = new ExrateResponse(); + _response.ResponseCode = ResponseHelper.SUCCESS; + _response.ResponseMessage = ResponseMessageHelper.SUCCESS; + + if (string.IsNullOrEmpty(calcModel.CalcBy)) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param calcBy can not be emoty!"; + + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + else if (calcModel.CalcBy != "c") + { + if (calcModel.CalcBy != "p") + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param calcBy have invalid value!"; - ExrateCalculateRequestModel _request = GenerateExrateParams(calcModel, loginDetails, _partnerDetails); + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + } + else if (string.IsNullOrEmpty(calcModel.ReceivingCountry)) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param ReceivingCountry can not be emoty!"; + + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + else if (string.IsNullOrEmpty(calcModel.DeliveryMethod)) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param DeliveryMethod can not be emoty!"; + + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + else if (string.IsNullOrEmpty(calcModel.CollectAmount)) + { + if (string.IsNullOrEmpty(calcModel.PayoutAmount)) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Params CollectAmount and PayoutAmount can not be emoty!"; + + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + } + else if (string.IsNullOrEmpty(calcModel.CollMode)) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param CollMode can not be emoty!"; + + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + else if (Utilities.TryParseDecimal(calcModel.CollectAmount) <= 0) + { + if (Utilities.TryParseDecimal(calcModel.PayoutAmount) <= 0) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param CollectAmount or PayoutAmount has invalid value!"; - _response = await _tpApi.GetExRate(_request); + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + } + else if (calcModel.CalcBy == "c" && Utilities.TryParseDecimal(calcModel.CollectAmount) <= 0) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param CollectAmount has invalid value!"; + + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } + else if (calcModel.CalcBy == "p" && Utilities.TryParseDecimal(calcModel.PayoutAmount) <= 0) + { + _response.ResponseCode = ResponseHelper.FAILED; + _response.ResponseMessage = "Param PayoutAmount has invalid value!"; + _logger.LogError("TRANSACTIONBUSINESS | DOCALCULATION.VALIDATEEXRATEREQUEST | REQUEST | " + JsonConvert.SerializeObject(_response)); + } return _response; } diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.dll b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.dll index eeb6bba..a507c5b 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.dll and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb index 1917b99..2254df2 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Api.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.dll b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.dll index 0d2b6dc..3e515cf 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.dll and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.pdb b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.pdb index dccfad0..54c188f 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Business.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.dll b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.dll index 72c2431..5a961d1 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.dll and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb index 4648614..34acaf4 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll index 2fc1002..66a325b 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb index cf35466..ca4d84d 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Business/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.csproj.AssemblyReference.cache b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.csproj.AssemblyReference.cache index 7f76393..1a63e7c 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.csproj.AssemblyReference.cache and b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.csproj.AssemblyReference.cache differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.dll b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.dll index 0d2b6dc..3e515cf 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.dll and b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.pdb b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.pdb index dccfad0..54c188f 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/CustomerOnlineV2.Business.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/ref/CustomerOnlineV2.Business.dll b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/ref/CustomerOnlineV2.Business.dll index baa6b32..60740d4 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/ref/CustomerOnlineV2.Business.dll and b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/ref/CustomerOnlineV2.Business.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/refint/CustomerOnlineV2.Business.dll b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/refint/CustomerOnlineV2.Business.dll index baa6b32..60740d4 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/refint/CustomerOnlineV2.Business.dll and b/CustomerOnlineV2/CustomerOnlineV2.Business/obj/Debug/net7.0/refint/CustomerOnlineV2.Business.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/Helper/Utilities.cs b/CustomerOnlineV2/CustomerOnlineV2.Common/Helper/Utilities.cs index 4ba9781..1a23ef6 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Common/Helper/Utilities.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Common/Helper/Utilities.cs @@ -21,6 +21,14 @@ namespace CustomerOnlineV2.Common.Helper return ConfigurationManager.AppSettings[key] ?? defValue; } + public static decimal TryParseDecimal(string amount) + { + decimal output; + decimal.TryParse(amount, out output); + + return output; + } + public static string GetRowCellValue(object v) { try diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/Models/AccountModel/AccountModel.cs b/CustomerOnlineV2/CustomerOnlineV2.Common/Models/AccountModel/AccountModel.cs index 306f97b..33dea15 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Common/Models/AccountModel/AccountModel.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Common/Models/AccountModel/AccountModel.cs @@ -14,6 +14,13 @@ public bool RememberMe { get; set; } } + public class ForceChangePasswordModel + { + public string? NewPassword { get; set; } + public string? ConfirmNewPassword { get; set; } + public string? IpAddress { get; set; } + } + public class LoginResponse : CommonResponse { public string? UserId { get; set; } diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.dll b/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.dll index 72c2431..5a961d1 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.dll and b/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb b/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb index 4648614..34acaf4 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Common/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.dll b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.dll index 72c2431..5a961d1 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.dll and b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.pdb b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.pdb index 4648614..34acaf4 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/CustomerOnlineV2.Common.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/ref/CustomerOnlineV2.Common.dll b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/ref/CustomerOnlineV2.Common.dll index e916bde..cc7c2c7 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/ref/CustomerOnlineV2.Common.dll and b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/ref/CustomerOnlineV2.Common.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/refint/CustomerOnlineV2.Common.dll b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/refint/CustomerOnlineV2.Common.dll index e916bde..cc7c2c7 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/refint/CustomerOnlineV2.Common.dll and b/CustomerOnlineV2/CustomerOnlineV2.Common/obj/Debug/net7.0/refint/CustomerOnlineV2.Common.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/AccountRepository.cs b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/AccountRepository.cs index 3b3bb7a..8e5b872 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/AccountRepository.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/AccountRepository.cs @@ -1,5 +1,5 @@ -using CustomerOnlineV2.Common.Models.AccountModel; -using CustomerOnlineV2.Common.Models; +using CustomerOnlineV2.Common.Models; +using CustomerOnlineV2.Common.Models.AccountModel; using CustomerOnlineV2.Repository.ConnectionHelper; using Microsoft.Extensions.Logging; using Newtonsoft.Json; @@ -67,5 +67,30 @@ namespace CustomerOnlineV2.Repository.Repository.AccountRepository } return await Task.FromResult(_response); } + + public async Task ChangePassword(ForceChangePasswordModel model, LoginResponse logindetails) + { + CommonResponse _response = new CommonResponse(); + try + { + var sql = "EXEC PROC_DYNAMIC_TABLE"; + sql += " @Flag = " + _connHelper.FilterString("ForceChange"); + sql += ",@UserEmail = " + _connHelper.FilterString(logindetails.UserName); + sql += ",@Password = " + _connHelper.FilterString(model.NewPassword); + sql += ",@ConfirmPassword = " + _connHelper.FilterString(model.ConfirmNewPassword); + sql += ",@ipAddress = " + _connHelper.FilterString(model.IpAddress); + + _logger.LogDebug("ACCOUNTREPOSITORY | CHANGEPASSWORD | SQL | " + sql); + return _connHelper.ParseDbResult(sql); + } + catch (Exception ex) + { + _response.ResponseCode = ResponseHelper.EXCEPTION; + _response.ResponseMessage = "Exception occured: " + ex.Message; + + _logger.LogError("ACCOUNTREPOSITORY | LOGIN | EXCEPTION | " + JsonConvert.SerializeObject(_response)); + } + return await Task.FromResult(_response); + } } } diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/IAccountRepository.cs b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/IAccountRepository.cs index f2afc7b..8ceef6f 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/IAccountRepository.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/IAccountRepository.cs @@ -1,9 +1,11 @@ -using CustomerOnlineV2.Common.Models.AccountModel; +using CustomerOnlineV2.Common.Models; +using CustomerOnlineV2.Common.Models.AccountModel; namespace CustomerOnlineV2.Repository.Repository.AccountRepository { public interface IAccountRepository { + Task ChangePassword(ForceChangePasswordModel model, LoginResponse logindetails); Task Login(LoginModel model); } } diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.dll b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.dll index 72c2431..5a961d1 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.dll and b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb index 4648614..34acaf4 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Common.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll index 2fc1002..66a325b 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll and b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb index cf35466..ca4d84d 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Repository/bin/Debug/net7.0/CustomerOnlineV2.Repository.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.csproj.AssemblyReference.cache b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.csproj.AssemblyReference.cache index c74a582..5c61ee0 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.csproj.AssemblyReference.cache and b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.csproj.AssemblyReference.cache differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.dll b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.dll index 2fc1002..66a325b 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.dll and b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.pdb b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.pdb index cf35466..ca4d84d 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.pdb and b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/CustomerOnlineV2.Repository.pdb differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/ref/CustomerOnlineV2.Repository.dll b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/ref/CustomerOnlineV2.Repository.dll index 65a099d..412bbd0 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/ref/CustomerOnlineV2.Repository.dll and b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/ref/CustomerOnlineV2.Repository.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/refint/CustomerOnlineV2.Repository.dll b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/refint/CustomerOnlineV2.Repository.dll index 65a099d..412bbd0 100644 Binary files a/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/refint/CustomerOnlineV2.Repository.dll and b/CustomerOnlineV2/CustomerOnlineV2.Repository/obj/Debug/net7.0/refint/CustomerOnlineV2.Repository.dll differ diff --git a/CustomerOnlineV2/CustomerOnlineV2/Authorization/AuthorizationAttribute.cs b/CustomerOnlineV2/CustomerOnlineV2/Authorization/AuthorizationAttribute.cs new file mode 100644 index 0000000..5dffb70 --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2/Authorization/AuthorizationAttribute.cs @@ -0,0 +1,107 @@ +using CustomerOnlineV2.Common.Models.AccountModel; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using System.Net; +using System.Security.Claims; + +namespace CustomerOnlineV2.Authorization +{ + public class AuthorizationAttribute: TypeFilterAttribute + { + public AuthorizationAttribute(params string[] ids) : base(typeof(ClaimRequirementFilter)) + { + Arguments = new object[] { ids }; + } + + public class ClaimRequirementFilter : IAuthorizationFilter + { + private readonly string[] _ids; + public ClaimRequirementFilter(string[] ids) + { + _ids = ids; + } + + public void OnAuthorization(AuthorizationFilterContext context) + { + var IsAuthenticated = context.HttpContext.User.Identity.IsAuthenticated; + var claimsIndentity = context.HttpContext.User.Identity as ClaimsIdentity; + + if (IsAuthenticated) + { + try + { + LoginResponse _loginData = new LoginResponse(); + _loginData.UserName = claimsIndentity.FindFirst(c => c.Type == "UserName").Value; + _loginData.SessionId = claimsIndentity.FindFirst(c => c.Type == "SessionId").Value; + _loginData.ForceChangePassword = Convert.ToBoolean(claimsIndentity.FindFirst(c => c.Type == "ForceChangePassword").Value); + + if (string.IsNullOrEmpty(_loginData.UserName)) + { + + if (context.HttpContext.Request.IsAjaxRequest()) + { + context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized; + return; + } + + context.Result = new RedirectToRouteResult(new RouteValueDictionary(new { action = "Index", controller = "Account" })); + return; + } + + //force change password + if (_loginData.ForceChangePassword) + { + context.HttpContext.Response.StatusCode = (int)HttpStatusCode.OK; + context.HttpContext.Response.Redirect("/Account/ForceChangePassword"); + return; + } + } + catch (Exception ex) + { + context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized; + context.Result = new RedirectToRouteResult(new RouteValueDictionary(new { action = "Index", controller = "Account" })); + return; + } + } + else + { + if (context.HttpContext.Request.IsAjaxRequest()) + { + context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized; //Set HTTP 403 - + } + else + { + var request = context.HttpContext.Request; + var returnUrl = request.Path; + var queryString = request.QueryString.Value; + if (!string.IsNullOrEmpty(queryString)) + { + returnUrl += queryString; + } + + context.Result = new RedirectToRouteResult(new RouteValueDictionary(new + { + action = "Index", + controller = "Account", + returnUrl = returnUrl.Value + })); + } + } + } + } + } + + public static class CheckAjaxRequest + { + public static bool IsAjaxRequest(this HttpRequest request) + { + if (request == null) + throw new ArgumentNullException("request"); + if (request.Headers["X-Requested-With"] == "XMLHttpRequest") + return true; + if (request.Headers != null) + return request.Headers["X-Requested-With"] == "XMLHttpRequest"; + return false; + } + } +} \ No newline at end of file diff --git a/CustomerOnlineV2/CustomerOnlineV2/Controllers/AccountController.cs b/CustomerOnlineV2/CustomerOnlineV2/Controllers/AccountController.cs index c9a6546..fd55a70 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Controllers/AccountController.cs +++ b/CustomerOnlineV2/CustomerOnlineV2/Controllers/AccountController.cs @@ -11,6 +11,7 @@ using Serilog.Context; using Serilog; using System.Security.Claims; using System.Web; +using System.Security.Permissions; namespace CustomerOnlineV2.Controllers { @@ -42,7 +43,7 @@ namespace CustomerOnlineV2.Controllers [HttpPost] [AllowAnonymous] - [ValidateAntiForgeryToken] + [ValidateAntiForgeryToken] public async Task Index(LoginModel loginModel) { loginModel.SessionId = Guid.NewGuid().ToString().Replace("-", ""); @@ -79,11 +80,11 @@ namespace CustomerOnlineV2.Controllers HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity)); - //if (result.ForceChangePassword) - //{ - // Log.Information("ACCOUNTCONTROLLER | LOGIN | FORCE CHANGE PASSWORD"); - // return RedirectToAction("ChangePassword", "Account"); - //} + if (result.ForceChangePassword) + { + Log.Information("ACCOUNTCONTROLLER | LOGIN | FORCE CHANGE PASSWORD"); + return RedirectToAction("ForceChangePassword", "Account"); + } var returnUrl = Convert.ToString(TempData["ReturnUrl"]); if (Url.IsLocalUrl(returnUrl)) @@ -108,5 +109,43 @@ namespace CustomerOnlineV2.Controllers } return View(); } + + public async Task ForceChangePassword() + { + return View(); + } + + [HttpPost] + [ValidateAntiForgeryToken] + public async Task ForceChangePassword(ForceChangePasswordModel model) + { + var logindetails = HttpContext.GetLoginDetails(); + model.IpAddress = Utilities.GetIpAddressv2(HttpContext); + using (LogContext.PushProperty("DebugId", logindetails.UserName)) + { + _logger.LogDebug("ACCOUNTCONTROLLER | FORCECHANGEPASSWORD | REQUEST | " + JsonConvert.SerializeObject(model)); + if (string.IsNullOrEmpty(logindetails.UserName)) + { + _logger.LogError("ACCOUNTCONTROLLER | FORCECHANGEPASSWORD | INVALID logindetails.UserName"); + RedirectToAction("Index", "Account"); + } + + var response = await _accountBusiness.ChangePassword(model, logindetails); + Log.Debug("Change password response: " + JsonConvert.SerializeObject(response)); + if (response.ResponseCode == ResponseHelper.SUCCESS) + { + Log.Debug("ACCOUNTCONTROLLER | CHANGEPASSWORD | REQUEST ARRIVED | " + logindetails.UserName); + HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); + return RedirectToAction("Index", "Account"); + } + else + { + ViewBag.ResponseCode = response.ResponseCode; + ViewBag.ResponseMessage = response.ResponseMessage; + _logger.LogError("ACCOUNTCONTROLLER | LOGIN | ERROR OCCURED | " + JsonConvert.SerializeObject(response)); + return View(); + } + } + } } } diff --git a/CustomerOnlineV2/CustomerOnlineV2/Controllers/HomeController.cs b/CustomerOnlineV2/CustomerOnlineV2/Controllers/HomeController.cs index a32ba59..ab1bf9c 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Controllers/HomeController.cs +++ b/CustomerOnlineV2/CustomerOnlineV2/Controllers/HomeController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using CustomerOnlineV2.Common.Models.HomeModel; +using CustomerOnlineV2.Authorization; namespace CustomerOnlineV2.Controllers { @@ -21,11 +22,13 @@ namespace CustomerOnlineV2.Controllers _homeBusiness = homeBusiness; } + [Authorization("Index")] public IActionResult Index() { return View(); } + [Authorization("Privacy")] public IActionResult Privacy() { return View(); @@ -38,7 +41,6 @@ namespace CustomerOnlineV2.Controllers } [AllowAnonymous] - [ValidateAntiForgeryToken] public IActionResult Logout() { HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); @@ -47,6 +49,7 @@ namespace CustomerOnlineV2.Controllers [HttpPost] [ValidateAntiForgeryToken] + [Authorization("GetTransactionList")] public async Task GetTransactionList() { var loginDetails = HttpContext.GetLoginDetails(); @@ -55,6 +58,7 @@ namespace CustomerOnlineV2.Controllers [HttpPost] [ValidateAntiForgeryToken] + [Authorization("GetReceiverList")] public async Task GetReceiverList() { var loginDetails = HttpContext.GetLoginDetails(); @@ -63,6 +67,7 @@ namespace CustomerOnlineV2.Controllers [HttpPost] [ValidateAntiForgeryToken] + [Authorization("GetDDLList")] public async Task GetDDLList(CommonDropDownModel model) { var loginDetails = HttpContext.GetLoginDetails(); diff --git a/CustomerOnlineV2/CustomerOnlineV2/Controllers/TransactionController.cs b/CustomerOnlineV2/CustomerOnlineV2/Controllers/TransactionController.cs index ae3cafe..5d913cb 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Controllers/TransactionController.cs +++ b/CustomerOnlineV2/CustomerOnlineV2/Controllers/TransactionController.cs @@ -4,7 +4,7 @@ using CustomerOnlineV2.Common.Helper; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Serilog.Context; -using System.Web; +using CustomerOnlineV2.Authorization; namespace CustomerOnlineV2.Controllers { @@ -21,6 +21,7 @@ namespace CustomerOnlineV2.Controllers [HttpPost] [ValidateAntiForgeryToken] + [Authorization("DoCalculation")] public async Task DoCalculation(SendTransactionModel calcModel) { ExrateResponse _response = new ExrateResponse(); diff --git a/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml b/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml new file mode 100644 index 0000000..f260aa9 --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml @@ -0,0 +1,237 @@ +@model CustomerOnlineV2.Common.Models.AccountModel.ForceChangePasswordModel +@{ + Layout = null; +} + + + + + + + + + Money Transfer and Online Payments + + + + + + + + + + + + + +
+
+
+ + +
+ + + + + + +
+ +
+
+
+
+
+
+

Change Password

+
You need to change your password to keep your account secure.
+

+
+
+
+ + +
+
+ + +
+
+
+ +
+
+
+
+
+
+
+
+ + Email Address + info@imelondon.co.uk +
+
+ + Contact Numbers + +44 02088660307 + +44 07984713677 +
+
+ + Our Head Office + Pentax House, South Hill Avenue, South Harrow, London, HA2 0DU +
+
+
+
+
+
+
+ +
+
+
+
+
+
+

+ IME London is a product of Subhida UK Limited, Pentax House,South Hill Avenue, South Harrow, London, H2A 0D + + Company Registration No. 06432399 Subhida UK Ltd is authorized and regulated by the Financial Conduct + Authority (FCA)
under the Payment Service Regulations 2017. FCA Registration No. 576127 HMRC Registration No. XYML000000119350 +

+
+
+
+
+
+
+

© IME London, 2023

+
+ +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + diff --git a/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml b/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml index 324f404..7f82066 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml +++ b/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml @@ -115,7 +115,7 @@
  • - Sign Out + Sign Out
  • diff --git a/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout2.cshtml b/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout2.cshtml index 1b3d47c..8025106 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout2.cshtml +++ b/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout2.cshtml @@ -117,7 +117,7 @@
  • - Sign Out + Sign Out
  • diff --git a/CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml b/CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml index c2a7a92..bf6352c 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml +++ b/CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml @@ -61,7 +61,7 @@
    - +
    @@ -71,7 +71,7 @@
    - +
    @@ -110,7 +110,7 @@
    - +
    @@ -170,15 +170,31 @@
    + @section Scripts{