Commit 354419d8 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

MLAB 249: Prevent HFT accounts to create an account from the registration page.

This commit is part of merge request !39. Comments created here will be created in the context of that merge request.
Showing with 69 additions and 55 deletions
+69 -55
...@@ -523,6 +523,16 @@ module.exports = function (app, config, passport, i18n) { ...@@ -523,6 +523,16 @@ module.exports = function (app, config, passport, i18n) {
createdDate: curDate.toISOString().slice(0,10) createdDate: curDate.toISOString().slice(0,10)
} }
var userEmail = userData.email
var pos = userEmail.indexOf('@')
var emailLength = userEmail.length
var emailDomain = userEmail.slice(pos, emailLength);
if ( emailDomain.toLowerCase() == "@hft-stuttgart.de") {
req.flash('error', "Fehlgeschlagen: HFT-Account")
res.redirect('/account/registration');
}
else {
let token let token
async.waterfall([ async.waterfall([
function(done) { function(done) {
...@@ -577,6 +587,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -577,6 +587,7 @@ module.exports = function (app, config, passport, i18n) {
}) })
} }
]) ])
}
}) })
// ============= USER VERIFICATION ================================ // ============= USER VERIFICATION ================================
......
...@@ -14,9 +14,12 @@ html(lang="de") ...@@ -14,9 +14,12 @@ html(lang="de")
body body
div(class="container-fluid") div(class="container-fluid")
div(class="row") div(class="row")
div(class="col-md-6 offset-md-2") div(class="pt-4 pb-4 col-md-6 offset-md-2")
h3(class="mb-3 font-weight-bold") Neues Benutzerkonto anlegen h3(class="mb-3 font-weight-bold") Neues Benutzerkonto anlegen
div(class="col-md-6 offset-md-3") div(class="col-md-6 offset-md-3")
div(class="alert alert-info" role="alert")
| Auf dieser Seite können sich Benutzer, die keinen Account an der HFT haben, registrieren.<br/>
| Um sich mit ihrem HFT-Account anzumelden, klicken Sie <a class="font-weight-bold" href="https://transfer.hft-stuttgart.de/account/">hier</a>.
if successes if successes
for success in successes for success in successes
div.alert.alert-success.alert-dismissible #{ success } div.alert.alert-success.alert-dismissible #{ success }
...@@ -26,7 +29,7 @@ html(lang="de") ...@@ -26,7 +29,7 @@ html(lang="de")
div.alert.alert-danger.alert-dismissible.fade.show #{ error } div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times; a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form(method="POST") form(method="POST")
h5(class="mb-3 font-weight-bold") Anmeldedaten h5(class="pt-2 mb-3 font-weight-bold") Anmeldedaten
div(class='form-row') div(class='form-row')
div(class='form-group col-md-6') div(class='form-group col-md-6')
input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="E-Mail-Adresse*", maxlength="45" required) input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="E-Mail-Adresse*", maxlength="45" required)
...@@ -34,7 +37,7 @@ html(lang="de") ...@@ -34,7 +37,7 @@ html(lang="de")
div(class="form-group col-md-6") div(class="form-group col-md-6")
input#inputPassword(name="inputPassword", type="password", class="form-control", data-toggle="password", placeholder="Passwort*", maxlength="45" required) input#inputPassword(name="inputPassword", type="password", class="form-control", data-toggle="password", placeholder="Passwort*", maxlength="45" required)
span#passwordWarning(class='warning') span#passwordWarning(class='warning')
h5(class="mb-3 font-weight-bold") Benutzerprofil h5(class="pt-2 mb-3 font-weight-bold") Benutzerprofil
div(class="form-row") div(class="form-row")
div(class='form-group col-md-2') div(class='form-group col-md-2')
select#inputSalutation(name="inputSalutation", class="form-control") select#inputSalutation(name="inputSalutation", class="form-control")
......
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