Mercurial > pumpbridge
diff index.js_to_pump.io-client-app_lib_routes @ 15:c5bf4e02958e
add/delete credentials, new layout, alpha version ribbon, contact
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Thu, 12 Jun 2014 20:51:10 +0200 |
parents | f190abf340ef |
children | d2208a4ed5c8 |
line wrap: on
line diff
--- a/index.js_to_pump.io-client-app_lib_routes Thu Jun 12 10:36:52 2014 +0200 +++ b/index.js_to_pump.io-client-app_lib_routes Thu Jun 12 20:51:10 2014 +0200 @@ -22,6 +22,7 @@ uuid = require("node-uuid"), User = require("../models/user"), Host = require("../models/host"), + Usermap = require("../../../../lib/usermap.js"), RequestToken = require("../models/requesttoken"), RememberMe = require("../models/rememberme"), site = require("../models/site"); @@ -41,7 +42,18 @@ var hosts, users, bank = Host.bank(); if (req.user) { - res.render('index', { pageTitle: "pumpbridge" , user: req.user}); + var fb=false, gp=false, tw=false; + Usermap.search({ + user_pumpio: req.user.id + }, function(err, result) { + if(err) res.render('login', { pageTitle: "pumpbridge" }); + _.each(result, function(um) { + if ( um.id.indexOf('@facebook') != -1 ) fb=true; + if ( um.id.indexOf('@twitter') != -1 ) tw=true; + if ( um.id.indexOf('@google') != -1 ) gp=true; + }); + res.render('index', { pageTitle: "pumpbridge" , user: req.user, usermapfb: fb, usermapgp: gp, usermaptw: tw}); + }); } else { res.render('login', { pageTitle: "pumpbridge" }); }