From d9671495d9a36dd7f72f47a95bac464ecf594fd4 Mon Sep 17 00:00:00 2001 From: Athanasios Date: Wed, 10 Nov 2021 13:16:25 +0100 Subject: [PATCH 1/6] Hide mobile menu in account pages pages: /newInformation --- views/DE/account/newInformation.pug | 2 ++ 1 file changed, 2 insertions(+) diff --git a/views/DE/account/newInformation.pug b/views/DE/account/newInformation.pug index 21788f6a..4d82fe0d 100644 --- a/views/DE/account/newInformation.pug +++ b/views/DE/account/newInformation.pug @@ -6,6 +6,7 @@ html(lang="de") meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") link(rel="stylesheet", type="text/css", href="/css/bootstrap.min.css") link(rel="stylesheet", type="text/css", href="/css/m4lab.css") + link(rel="stylesheet", type="text/css", href="/css/m4lab-mobile.css") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous") body div(class="container") @@ -99,6 +100,7 @@ html(lang="de") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") // M4_LAB script(src="/js/headfoot.js") + script(src="/js/mobile.js") script. // website URL function showWebsiteURL() { -- GitLab From 7d6fb0d08807dddb36cb5c46062d17af5091afdc Mon Sep 17 00:00:00 2001 From: Rosanny Date: Tue, 22 Mar 2022 15:25:04 +0100 Subject: [PATCH 2/6] MLAB-643: fixing UI issues --- views/DE/account/forgotPwd.pug | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/DE/account/forgotPwd.pug b/views/DE/account/forgotPwd.pug index 07e90a89..4827e727 100644 --- a/views/DE/account/forgotPwd.pug +++ b/views/DE/account/forgotPwd.pug @@ -6,6 +6,7 @@ html(lang="de") meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") link(rel="stylesheet", type="text/css", href="/css/bootstrap.min.css") link(rel="stylesheet", type="text/css", href="/css/m4lab.css") + link(rel="stylesheet", type="text/css", href="/css/m4lab-mobile.css") link(rel="stylesheet", type="text/css", href="/css/custom/login.css") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous") body @@ -19,7 +20,7 @@ html(lang="de") div.alert.alert-danger.alert-dismissible.fade.show #{flash.error} a(class="close", href="#", data-dismiss="alert", aria-label="close") × form#forgotForm(class="form-signin", method="POST") - img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192") + img(src="https://transfer.hft-stuttgart.de/img/M4_LAB_LOGO.png", class="img-responsive center-block", width="185", height="192") div(class="form-row") input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="E-Mail-Adresse" required) br @@ -32,3 +33,4 @@ html(lang="de") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") // M4_LAB script(src="/js/headfoot.js") + script(src="/js/mobile.js") -- GitLab From 86921a8f16d44aa4c8e0fde0d1f87e77e4b9ab6a Mon Sep 17 00:00:00 2001 From: Rosanny Date: Tue, 22 Mar 2022 15:40:39 +0100 Subject: [PATCH 3/6] fix UI issue in Reset Password page (cherry picked from commit fa976f4bb86a6397160edd25b40fc1b5a224aa50) --- views/DE/account/reset.pug | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/DE/account/reset.pug b/views/DE/account/reset.pug index a6ef872a..e81e1166 100644 --- a/views/DE/account/reset.pug +++ b/views/DE/account/reset.pug @@ -6,6 +6,7 @@ html(lang="de") meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") link(rel="stylesheet", type="text/css", href="/css/bootstrap.min.css") link(rel="stylesheet", type="text/css", href="/css/m4lab.css") + link(rel="stylesheet", type="text/css", href="/css/m4lab-mobile.css") link(rel="stylesheet", type="text/css", href="/css/custom/login.css") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous") body @@ -21,7 +22,7 @@ html(lang="de") div.alert.alert-danger.alert-dismissible.fade.show #{ error } a(class="close", href="#", data-dismiss="alert", aria-label="close") × form#forgotForm(method="POST", class="form-signin") - img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192") + img(src="https://transfer.hft-stuttgart.de/img/M4_LAB_LOGO.png", class="img-responsive center-block", width="185", height="192") div(class="form-row") input#inputNewPwd(name="inputNewPwd", type="password", class="form-control", placeholder="Neues Passwort" required) span#recommendation(class='warning') @@ -38,3 +39,4 @@ html(lang="de") script(src="/js/security.js") script(src="/js/generalFunction.js") script(src="/js/headfoot.js") + script(src="/js/mobile.js") \ No newline at end of file -- GitLab From c78063ce0dcb48a09e825989d4756562c2f8dd9a Mon Sep 17 00:00:00 2001 From: Rosanny Date: Tue, 22 Mar 2022 17:18:39 +0100 Subject: [PATCH 4/6] MLAB-642: change var to let (cherry picked from commit 2273844d953a00f49be3ac6bf338c551c6759fcd) --- routes/public.ts | 68 ++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/routes/public.ts b/routes/public.ts index f535b5e2..a0714532 100644 --- a/routes/public.ts +++ b/routes/public.ts @@ -15,8 +15,8 @@ export = function (app:any, config:any, lang:string) { }) app.post('/registration', function(req:any, res:any) { // user data - var curDate:Date = new Date() - var userData:any = { + let curDate:Date = new Date() + let userData:any = { salutation: req.body.inputSalutation, title: req.body.inputTitle, firstname: req.body.inputFirstname, @@ -28,10 +28,10 @@ export = function (app:any, config:any, lang:string) { createdDate: curDate.toISOString().slice(0,10) } - var userEmail:any = userData.email - var pos:number = userEmail.indexOf('@') - var emailLength:number = userEmail.length - var emailDomain:any = userEmail.slice(pos, emailLength); + let userEmail:any = userData.email + let pos:number = userEmail.indexOf('@') + let emailLength:number = userEmail.length + let emailDomain:any = userEmail.slice(pos, emailLength); if ( emailDomain.toLowerCase() == "@hft-stuttgart.de") { res.flash('error', "Fehlgeschlagen: HFT-Account") @@ -48,7 +48,7 @@ export = function (app:any, config:any, lang:string) { // encrypt password bcrypt.genSalt(saltRounds, function(err, salt) { bcrypt.hash(req.body.inputPassword, salt, function(err:any, hash:any) { - var newAccount:any = { + let newAccount:any = { profile: userData, password: hash, verificationToken: token @@ -65,8 +65,8 @@ export = function (app:any, config:any, lang:string) { } else { // send email - var emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto" - var emailContent = '
Lieber Nutzer,

