Commit b70b6fa2 authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

Merge branch 'testing' into 'prepare_prod'

Hide mobile menu in account pages

See merge request !128
parents ae49198c c2cab50e
...@@ -3,12 +3,13 @@ import dbconn = require('../config/dbconn') ...@@ -3,12 +3,13 @@ import dbconn = require('../config/dbconn')
var methods = { var methods = {
// ===================== user db ===================== // ===================== user db =====================
registerNewUser: function(data:any, callback:any) { registerNewUser: function(data:any, callback:any) {
dbconn.user.beginTransaction(function(err:any) { // START TRANSACTION dbconn.user.getConnection(function(err:any, thisconn){
thisconn.beginTransaction(function(err:any) { // START TRANSACTION
if (err) { throw err } if (err) { throw err }
// insert profile // insert profile
dbconn.user.query('INSERT INTO user SET ?', data.profile, function (err:any, results:any, fields:any) { thisconn.query('INSERT INTO user SET ?', data.profile, function (err:any, results:any, fields:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { return thisconn.rollback(function() {
throw err throw err
}); });
} }
...@@ -18,9 +19,9 @@ var methods = { ...@@ -18,9 +19,9 @@ var methods = {
user_id: newUserId, user_id: newUserId,
password: data.password password: data.password
} }
dbconn.user.query('INSERT INTO credential SET ?', credentialData, function (err:any, results:any, fields:any) { thisconn.query('INSERT INTO credential SET ?', credentialData, function (err:any, results:any, fields:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { return thisconn.rollback(function() {
throw err throw err
}); });
} }
...@@ -30,9 +31,9 @@ var methods = { ...@@ -30,9 +31,9 @@ var methods = {
role_id: 2, // USER role_id: 2, // USER
user_id: newUserId user_id: newUserId
} }
dbconn.user.query('INSERT INTO user_project_role SET ?', projectRoleData, function (err:any, results:any, fields:any) { thisconn.query('INSERT INTO user_project_role SET ?', projectRoleData, function (err:any, results:any, fields:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { return thisconn.rollback(function() {
throw err throw err
}); });
} }
...@@ -41,16 +42,16 @@ var methods = { ...@@ -41,16 +42,16 @@ var methods = {
user_id: newUserId, user_id: newUserId,
token: data.verificationToken token: data.verificationToken
} }
dbconn.user.query('INSERT INTO verification SET ?', verificationData, function (err:any, results:any, fields:any) { thisconn.query('INSERT INTO verification SET ?', verificationData, function (err:any, results:any, fields:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { return thisconn.rollback(function() {
throw err throw err
}); });
} }
// COMMIT // COMMIT
dbconn.user.commit(function(err:any) { thisconn.commit(function(err:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { return thisconn.rollback(function() {
throw err throw err
}) })
} }
...@@ -59,6 +60,7 @@ var methods = { ...@@ -59,6 +60,7 @@ var methods = {
}) })
}); });
}); });
});
callback(err) callback(err)
}) })
}, },
...@@ -162,26 +164,28 @@ var methods = { ...@@ -162,26 +164,28 @@ var methods = {
return null return null
}, },
verifyUserAccount: function(userData:any, callback:any) { verifyUserAccount: function(userData:any, callback:any) {
dbconn.user.beginTransaction(function(err:any) { // START TRANSACTION dbconn.user.getConnection(function(err:any, thisconn){
thisconn.beginTransaction(function(err:any) { // START TRANSACTION
if (err) { throw err } if (err) { throw err }
// update user status // update user status
dbconn.user.query('UPDATE user SET ? WHERE id =' +userData.id, userData, function (err:any, rows:any, fields:any) { thisconn.query('UPDATE user SET ? WHERE id =' +userData.id, userData, function (err:any, rows:any, fields:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { throw err }) return thisconn.rollback(function() { throw err })
} }
// delete verification token // delete verification token
dbconn.user.query('DELETE FROM verification WHERE user_id = '+userData.id, function (err:any, rows:any, fields:any) { thisconn.query('DELETE FROM verification WHERE user_id = '+userData.id, function (err:any, rows:any, fields:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { throw err }) return thisconn.rollback(function() { throw err })
} }
// COMMIT // COMMIT
dbconn.user.commit(function(err:any) { thisconn.commit(function(err:any) {
if (err) { if (err) {
return dbconn.user.rollback(function() { throw err }) return thisconn.rollback(function() { throw err })
} }
}) })
}) })
}) })
})
callback(err) callback(err)
}) })
}, },
......
...@@ -106,11 +106,15 @@ export = function (app:any, config:any, passport:any, lang:string) { ...@@ -106,11 +106,15 @@ export = function (app:any, config:any, passport:any, lang:string) {
res.redirect('/login') res.redirect('/login')
} else { } else {
let loggedInUser = await getLoggedInUserData(req.user.email) let loggedInUser = await getLoggedInUserData(req.user.email)
if (!loggedInUser) {
console.error("user data is not found")
res.status(500).render(lang+'/500', { error: "Your data is not found. Please try again." })
} else {
res.render(lang+'/account/home', { res.render(lang+'/account/home', {
user: loggedInUser user: loggedInUser
}); });
} }
}
}); });
app.get('/login', app.get('/login',
......
...@@ -6,6 +6,7 @@ html(lang="de") ...@@ -6,6 +6,7 @@ html(lang="de")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") 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/bootstrap.min.css")
link(rel="stylesheet", type="text/css", href="/css/m4lab.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/Contact-Form-Clean.css") link(rel="stylesheet", type="text/css", href="/css/Contact-Form-Clean.css")
link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
body body
...@@ -52,3 +53,4 @@ html(lang="de") ...@@ -52,3 +53,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") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB // M4_LAB
script(src="/js/headfoot.js") script(src="/js/headfoot.js")
script(src="/js/mobile.js")
...@@ -6,6 +6,7 @@ html(lang="de") ...@@ -6,6 +6,7 @@ html(lang="de")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") 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/bootstrap.min.css")
link(rel="stylesheet", type="text/css", href="/css/m4lab.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") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
body body
div(class="container") div(class="container")
...@@ -55,6 +56,7 @@ html(lang="de") ...@@ -55,6 +56,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") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB // M4_LAB
script(src="/js/headfoot.js") script(src="/js/headfoot.js")
script(src="/js/mobile.js")
script. script.
// call verifyAccount // call verifyAccount
function verify() { function verify() {
......
...@@ -6,6 +6,7 @@ html(lang="de") ...@@ -6,6 +6,7 @@ html(lang="de")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") 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/bootstrap.min.css")
link(rel="stylesheet", type="text/css", href="/css/m4lab.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") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
body body
div(class="container") div(class="container")
...@@ -49,7 +50,7 @@ html(lang="de") ...@@ -49,7 +50,7 @@ html(lang="de")
a(class="close", href="#", data-dismiss="alert", aria-label="close") × a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
h3(class="pb-2") Mein Profil h3(class="pb-2") Mein Profil
form#profileForm(method="POST", action="/updateProfile") form#profileForm(method="POST", action="/account/updateProfile")
div(class="form-row") div(class="form-row")
div(class='form-group col-md-2') div(class='form-group col-md-2')
label(for="title") Anrede label(for="title") Anrede
...@@ -108,3 +109,4 @@ html(lang="de") ...@@ -108,3 +109,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") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB // M4_LAB
script(src="/js/headfoot.js") script(src="/js/headfoot.js")
script(src="/js/mobile.js")
...@@ -6,6 +6,7 @@ html(lang="de") ...@@ -6,6 +6,7 @@ html(lang="de")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") 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/bootstrap.min.css")
link(rel="stylesheet", type="text/css", href="/css/m4lab.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") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
style. style.
.warning { .warning {
...@@ -73,6 +74,7 @@ html(lang="de") ...@@ -73,6 +74,7 @@ html(lang="de")
script(src="/js/security.js") script(src="/js/security.js")
script(src="/js/generalFunction.js") script(src="/js/generalFunction.js")
script(src="/js/headfoot.js") script(src="/js/headfoot.js")
script(src="/js/mobile.js")
script. script.
// check input fields // check input fields
'use strict'; 'use strict';
......
...@@ -6,6 +6,7 @@ html(lang="de") ...@@ -6,6 +6,7 @@ html(lang="de")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") 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/bootstrap.min.css")
link(rel="stylesheet", type="text/css", href="/css/m4lab.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") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
body body
div(class="container") div(class="container")
...@@ -94,3 +95,4 @@ html(lang="de") ...@@ -94,3 +95,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") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB // M4_LAB
script(src="/js/headfoot.js") script(src="/js/headfoot.js")
script(src="/js/mobile.js")
\ No newline at end of file
...@@ -130,7 +130,7 @@ html(lang="de") ...@@ -130,7 +130,7 @@ html(lang="de")
| <p>Sie sind dabei, diese Webseite, ihr Repositorium und alle zugehörigen Ressourcen, inklusive aller Inhalte, Bilder etc. endgültig zu löschen.</p> | <p>Sie sind dabei, diese Webseite, ihr Repositorium und alle zugehörigen Ressourcen, inklusive aller Inhalte, Bilder etc. endgültig zu löschen.</p>
| <p>Sobald eine Webseite endgültig gelöscht ist, kann sie nicht wiederhergestellt werden. <strong>Diese Aktion kann nicht rückgängig gemacht werden.</strong></p> | <p>Sobald eine Webseite endgültig gelöscht ist, kann sie nicht wiederhergestellt werden. <strong>Diese Aktion kann nicht rückgängig gemacht werden.</strong></p>
div(class="modal-footer") div(class="modal-footer")
form(method="POST", action="/deleteProject?_method=DELETE", encType="multipart/form-data") form(method="POST", action="/account/deleteProject?_method=DELETE", encType="multipart/form-data")
input(name="id", value=information.id, type="hidden") input(name="id", value=information.id, type="hidden")
button(type="button" class="btn btn-primary mx-2" data-dismiss="modal") Abbrechen, Webseite behalten button(type="button" class="btn btn-primary mx-2" data-dismiss="modal") Abbrechen, Webseite behalten
button(type="submit" class="btn btn-danger") Ja, Webseite löschen button(type="submit" class="btn btn-danger") Ja, Webseite löschen
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment