Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res);
var locals = res.locals;
locals.user = req.user;
locals.user.password = "";
locals.superusers = keystone.get('superusers');
// Set locals
locals.section = 'edituser';
// Render the view
view.render('edituser');
};
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res),
locals = res.locals;
// locals.section = 'members';
view.query('organisations', Organisation.model.find().sort('name'), 'members');
view.render('site/organisations');
}
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res),
locals = res.locals;
locals.section = 'members';
locals.moment = moment;
// Load the Member
view.on('init', function(next) {
User.model.findOne()
.where('key', req.params.member)
.exec(function(err, member) {
if (err) return res.err(err);
if (!member) {
req.flash('info', 'Sorry, we couldn\'t find a matching member');
return res.redirect('/members')
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res);
var locals = res.locals;
// Set locals
locals.section = 'contact';
locals.enquiryTypes = Enquiry.fields.enquiryType.ops;
locals.formData = req.body || {};
locals.validationErrors = {};
locals.enquirySubmitted = false;
// On POST requests, add the Enquiry item to the database
view.on('post', { action: 'contact' }, function(next) {
var newEnquiry = new Enquiry.model(),
updater = newEnquiry.getUpdateHandler(req);
updater.process(req.body, {
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res);
var locals = res.locals;
// locals.section is used to set the currently selected
// item in the header navigation.
locals.section = 'home';
// Render the view
view.render('index');
};
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res);
var locals = res.locals;
locals.user = req.user;
//locals.user.password = "";
locals.superusers = keystone.get('superusers');
// Set locals
locals.section = 'resetpassword';
// Render the view
view.render('resetpassword');
};
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res),
locals = res.locals;
locals.section = 'meetups';
locals.page.title = 'Meetups - SydJS';
locals.rsvpStatus = {};
// LOAD the Meetup
view.on('init', function(next) {
Meetup.model.findOne()
.where('key', req.params.meetup)
.exec(function(err, meetup) {
if (err) return res.err(err);
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res),
locals = res.locals;
view.on('post', { action: 'send-password' }, function(next) {
User.model.findOne().where('email', req.body.email).exec(function(err, user) {
if (err) return next(err);
if (!user) {
req.flash('error', "Sorry, we don't recognise that email address.");
return next();
}
user.resetPassword(function(err) {
if (err) {
console.error("===== Reset Password failed to send email =====");
console.error(err);
exports = module.exports = function(req, res) {
var view = new keystone.View(req, res),
locals = res.locals;
locals.section = 'me';
locals.page.title = 'Settings - SydJS';
view.query('nextMeetup',
Meetup.model.findOne()
.where('state', 'active')
.sort('startDate')
, 'talks[who]');
view.query('rsvps.history',
RSVP.model.find()
.where('who', req.user)
.where('attending', true)
.populate('meetup')