' + + let emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto" + let emailContent = '
Lieber Nutzer,

' + '

vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart.
' + 'Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link ' + '

' + @@ -134,23 +134,23 @@ export = function (app:any, config:any, lang:string) { }) } else { // send email - var emailSubject = "Herzlich willkommen" - var emailContent = '

Lieber Nutzer,

' + - '

herzlich willkommen beim Transferportal der HFT Stuttgart!
' + - 'Sie können nun alle Dienste des Portals nutzen.


' + constants.mailSignature; - mailer.options.to = userEmail - mailer.options.subject = emailSubject - mailer.options.html = emailContent - mailer.transporter.sendMail(mailer.options, function(err:any) { - if (err) { - console.log('cannot send email') - throw err - } - }) + let emailSubject = "Herzlich willkommen"; + let emailContent = '

Lieber Nutzer,

' + + '

herzlich willkommen beim Transferportal der HFT Stuttgart!
' + + 'Sie können nun alle Dienste des Portals nutzen.


' + constants.mailSignature; + mailer.options.to = userEmail; + mailer.options.subject = emailSubject; + mailer.options.html = emailContent; + mailer.transporter.sendMail(mailer.options, function(err:any) { + if (err) { + console.log('cannot send email'); + throw err; + } + }) - res.render(lang+'/account/verification', { - status: true - }) + res.render(lang+'/account/verification', { + status: true + }) } } }) @@ -179,13 +179,13 @@ export = function (app:any, config:any, lang:string) { token += randomChars.charAt(Math.floor(Math.random() * randomChars.length)); } - var emailSubject = "Ihre Passwort-Anfrage an das Transferportal der HFT Stuttgart"; - var emailContent = '

Lieber Nutzer,

