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

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

7 merge requests!143updating yml config,!64Prepare production,!63Prepare after testing,!62Testing,!59Mlab 240,!40Mlab 26,!37MLAB-227: prevent HFT account to access "security" page
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,6 +29,7 @@ html(lang="de") ...@@ -29,6 +29,7 @@ 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
if user.m4lab_idp == 1
li(class="nav-item") li(class="nav-item")
a(class="nav-link pl-0" href="/account/security") a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw") i(class="fa fa-lock fa-fw")
......
...@@ -20,6 +20,7 @@ html(lang="de") ...@@ -20,6 +20,7 @@ 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
if user.m4lab_idp == 1
li(class="nav-item") li(class="nav-item")
a(class="nav-link pl-0" href="/account/security") a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw") i(class="fa fa-lock fa-fw")
......
...@@ -20,6 +20,7 @@ html(lang="de") ...@@ -20,6 +20,7 @@ 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
if user.m4lab_idp == 1
li(class="nav-item") li(class="nav-item")
a(class="nav-link pl-0" href="/account/security") a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw") i(class="fa fa-lock fa-fw")
......
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