From ff695dd1a185ae376d903b002827de65788542d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Tue, 30 Aug 2022 15:30:50 +0200 Subject: [PATCH] feature/Registration page and check boxes WIP 2 --- .../code/model/dataAccess/AuthUser.scala | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala b/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala index 91ea9d6bb..d1d694ae1 100644 --- a/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala +++ b/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala @@ -38,8 +38,9 @@ import code.bankconnectors.Connector import code.context.UserAuthContextProvider import code.entitlement.Entitlement import code.loginattempts.LoginAttempt +import code.snippet.WebUI import code.token.TokensOpenIDConnect -import code.users.Users +import code.users.{UserAgreementProvider, Users} import code.util.Helper import code.util.Helper.MdcLoggable import code.views.Views @@ -645,6 +646,13 @@ import net.liftweb.util.Helpers._ override def actionsAfterSignup(theUser: TheUserType, func: () => Nothing): Nothing = { theUser.setValidated(skipEmailValidation).resetUniqueId() theUser.save + val privacyConditionsValue: String = getWebUiPropsValue("webui_privacy_policy", "") + val termsAndConditionsValue: String = getWebUiPropsValue("webui_terms_and_conditions", "") + // User Agreement table + UserAgreementProvider.userAgreementProvider.vend.createOrUpdateUserAgreement( + theUser.user.foreign.map(_.userId).getOrElse(""), "privacy_conditions", privacyConditionsValue) + UserAgreementProvider.userAgreementProvider.vend.createOrUpdateUserAgreement( + theUser.user.foreign.map(_.userId).getOrElse(""), "terms_and_conditions", termsAndConditionsValue) if (!skipEmailValidation) { sendValidationEmail(theUser) S.notice(S.?("sign.up.message")) @@ -666,11 +674,13 @@ import net.liftweb.util.Helpers._ def agreeTermsDiv = { - val agreeTermsHtml = """
+ val webUi = new WebUI + val webUiPropsValue = getWebUiPropsValue("webui_terms_and_conditions", "") + val agreeTermsHtml = s"""
|
|
| Terms and Conditions - |
+ |
${webUi.makeHtml(webUiPropsValue)}
|
| | @@ -690,11 +700,13 @@ import net.liftweb.util.Helpers._ } def agreePrivacyPolicy = { - val agreePrivacyPolicy = """
+ val webUi = new WebUI + val webUiPropsValue = getWebUiPropsValue("webui_privacy_policy", "") + val agreePrivacyPolicy = s"""
|
|
| Privacy Policy - |
+ |
${webUi.makeHtml(webUiPropsValue)}
|
| |