From 5ce4fb45abdbdc3641e370dcfdf472035353fc3e Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 24 May 2013 13:29:32 +0200 Subject: somewhat fixed #40 and #41 --- controllers/users.js | 9 ++++----- views/newProject.ejs | 2 +- views/projectPost.ejs | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/controllers/users.js b/controllers/users.js index 6d5ecaa..371dae6 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -152,7 +152,9 @@ exports.postProjectParticipants = function(req, res) { //var emails = sanitize(req.body.emails).xss(); emails = emails.split('\r\n'); emails.forEach(function(m) { // m = each mailaddress - if (m) v.check(m, m + ' is not a valid email').isEmail(); + if (m) { + v.check(m, m + ' is not a valid email').isEmail(); + } }); // error when validation fails @@ -168,8 +170,7 @@ exports.postProjectParticipants = function(req, res) { text: 'VIL DU BRUK DIVID?', from: 'Divid ', } - - emails.forEach(function(mailAddress) { // loops through all the emails and sets up each user + emails.forEach(function(mailAddress) { // loops through all the emails and sets up each user User.loadUser(mailAddress, function(err, user) { if (err) return res.status(500).render('error', { title: '500', text: 'En serverfeil oppstod', error: err.stack }); if (!user) { //if the user doesn't exist, create one @@ -213,9 +214,7 @@ exports.postProjectParticipants = function(req, res) { access.creator = req.user._id; access.project = project._id; message.text = 'Du ble lagt til projektet "' + project.name + '"'; - console.log('user.status = '+ user.status); if (Number(user.status) < 3) { - console.log('DAFUQ MANN! ER JO INNI IFFEN FFS!'); access.randomToken = access.generateRandomToken(15); message.text += '.\nDu kan få direkte tilgang til dette prosjektet her: https://divid.no/login/' + access.randomToken + ' \nDu kan bruke denne linken for å registrere deg, for å få tilgang til flere funksjoner: https://divid.no/invite/' + user.randomToken; } diff --git a/views/newProject.ejs b/views/newProject.ejs index 5559a9c..634c1d5 100644 --- a/views/newProject.ejs +++ b/views/newProject.ejs @@ -20,7 +20,7 @@
u/fb.dennis.se/ - +

Navnet på prosjektet du vil lage

diff --git a/views/projectPost.ejs b/views/projectPost.ejs index 80ed6d8..64e9785 100644 --- a/views/projectPost.ejs +++ b/views/projectPost.ejs @@ -15,7 +15,6 @@

<%= title %>

-

Ta på meg!

@@ -32,7 +31,7 @@
- +
<% -- cgit v1.2.3