Commit b4d3fe23 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

Merge branch 'testing' of...

Merge branch 'testing' of https://transfer.hft-stuttgart.de/gitlab/m4lab_tv1/user-account into devel
parents 3dbc8d04 fc808440
/node_modules /node_modules
sp-account-metadata.xml sp-account-metadata.xml
.idea
...@@ -8,12 +8,10 @@ module.exports = { ...@@ -8,12 +8,10 @@ module.exports = {
strategy: 'saml', strategy: 'saml',
saml: { saml: {
path: process.env.SAML_PATH || '/saml/SSO', path: process.env.SAML_PATH || '/saml/SSO',
//entryPoint: process.env.SAML_ENTRY_POINT || 'https://transfer.hft-stuttgart.de/idp/saml2/idp/SSOService.php',
entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php', entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php',
issuer: 'sp-account.m4lab.hft-stuttgart.de', //local metadata //issuer: 'sp-account.m4lab.hft-stuttgart.de', //local metadata
//issuer: 'sp-account-test.m4lab.hft-stuttgart.de', //testing metadata issuer: 'sp-account-testing.m4lab.hft-stuttgart.de', //testing metadata
//issuer: 'sp-account-prod.m4lab.hft-stuttgart.de', //production metadata //issuer: 'sp-account-prod.m4lab.hft-stuttgart.de', //production metadata
//logoutUrl: 'https://transfer.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php'
logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php' logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php'
} }
}, },
...@@ -23,6 +21,7 @@ module.exports = { ...@@ -23,6 +21,7 @@ module.exports = {
password: 'Stuttgart2019', // DB password password: 'Stuttgart2019', // DB password
port: 3306, // MySQL port port: 3306, // MySQL port
dbUser: 'userdb', // User DB dbUser: 'userdb', // User DB
host_project: 'm4lab.hft-stuttgart.de', // DB host project db
dbProject: 'projectDB' // Project DB dbProject: 'projectDB' // Project DB
}, },
mailer: { mailer: {
......
...@@ -51,7 +51,7 @@ var dbconn = function dbconn(query, values, next) { ...@@ -51,7 +51,7 @@ var dbconn = function dbconn(query, values, next) {
// ==== PROJECT DB CONNECTION ==== // ==== PROJECT DB CONNECTION ====
var projectConnection = mysql.createConnection({ var projectConnection = mysql.createConnection({
host: config.database.host, host: config.database.host_project,
user: config.database.user, user: config.database.user,
password: config.database.password, password: config.database.password,
port: config.database.port, port: config.database.port,
......
...@@ -139,6 +139,12 @@ var methods = { ...@@ -139,6 +139,12 @@ var methods = {
callback(rows[0], err); callback(rows[0], err);
}) })
}, },
getAllMailinglists: function(callback) {
dbconn.project.query('CALL getAllLists', function (err, rows, fields){
if (err) throw err;
callback(rows[0], err);
})
},
addProjectOverview: function(data, callback) { addProjectOverview: function(data, callback) {
dbconn.project.query('INSERT INTO project_overview SET ?', data, function (err, rows, fields){ dbconn.project.query('INSERT INTO project_overview SET ?', data, function (err, rows, fields){
if (err) throw err; if (err) throw err;
......
...@@ -62,7 +62,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -62,7 +62,7 @@ module.exports = function (app, config, passport, i18n) {
failureFlash: true failureFlash: true
}), }),
function (req, res) { function (req, res) {
res.redirect('/'); res.redirect('/account/');
} }
); );
...@@ -104,7 +104,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -104,7 +104,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}) })
} else { } else {
res.redirect('/login'); // localhost res.redirect('/account/login'); // localhost
} }
}); });
...@@ -122,7 +122,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -122,7 +122,7 @@ module.exports = function (app, config, passport, i18n) {
app.get('/logout', function (req, res) { app.get('/logout', function (req, res) {
if (req.user == null) { if (req.user == null) {
return res.redirect('https://m4lab.hft-stuttgart.de'); return res.redirect('/account/');
} }
req.user.nameID = req.user.id; req.user.nameID = req.user.id;
...@@ -153,7 +153,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -153,7 +153,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}) })
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -217,7 +217,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -217,7 +217,7 @@ module.exports = function (app, config, passport, i18n) {
} }
]) ])
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -227,7 +227,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -227,7 +227,7 @@ module.exports = function (app, config, passport, i18n) {
user: req.user // useful for view engine, useless for HTML user: req.user // useful for view engine, useless for HTML
}); });
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -253,11 +253,11 @@ module.exports = function (app, config, passport, i18n) { ...@@ -253,11 +253,11 @@ module.exports = function (app, config, passport, i18n) {
else { else {
req.flash('success', 'Profile updated!'); req.flash('success', 'Profile updated!');
} }
res.redirect('/profile'); res.redirect('lang+/account/profile');
}) })
} }
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -272,7 +272,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -272,7 +272,7 @@ module.exports = function (app, config, passport, i18n) {
// Load hashed passwd from DB // Load hashed passwd from DB
dbconn.user.query('SELECT password FROM credential WHERE user_id='+userId, function (err, rows, fields) { dbconn.user.query('SELECT password FROM credential WHERE user_id='+userId, function (err, rows, fields) {
if (err) { if (err) {
res.redirect('/500') res.redirect('/account/500')
throw err throw err
} }
var userPwd = rows[0].password var userPwd = rows[0].password
...@@ -280,21 +280,19 @@ module.exports = function (app, config, passport, i18n) { ...@@ -280,21 +280,19 @@ module.exports = function (app, config, passport, i18n) {
// check if the password is correct // check if the password is correct
bcrypt.compare(currPwd, userPwd, function(err, isMatch) { bcrypt.compare(currPwd, userPwd, function(err, isMatch) {
if (err) { if (err) {
res.redirect('/500') res.redirect('/account/500')
throw err throw err
} }
else if (!isMatch) { else if (!isMatch) {
//req.flash('error', "Sorry, your password was incorrect. Please double-check your password.") //req.flash('error', "Sorry, your password was incorrect. Please double-check your password.")
req.flash('error', "Das Passwort ist leider falsch. Bitte überprüfen Sie Ihre Eingabe.") req.flash('error', "Das Passwort ist leider falsch. Bitte überprüfen Sie Ihre Eingabe.")
//res.redirect('/account/security') //res.redirect('/account/security')
res.redirect('/security') res.redirect('/account/security')
} }
else { else {
if ( newPwd != retypePwd ) { if ( newPwd != retypePwd ) {
//req.flash('error', "Passwords do no match. Please make sure you re-type your new password correctly.")
req.flash('error', "Passwords do no match. Please make sure you re-type your new password correctly.") req.flash('error', "Passwords do no match. Please make sure you re-type your new password correctly.")
//res.redirect('/account/security') res.redirect(lang+'/account/security')
res.redirect('/security')
} }
else { else {
// update password // update password
...@@ -323,8 +321,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -323,8 +321,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}); });
} }
//res.redirect('/account/security') res.redirect('/account/security')
res.redirect('/security')
}) })
}); });
}); });
...@@ -336,7 +333,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -336,7 +333,7 @@ module.exports = function (app, config, passport, i18n) {
}) })
} }
else { else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -412,7 +409,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -412,7 +409,7 @@ module.exports = function (app, config, passport, i18n) {
req.flash('success', 'Wenn Ihre E-Mail-Adresse registriert ist, wurde eine E-Mail mit dem weiteren Vorgehen an ' + emailAddress + ' versendet.'); req.flash('success', 'Wenn Ihre E-Mail-Adresse registriert ist, wurde eine E-Mail mit dem weiteren Vorgehen an ' + emailAddress + ' versendet.');
} }
//res.redirect('/account/forgotPwd'); // deployment //res.redirect('/account/forgotPwd'); // deployment
res.redirect('/forgotPwd'); // localhost res.redirect('/account/forgotPwd'); // localhost
}); });
}); });
...@@ -422,7 +419,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -422,7 +419,7 @@ module.exports = function (app, config, passport, i18n) {
//req.flash('error', 'Password reset token is invalid or has expired.'); //req.flash('error', 'Password reset token is invalid or has expired.');
req.flash('error', 'Der Schlüssel zum zurücksetzen des Passworts ist ungültig oder abgelaufen.'); req.flash('error', 'Der Schlüssel zum zurücksetzen des Passworts ist ungültig oder abgelaufen.');
//res.redirect('/account/forgotPwd'); // deployment //res.redirect('/account/forgotPwd'); // deployment
res.redirect('/forgotPwd'); // localhost res.redirect('/account/forgotPwd'); // localhost
} }
else { else {
res.render(lang+'/account/reset'); res.render(lang+'/account/reset');
...@@ -461,7 +458,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -461,7 +458,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}); });
// redirect to login page // redirect to login page
res.redirect('/login') res.redirect('/account/login')
} }
}) })
}); });
...@@ -469,7 +466,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -469,7 +466,7 @@ module.exports = function (app, config, passport, i18n) {
} }
else { else {
req.flash('error', "User not found.") req.flash('error', "User not found.")
res.redirect('/login') res.redirect('/account/login')
} }
}); });
...@@ -515,8 +512,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -515,8 +512,7 @@ module.exports = function (app, config, passport, i18n) {
//req.flash('success', 'Your account has been created. Please log in.') //req.flash('success', 'Your account has been created. Please log in.')
req.flash('success', 'Ihr Benutzerkonto wurde angelegt. Bitte melden Sie sich an.') req.flash('success', 'Ihr Benutzerkonto wurde angelegt. Bitte melden Sie sich an.')
} }
//res.redirect('/account/registration'); // deployment res.redirect('/account/registration');
res.redirect('/registration'); // localhost
}) })
}); });
}); });
......
...@@ -34,9 +34,9 @@ html(lang="de") ...@@ -34,9 +34,9 @@ html(lang="de")
h5 h5
span #{user.firstname} #{user.lastname} span #{user.firstname} #{user.lastname}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical") div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="/profile" aria-selected="true") Benutzerprofil a(class="nav-link" href="/account/profile" aria-selected="true") Benutzerprofil
a(class="nav-link" href="/security" aria-selected="false") Sicherheitseinstellungen a(class="nav-link" href="/account/security" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="/services" aria-selected="false") Projekte und Dienste a(class="nav-link" href="/account/services" aria-selected="false") Projekte und Dienste
div(class="col-sm-9") div(class="col-sm-9")
p content goes here p content goes here
......
...@@ -35,8 +35,8 @@ html(lang="de") ...@@ -35,8 +35,8 @@ html(lang="de")
span #{user.firstname} #{user.lastname} span #{user.firstname} #{user.lastname}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical") div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="#" aria-selected="true") Benutzerprofil a(class="nav-link" href="#" aria-selected="true") Benutzerprofil
a(class="nav-link" href="/security" aria-selected="false") Sicherheitseinstellungen a(class="nav-link" href="/account/security" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="/services" aria-selected="false") Projekte und Dienste a(class="nav-link" href="/account/services" aria-selected="false") Projekte und Dienste
div(class="col-sm-9") div(class="col-sm-9")
if successes if successes
for success in successes for success in successes
......
...@@ -37,9 +37,9 @@ html(lang="de") ...@@ -37,9 +37,9 @@ html(lang="de")
h5 h5
span #{user.firstName} #{user.lastName} span #{user.firstName} #{user.lastName}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical") div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="/profile" aria-selected="true") Benutzerprofil a(class="nav-link" href="/account/profile" aria-selected="true") Benutzerprofil
a(class="nav-link" href="#" aria-selected="false") Sicherheitseinstellungen a(class="nav-link" href="#" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="/services" aria-selected="false") Projekte und Dienste a(class="nav-link" href="/account/services" aria-selected="false") Projekte und Dienste
div(class="col-sm-9") div(class="col-sm-9")
if successes if successes
for success in successes for success in successes
......
...@@ -34,8 +34,8 @@ html(lang="de") ...@@ -34,8 +34,8 @@ html(lang="de")
h5 h5
span #{user.firstName} #{user.lastName} span #{user.firstName} #{user.lastName}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical") div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="/profile" aria-selected="true") Benutzerprofil a(class="nav-link" href="/account/profile" aria-selected="true") Benutzerprofil
a(class="nav-link" href="/security" aria-selected="false") Sicherheitseinstellungen a(class="nav-link" href="/account/security" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="#" aria-selected="false") Projekte und Dienste a(class="nav-link" href="#" aria-selected="false") Projekte und Dienste
div(class="col-sm-9") div(class="col-sm-9")
if successes if successes
......
html(lang="de")
head
title= "Mailinglisten"
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no")
link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/bootstrap/bootstrap.css")
link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
style.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
<hr />
div()
h5(align="left") Aktive Mailinglisten
div(class="flex-container" style="align-items:flex-start")
div(class="table")
table(border="0" id="listtable" class="table table-striped")
thead
tr
th Name
th Link
th zugeh. Projekt
tbody
for item in mailinglists
if item.projectstatus == '1'
tr
td #{item.name}
td <a href="#{item.src}">#{item.src}</a>
td <a href='projectoverview?projectID=#{item.id}'>#{item.project_title}</a>
<hr />
div()
h5(align="left") Eintragung in Mailingliste
p() Wenn Sie sich in eine Mailingliste eintragen wollen, folgen Sie folgender Anleitung:
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header
if isUserAuthenticated
script(src="/js/headfootLogout.js")
else
script(src="https://transfer.hft-stuttgart.de/js/headfoot.js")
\ No newline at end of file
html(lang="de")
head
title= "Mailinglisten"
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no")
link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/bootstrap/bootstrap.css")
link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
style.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
<hr />
div()
h5(align="left") Aktive Mailinglisten
div(class="flex-container" style="align-items:flex-start")
div(class="table")
table(border="0" id="listtable" class="table table-striped")
thead
tr
th Name
th Link
th zugeh. Projekt
tbody
for item in mailinglists
if item.projectstatus == '1'
tr
td #{item.name}
td <a href="#{item.src}">#{item.src}</a>
td <a href='projectoverview?projectID=#{item.id}'>#{item.project_title}</a>
<hr />
div()
h5(align="left") Eintragung in Mailingliste
p() Wenn Sie sich in eine Mailingliste eintragen wollen, folgen Sie folgender Anleitung:
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header
if isUserAuthenticated
script(src="/js/headfootLogout.js")
else
script(src="https://transfer.hft-stuttgart.de/js/headfoot.js")
\ No newline at end of file
Supports Markdown
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