diff --git a/controllers/adminController.js b/controllers/adminController.js index 5da09e5..f15a63c 100644 --- a/controllers/adminController.js +++ b/controllers/adminController.js @@ -1,6 +1,8 @@ //File: controllers/userController.js var mongoose = require('mongoose'); -var userModel = mongoose.model('adminModel'); +var adminModel = mongoose.model('adminModel'); +var userModel = mongoose.model('userModel'); +var travelModel = mongoose.model('travelModel'); var config = require('../config'); var pageSize = config.pageSize; @@ -53,7 +55,7 @@ exports.signup = function(req, res) { //POST - auth user exports.login = function(req, res) { // find the user - userModel.findOne({ + adminModel.findOne({ username: req.body.username }) .select('+password') @@ -117,3 +119,130 @@ exports.changePassword = function(req, res) { exports.getUserByToken(req, res); }); }; + +function isNodeInNodes(node, nodes){ + for (var i=0; i