' + + let emailSubject = "Ihre Passwort-Anfrage an das Transferportal der HFT Stuttgart"; + let emailContent = '
Lieber Nutzer,

' + '

wir haben Ihre Anfrage zur Erneuerung Ihres Passwortes erhalten. Falls Sie diese Anfrage nicht gesendet haben, ignorieren Sie bitte diese E-Mail.

' + 'Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: '+config.app.host+'/reset/' + token + '
' + 'Dieser Link ist aus Sicherheitsgründen nur für 1 Stunde gültig.

' + constants.mailSignature + '
' - var credentialData = { + let credentialData = { user_id: user.id, resetPasswordToken: token, resetPasswordExpires: Date.now() + 3600000 // 1 hour @@ -227,9 +227,9 @@ export = function (app:any, config:any, lang:string) { } }) app.post('/reset/:token', async function(req:any, res:any) { - var newPwd = req.body.inputNewPwd + let newPwd = req.body.inputNewPwd - var user = await methods.getUserByToken(req.params.token) + let user = await methods.getUserByToken(req.params.token) if (!user) { res.flash('error', "User not found.") res.redirect('/login') @@ -267,9 +267,9 @@ export = function (app:any, config:any, lang:string) { // ======================= CONTACT FORM =========================== app.get('/contact', function (req:any, res:any) { - res.render(lang+'/account/contact', { - user: req.user - }) + res.render(lang+'/account/contact', { + user: req.user + }) }) app.post('/contact', function(req:any, res:any, next:any) { //methods.currentDate(); @@ -277,8 +277,8 @@ export = function (app:any, config:any, lang:string) { let supportAddress = "support-transfer@hft-stuttgart.de"; let inputName = req.body.name; let inputContent = req.body.message; - let emailContent = "Es wurde eine Anfrage an das Transferportal gestellt: \n\n NAME: " + inputName + "\n NACHRICHT:\n "+ inputContent; let emailSubject = "Ihre Anfrage an das Transferportal"; + let emailContent = "Es wurde eine Anfrage an das Transferportal gestellt: \n\n NAME: " + inputName + "\n NACHRICHT:\n "+ inputContent; async.waterfall([ function(done:any) { // send email -- GitLab From ef977518050ea34c757091e952ed5b82b45f5e23 Mon Sep 17 00:00:00 2001 From: Rosanny Date: Tue, 22 Mar 2022 19:56:12 +0100 Subject: [PATCH 5/6] MLAB-642: fixing email content (cherry picked from commit c4758596ba19f4af80c71ad8021213aeedcd1141) --- routes/public.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/public.ts b/routes/public.ts index a0714532..8fe48b93 100644 --- a/routes/public.ts +++ b/routes/public.ts @@ -285,7 +285,7 @@ export = function (app:any, config:any, lang:string) { mailer.options.to = supportAddress; mailer.options.cc = emailAddress; mailer.options.subject = emailSubject; - mailer.options.text = emailContent; + mailer.options.html = emailContent; mailer.transporter.sendMail(mailer.options, function(err:any) { done(err, 'done'); }); -- GitLab From 3c40c133a517685330d97740a61cff483e9590aa Mon Sep 17 00:00:00 2001 From: Rosanny Date: Tue, 22 Mar 2022 20:03:56 +0100 Subject: [PATCH 6/6] MLAB-642: fixing the content format (cherry picked from commit fbf59c98892ff353a0078521a6a32772f9503aab) --- routes/public.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/public.ts b/routes/public.ts index 8fe48b93..9f57ad15 100644 --- a/routes/public.ts +++ b/routes/public.ts @@ -278,7 +278,7 @@ export = function (app:any, config:any, lang:string) { let inputName = req.body.name; let inputContent = req.body.message; let emailSubject = "Ihre Anfrage an das Transferportal"; - let emailContent = "Es wurde eine Anfrage an das Transferportal gestellt: \n\n NAME: " + inputName + "\n NACHRICHT:\n "+ inputContent; + let emailContent = "
Es wurde eine Anfrage an das Transferportal gestellt:

NAME: " + inputName + "
NACHRICHT: "+ inputContent+"
"; async.waterfall([ function(done:any) { // send email -- GitLab