From 1e6d4bb8b3d0f8d1e20bf9d04e24b0b2b00e61b0 Mon Sep 17 00:00:00 2001 From: Gradido2 Date: Fri, 10 Jul 2020 16:28:05 +0000 Subject: [PATCH 1/3] starting styles --- src/cpsp/footer.cpsp | 16 +++++- src/cpsp/header.cpsp | 36 ++++++------ src/cpsp/resetPassword.cpsp | 109 ++++++++++++++++-------------------- 3 files changed, 78 insertions(+), 83 deletions(-) diff --git a/src/cpsp/footer.cpsp b/src/cpsp/footer.cpsp index 138607f4d..0117affe0 100644 --- a/src/cpsp/footer.cpsp +++ b/src/cpsp/footer.cpsp @@ -1,5 +1,15 @@ -
- <%= mTimeProfiler.string() %> -
+
+

Copyright © Gradido 2020

+
+ +
+ <%= mTimeProfiler.string() %> +
+
+

Login Server in Entwicklung

+

Alpha <%= ServerConfig::g_versionString %>

+
+ + \ No newline at end of file diff --git a/src/cpsp/header.cpsp b/src/cpsp/header.cpsp index 0a413dd46..6e93f4b93 100644 --- a/src/cpsp/header.cpsp +++ b/src/cpsp/header.cpsp @@ -1,7 +1,7 @@ -<%! -#include "../ServerConfig.h" -%><%% - bool withMaterialIcons = false; +<%! +#include "../ServerConfig.h" +%><%% + bool withMaterialIcons = false; %> @@ -9,21 +9,21 @@ Gradido Login Server: <%= pageName %> - + <% if(withMaterialIcons) { %> <% } %> - -
-

Login Server in Entwicklung

-

Alpha <%= ServerConfig::g_versionString %>

-
- \ No newline at end of file + +
+
+ + <%= getErrorsHtml() %> diff --git a/src/cpsp/resetPassword.cpsp b/src/cpsp/resetPassword.cpsp index 1b423ce3c..ebd6abd21 100644 --- a/src/cpsp/resetPassword.cpsp +++ b/src/cpsp/resetPassword.cpsp @@ -3,79 +3,79 @@ <%@ page baseClass="PageRequestMessagedHandler" %> <%@ header include="PageRequestMessagedHandler.h" %> <%@ page compressed="true" %> -<%! +<%! #include "../SingletonManager/LanguageManager.h" #include "../SingletonManager/SessionManager.h" #include "../SingletonManager/EmailManager.h" #include "../controller/User.h" #include "../controller/UserBackups.h" - + enum PageState { PAGE_EMAIL_ASK, PAGE_ASK, PAGE_WAIT_EMAIL, PAGE_WAIT_ADMIN, PAGE_EMAIL_ALREADY_SEND - + }; -%><%% +%><%% PageState state = PAGE_EMAIL_ASK; auto lm = LanguageManager::getInstance(); auto sm = SessionManager::getInstance(); auto adminReceiver = EmailManager::getInstance()->getAdminReceiver(); - + const char* pageName = "Passwort vergessen"; auto lang = chooseLanguage(request); - + // class="btn btn-outline-secondary flag-btn" // class="btn btn-secondary disabled flag-btn" disabled std::string eng_btn_classes = ""; std::string de_btn_classes = ""; - + auto langCatalog = lm->getFreeCatalog(lang); - + std::string emailInputClass = "form-control"; std::string passphraseRadioClass = "group"; - + std::string email = ""; - + if(!form.empty()) { - auto session = sm->getNewSession(); + auto session = sm->getNewSession(); email = form.get("email", ""); auto passphraseMemorized = form.get("passphrase_memorized", ""); auto user = controller::User::create(); auto ask = form.get("ask_passphrase", ""); - - if(email != "") + + if(email != "") { bool user_exist = false; bool sendUserEmail = false; - + if(!sm->isValid(email, VALIDATE_EMAIL)) { addError(new Error(gettext(session, "E-Mail"), gettext(session, "Das ist keine gültige E-Mail Adresse")), false); - emailInputClass += " is-invalid"; + emailInputClass += " is-invalid"; } user_exist = user->load(email) == 1; - - if(ask == "true") + + if(ask == "true") { if(passphraseMemorized == "") { addError(new Error(gettext(session, "Passphrase"), gettext(session, "Bitte wähle eine Option aus.")), false); - passphraseRadioClass += " group-is-invalid"; + passphraseRadioClass += " group-is-invalid"; } else if(passphraseMemorized == "true") { sendUserEmail = true; } - - } + + } else { if(user_exist && (!user->tryLoadPassphraseUserBackup() || !user->hasPublicKey())) { sendUserEmail = true; } } - - if(!errorCount()) + + if(!errorCount()) { // send reset password email int result = 0; @@ -90,56 +90,41 @@ enum PageState { } else { state = PAGE_WAIT_ADMIN; } - } - } - else + } + } + else { addError(new Error(gettext(session, "E-Mail"), gettext(session, "E-Mail Adresse nicht angegeben.")), false); - emailInputClass += " is-invalid"; + emailInputClass += " is-invalid"; } - - } - - -%><%@ include file="login_header.cpsp" %> - + } + + +%><%@ include file="header.cpsp" %> <% if(state == PAGE_EMAIL_ASK) { %> -
-
-
- - -
- -
-
+
+
+

