Commit 2d63274c authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

MLAB-227: prevent HFT account to access "security" page

parent 415db369
This commit is part of merge request !37. Comments created here will be created in the context of that merge request.
Showing with 17 additions and 15 deletions
+17 -15
...@@ -69,7 +69,7 @@ var methods = { ...@@ -69,7 +69,7 @@ var methods = {
}) })
}, },
getUserByEmail: function(email, callback) { getUserByEmail: function(email, callback) {
dbconn.user.query('SELECT verificationStatus, salutation, title, firstname, lastname, industry, organisation, speciality FROM user WHERE email = "' +email+'"', function (err, rows, fields) { dbconn.user.query('SELECT verificationStatus, salutation, title, firstname, lastname, industry, organisation, speciality, m4lab_idp FROM user WHERE email = "' +email+'"', function (err, rows, fields) {
if (err) { if (err) {
throw err; throw err;
} }
......
...@@ -240,8 +240,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -240,8 +240,7 @@ module.exports = function (app, config, passport, i18n) {
if (req.isAuthenticated()) { if (req.isAuthenticated()) {
methods.getUserByEmail(req.user.email, function(data, err){ methods.getUserByEmail(req.user.email, function(data, err){
if (!err) { if (!err) {
if (data.verificationStatus == 1) { if (data.verificationStatus == 1 && data.m4lab_idp == 1) {
console.log(data)
res.render(lang+'/account/security', { res.render(lang+'/account/security', {
user: data user: data
}) })
......
...@@ -29,10 +29,11 @@ html(lang="de") ...@@ -29,10 +29,11 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/profile") a(class="nav-link pl-0" href="/account/profile")
i(class="fa fa-user fa-fw") i(class="fa fa-user fa-fw")
span(class="d-none d-md-inline") Benutzerprofil span(class="d-none d-md-inline") Benutzerprofil
li(class="nav-item") if user.m4lab_idp == 1
a(class="nav-link pl-0" href="/account/security") li(class="nav-item")
i(class="fa fa-lock fa-fw") a(class="nav-link pl-0" href="/account/security")
span(class="d-none d-md-inline") Sicherheitseinstellungen i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item") li(class="nav-item")
a(class="nav-link pl-0" href="/account/services") a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw") i(class="fa fa-tasks fa-fw")
......
...@@ -20,10 +20,11 @@ html(lang="de") ...@@ -20,10 +20,11 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/profile") a(class="nav-link pl-0" href="/account/profile")
i(class="fa fa-user fa-fw" style="color:black;") i(class="fa fa-user fa-fw" style="color:black;")
span(class="d-none d-md-inline" style="color:black;") Benutzerprofil span(class="d-none d-md-inline" style="color:black;") Benutzerprofil
li(class="nav-item") if user.m4lab_idp == 1
a(class="nav-link pl-0" href="/account/security") li(class="nav-item")
i(class="fa fa-lock fa-fw") a(class="nav-link pl-0" href="/account/security")
span(class="d-none d-md-inline") Sicherheitseinstellungen i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item") li(class="nav-item")
a(class="nav-link pl-0" href="/account/services") a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw") i(class="fa fa-tasks fa-fw")
......
...@@ -20,10 +20,11 @@ html(lang="de") ...@@ -20,10 +20,11 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/profile") a(class="nav-link pl-0" href="/account/profile")
i(class="fa fa-user fa-fw") i(class="fa fa-user fa-fw")
span(class="d-none d-md-inline") Benutzerprofil span(class="d-none d-md-inline") Benutzerprofil
li(class="nav-item") if user.m4lab_idp == 1
a(class="nav-link pl-0" href="/account/security") li(class="nav-item")
i(class="fa fa-lock fa-fw") a(class="nav-link pl-0" href="/account/security")
span(class="d-none d-md-inline") Sicherheitseinstellungen i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item") li(class="nav-item")
a(class="nav-link pl-0" href="/account/services") a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw" style="color:black;") i(class="fa fa-tasks fa-fw" style="color:black;")
......
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