aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--app.js2
-rw-r--r--controllers/system.js2
-rw-r--r--models/Access.js (renamed from models/access.js)0
-rw-r--r--models/Project.js (renamed from models/project.js)0
-rw-r--r--models/User.js (renamed from models/user.js)23
-rw-r--r--views/home.ejs11
-rw-r--r--views/project.ejs2
7 files changed, 36 insertions, 4 deletions
diff --git a/app.js b/app.js
index 618ef8d..a0f7ae1 100644
--- a/app.js
+++ b/app.js
@@ -20,7 +20,7 @@ mongoose.connect(config.db);
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function callback(){
- console.log('Connected to MongoDB');
+ console.log('Connected to ' + config.db);
});
// Bootstrap models
diff --git a/controllers/system.js b/controllers/system.js
index 5400173..a5e8f46 100644
--- a/controllers/system.js
+++ b/controllers/system.js
@@ -109,6 +109,8 @@ exports.projectParticipants = function(req, res) {
exports.postProjectParticipants = function(req, res) {
+
+
}
diff --git a/models/access.js b/models/Access.js
index ce75f8c..ce75f8c 100644
--- a/models/access.js
+++ b/models/Access.js
diff --git a/models/project.js b/models/Project.js
index f29c7f8..f29c7f8 100644
--- a/models/project.js
+++ b/models/Project.js
diff --git a/models/user.js b/models/User.js
index b61f7c9..4d32941 100644
--- a/models/user.js
+++ b/models/User.js
@@ -5,7 +5,7 @@
var mongoose = require('mongoose')
, Schema = mongoose.Schema
- , crypto =require('crypto')
+ , crypto = require('crypto')
, authTypes = ['facebook', 'twitter'];
@@ -20,6 +20,7 @@ var UserSchema = new Schema({
provider: String,
hashed_password: String,
salt: String,
+ accessToken: String,
facebook: {},
twitter: {}
});
@@ -98,6 +99,7 @@ UserSchema.methods = {
return this.encryptPassword(plainText) === this.hashed_password;
},
+
/**
* Make salt
*
@@ -109,6 +111,7 @@ UserSchema.methods = {
return Math.round((new Date().valueOf() * Math.random())) + '';
},
+
/**
* Encrypt password
*
@@ -120,6 +123,24 @@ UserSchema.methods = {
encryptPassword: function(password) {
if (!password) return '';
return crypto.createHmac('sha1', this.salt).update(password).digest('hex');
+ },
+
+
+ /**
+ * Generate random access token for Remember Me function
+ *
+ * @return {String}
+ * @api public
+ */
+
+ generateRandomToken: function() {
+ var chars = "_!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
+ , token = new Date().getTime() + '_';
+ for (var i = 0; i < 16; i++) {
+ var x = Math.floor(Math.random() * 62);
+ token += chars.charAt(x);
+ }
+ return token;
}
}
diff --git a/views/home.ejs b/views/home.ejs
index 6d134c8..a473017 100644
--- a/views/home.ejs
+++ b/views/home.ejs
@@ -104,10 +104,19 @@
<iframe src="http://player.vimeo.com/video/41974181" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
</div>
- <div class="span5 sectionright">
+<<<<<<< HEAD
+ <div class="span5 sectionright">
+ <a href="https://itunes.apple.com/us/genre/ios-finance/id6015?mt=8" title="Appstore">
+ <div id="app" class="apple"> <img src="/img/iph.png" class="apple">
+ </a>
+ <a href="https://play.google.com/store"><img src="/img/android.png" id="android" class="infoimg"></a>
+ <a href="http://www.windowsphone.com/nb-no/store"><img src="/img/win.png" id="windows" class="infoimg"></a>
+=======
+ <div class="span5 sectionright">
<a href="https://itunes.apple.com/us/genre/ios-finance/id6015?mt=8"><img src="/img/iph.png" onmouseover="this.src='/img/iphoneA.png'" onmouseout="this.src='/img/iph.png'"></a>
<a href="https://play.google.com/store"><img src="/img/android.png" onmouseover="this.src='/img/androidA.png'" onmouseout="this.src='/img/android.png'"></a>
<a href="http://www.windowsphone.com/nb-no/store"><img src="/img/win.png" onmouseover="this.src='/img/winA.png'" onmouseout="this.src='/img/win.png'"></a>
+>>>>>>> a935f29043c48063839c5f139dbbde6817b213f6
</div>
</div>
</div>
diff --git a/views/project.ejs b/views/project.ejs
index 4bee9fd..e9978d5 100644
--- a/views/project.ejs
+++ b/views/project.ejs
@@ -35,7 +35,7 @@
Robert Joramo<br />
Dennis Eriksen<br />
Helene Apelort<br />
- <small><a href="/ppl">Legg til flere deltakere</a></small>
+ <small><a href="/project/fEyMe3/participants">Legg til flere deltakere</a></small>
</div>
</div>
<div class="row-fluid">