Passwort zurücksetzen

+
+
+
+
+
+ + +
+ +
+
<% } else if(state == PAGE_ASK) { %> <%@ include file="flags.cpsp" %>
- + - +
@@ -166,7 +151,7 @@ enum PageState {

<%= langCatalog->gettext("Du hast wirklich keine E-Mail erhalten und auch schon ein paar Minuten gewartet?") %>

<%= langCatalog->gettext("E-Mail an Support schicken")%>

<% } %> -
+
From bcb8aafae2e56bf303d1f5cc7c362c144dfd0c16 Mon Sep 17 00:00:00 2001 From: Gradido2 Date: Tue, 14 Jul 2020 11:51:05 +0000 Subject: [PATCH 2/3] more CSS --- src/cpsp/checkEmail.cpsp | 46 +++++++-------------------- src/cpsp/flags.cpsp | 30 +++++++----------- src/cpsp/resetPassword.cpsp | 63 +++++++++++++++++-------------------- 3 files changed, 52 insertions(+), 87 deletions(-) diff --git a/src/cpsp/checkEmail.cpsp b/src/cpsp/checkEmail.cpsp index 7a7922e60..7e855b84c 100644 --- a/src/cpsp/checkEmail.cpsp +++ b/src/cpsp/checkEmail.cpsp @@ -8,7 +8,7 @@ #include "../SingletonManager/SessionManager.h" #include "../SingletonManager/LanguageManager.h" #include "../SingletonManager/EmailManager.h" -enum PageState +enum PageState { MAIL_NOT_SEND, ASK_VERIFICATION_CODE, @@ -20,20 +20,20 @@ enum PageState const char* pageName = "Email Verification"; auto lm = LanguageManager::getInstance(); auto em = EmailManager::getInstance(); - + auto lang = chooseLanguage(request); auto langCatalog = lm->getFreeCatalog(lang); unsigned long long verificationCode = 0; - + PageState state = ASK_VERIFICATION_CODE; - - if(mSession && model::table::EMAIL_OPT_IN_REGISTER_DIRECT == mSession->getEmailVerificationType()) + + if(mSession && model::table::EMAIL_OPT_IN_REGISTER_DIRECT == mSession->getEmailVerificationType()) { state = EMAIL_ACTIVATED; - } + } else { - + if(!form.empty()) { auto langBtn = form.get("lang-btn", ""); auto verficationCodeStr = form.get("email-verification-code", "0"); @@ -48,11 +48,11 @@ enum PageState langCatalog = lm->getFreeCatalog(lang); } } - + // remove old cookies if exist auto sm = SessionManager::getInstance(); sm->deleteLoginCookies(request, response, mSession); - + if(mSession) { getErrors(mSession); if(mSession->getSessionState() < SESSION_STATE_EMAIL_VERIFICATION_SEND) { @@ -65,30 +65,12 @@ enum PageState } } %><%@ include file="header.cpsp" %> -
- -
-
-
-
- <%= getErrorsHtml() %> -
- @@ -96,7 +78,7 @@ enum PageState
- @@ -116,7 +98,7 @@ enum PageState

@@ -129,8 +111,4 @@ enum PageState

- -
<%@ include file="footer.cpsp" %> diff --git a/src/cpsp/flags.cpsp b/src/cpsp/flags.cpsp index 2a2f6a555..a98f823dd 100644 --- a/src/cpsp/flags.cpsp +++ b/src/cpsp/flags.cpsp @@ -1,20 +1,12 @@ +
-
-
-
- -
-
-
-
- -
-
-
-
\ No newline at end of file + + + +
\ No newline at end of file diff --git a/src/cpsp/resetPassword.cpsp b/src/cpsp/resetPassword.cpsp index ebd6abd21..104d286fd 100644 --- a/src/cpsp/resetPassword.cpsp +++ b/src/cpsp/resetPassword.cpsp @@ -16,10 +16,8 @@ enum PageState { PAGE_WAIT_EMAIL, PAGE_WAIT_ADMIN, PAGE_EMAIL_ALREADY_SEND - }; %><%% - PageState state = PAGE_EMAIL_ASK; auto lm = LanguageManager::getInstance(); auto sm = SessionManager::getInstance(); @@ -102,46 +100,46 @@ enum PageState { %><%@ include file="header.cpsp" %> - <% if(state == PAGE_EMAIL_ASK) { %>

Passwort zurücksetzen

-
+ <% if(state == PAGE_EMAIL_ASK) { %> +
- - + +
- + +
+
+
+ <% } else if(state == PAGE_ASK) { %> +
+ <%@ include file="flags.cpsp" %> +
+ + + + +
+
+ +
+
+ +
+
+
- <% } else if(state == PAGE_ASK) { %> - <%@ include file="flags.cpsp" %> -
-
-
- - - - -
-
- -
-
- -
-
-
-
-
<% } else if(state == PAGE_WAIT_EMAIL) { %> <%= langCatalog->gettext("Dir wird eine E-Mail zugeschickt um dein Passwort zurückzusetzen.") %> <% } else if(state == PAGE_WAIT_ADMIN) { %> @@ -155,9 +153,6 @@ enum PageState {
-