summaryrefslogtreecommitdiff
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/api/collaborator.js4
-rw-r--r--server/lib/views.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/api/collaborator.js b/server/lib/api/collaborator.js
index 4b55f09..f39022f 100644
--- a/server/lib/api/collaborator.js
+++ b/server/lib/api/collaborator.js
@@ -54,9 +54,9 @@ var collaborator = {
return res.json({ error: "can't find project" })
}
var data = util.cleanQuery(req.body)
- delete data.user_id
-
+ data.email = util.sanitize( data.email )
data.project_id = req.project._id
+ delete data.user_id
Collaborator.makeNonce(function(nonce){
data.nonce = nonce
diff --git a/server/lib/views.js b/server/lib/views.js
index 4faf80f..7137041 100644
--- a/server/lib/views.js
+++ b/server/lib/views.js
@@ -57,6 +57,8 @@ views.reader = function (req, res) {
date: moment(req.project.updated_at).format("M/DD/YYYY"),
author: user.displayName,
authorlink: "/profile/" + user.username,
+ canEdit: req.isOwner || req.isCollaborator,
+ editlink: "/project/" + req.project.slug + "/edit",
noui: !! (req.query.noui === '1'),
})
})