Merge remote-tracking branch 'origin/master' into persona

v1.18.x
psychobunny 10 years ago
commit e3899f9535

@ -9,11 +9,10 @@ process.on('message', function(msg) {
if (msg.type === 'hash') {
hashPassword(msg.password, msg.rounds);
} else if (msg.type === 'compare') {
compare(msg.password, msg.hash);
bcrypt.compare(msg.password, msg.hash, done);
}
});
function hashPassword(password, rounds) {
async.waterfall([
function(next) {
@ -22,23 +21,14 @@ function hashPassword(password, rounds) {
function(salt, next) {
bcrypt.hash(password, salt, next);
}
], function(err, hash) {
if (err) {
process.send({err: err.message});
return process.disconnect();
}
process.send({result: hash});
process.disconnect();
});
], done);
}
function compare(password, hash) {
bcrypt.compare(password, hash, function(err, res) {
function done(err, result) {
if (err) {
process.send({err: err.message});
return process.disconnect();
}
process.send({result: res});
process.send({result: result});
process.disconnect();
});
}

@ -64,12 +64,12 @@ $(document).ready(function() {
ajaxify.handleACPRedirect = function(url) {
// If ajaxifying into an admin route from regular site, do a cold load.
url = ajaxify.removeRelativePath(url.replace(/\/$/, ''));
if (url.indexOf('admin') === 0 && window.location.pathname.indexOf('/admin') !== 0) {
if (url.indexOf('admin') === 0 && window.location.pathname.indexOf(RELATIVE_PATH + '/admin') !== 0) {
window.open(RELATIVE_PATH + '/' + url, '_blank');
return true;
}
return false;
}
};
ajaxify.start = function(url, quiet, search) {
url = ajaxify.removeRelativePath(url.replace(/\/$/, ''));

@ -62,7 +62,8 @@ var fs = require('fs'),
plaintext: translated[1],
template: template,
uid: uid,
pid: params.pid
pid: params.pid,
fromUid: params.fromUid
});
callback();
} else {

@ -84,8 +84,8 @@ function generateForTopic(req, res, next) {
feed.item({
title: 'Reply to ' + topicData.title + ' on ' + dateStamp,
description: postData.content,
url: nconf.get('url') + '/topic/' + topicData.slug + '#' + postData.pid,
author: postData.username,
url: nconf.get('url') + '/topic/' + topicData.slug + (postData.index ? '/' + (postData.index + 1) : ''),
author: postData.user ? postData.user.username : '',
date: dateStamp
});
}

Loading…
Cancel
Save