Mercurial > pumpbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
14:c1b736a859c9 | 15:c5bf4e02958e |
---|---|
20 async = require("async"), | 20 async = require("async"), |
21 _ = require("underscore"), | 21 _ = require("underscore"), |
22 uuid = require("node-uuid"), | 22 uuid = require("node-uuid"), |
23 User = require("../models/user"), | 23 User = require("../models/user"), |
24 Host = require("../models/host"), | 24 Host = require("../models/host"), |
25 Usermap = require("../../../../lib/usermap.js"), | |
25 RequestToken = require("../models/requesttoken"), | 26 RequestToken = require("../models/requesttoken"), |
26 RememberMe = require("../models/rememberme"), | 27 RememberMe = require("../models/rememberme"), |
27 site = require("../models/site"); | 28 site = require("../models/site"); |
28 | 29 |
29 exports.hostmeta = function(req, res) { | 30 exports.hostmeta = function(req, res) { |
39 | 40 |
40 exports.index = function(req, res, next) { | 41 exports.index = function(req, res, next) { |
41 var hosts, users, bank = Host.bank(); | 42 var hosts, users, bank = Host.bank(); |
42 | 43 |
43 if (req.user) { | 44 if (req.user) { |
44 res.render('index', { pageTitle: "pumpbridge" , user: req.user}); | 45 var fb=false, gp=false, tw=false; |
46 Usermap.search({ | |
47 user_pumpio: req.user.id | |
48 }, function(err, result) { | |
49 if(err) res.render('login', { pageTitle: "pumpbridge" }); | |
50 _.each(result, function(um) { | |
51 if ( um.id.indexOf('@facebook') != -1 ) fb=true; | |
52 if ( um.id.indexOf('@twitter') != -1 ) tw=true; | |
53 if ( um.id.indexOf('@google') != -1 ) gp=true; | |
54 }); | |
55 res.render('index', { pageTitle: "pumpbridge" , user: req.user, usermapfb: fb, usermapgp: gp, usermaptw: tw}); | |
56 }); | |
45 } else { | 57 } else { |
46 res.render('login', { pageTitle: "pumpbridge" }); | 58 res.render('login', { pageTitle: "pumpbridge" }); |
47 } | 59 } |
48 }; | 60 }; |
49 | 61 |