aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-24 13:29:32 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-24 13:29:32 +0200
commit5ce4fb45abdbdc3641e370dcfdf472035353fc3e (patch)
tree3a14ec5271f15a2552b31c17b0dc0f5abaded64d
parentfixed issue #21 (diff)
downloadDivid-5ce4fb45abdbdc3641e370dcfdf472035353fc3e.tar.gz
somewhat fixed #40 and #41
-rw-r--r--controllers/users.js9
-rw-r--r--views/newProject.ejs2
-rw-r--r--views/projectPost.ejs3
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 <divid@divid.no>',
}
-
- 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 @@
<div class="controls">
<div class="input-prepend">
<span class="add-on">u/fb.dennis.se/</span>
- <input id="projectname" name="name" placeholder="" class="span12" type="text" required="">
+ <input id="projectname" name="name" placeholder="" class="span12" type="text" required="" maxlength="40">
</div>
<p class="help-block">Navnet på prosjektet du vil lage</p>
</div>
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 @@
<fieldset>
<h1><legend><%= title %></legend></h1>
- <p>Ta på meg!</p>
<div class="control-group">
<label for="username" class="control-label">Av</label>
<div class="controls">
@@ -32,7 +31,7 @@
<div class="control-group">
<label for="what" class="control-label">Hva <strong class="text-error">*</strong></label>
<div class="controls">
- <input type="text" name="what" id="what" placeholder="Hva ble kjøpt" required>
+ <input type="text" name="what" id="what" placeholder="Hva ble kjøpt" required maxlength="40">
</div>
</div>
<%