fix user.csv data

v1.18.x
barisusakli 10 years ago
parent 220b42706f
commit 5c4e988232

@ -1050,13 +1050,13 @@ Upgrade.upgrade = function(callback) {
updatesMade = true; updatesMade = true;
winston.info('[2015/05/11] Updating widgets to tjs 0.2x'); winston.info('[2015/05/11] Updating widgets to tjs 0.2x');
require('./widgets/admin').get(function(err, data) { require('./widgets/admin').get(function(err, data) {
async.each(data.areas, function(area, next) { async.each(data.areas, function(area, next) {
require('./widgets').getArea(area.template, area.location, function(err, widgets) { require('./widgets').getArea(area.template, area.location, function(err, widgets) {
if (err) { if (err) {
return next(err); return next(err);
} }
for (var w in widgets) { for (var w in widgets) {
if (widgets.hasOwnProperty(w)) { if (widgets.hasOwnProperty(w)) {
widgets[w].data.container = widgets[w].data.container widgets[w].data.container = widgets[w].data.container

@ -32,9 +32,12 @@ module.exports = function(User) {
async.waterfall([ async.waterfall([
function(next) { function(next) {
db.getSortedSetRange('username:uid', 0, -1, next); db.getSortedSetRangeWithScores('username:uid', 0, -1, next);
}, },
function(uids, next) { function(users, next) {
var uids = users.map(function(user) {
return user.score;
});
User.getMultipleUserFields(uids, ['uid', 'email', 'username'], next); User.getMultipleUserFields(uids, ['uid', 'email', 'username'], next);
}, },
function(usersData, next) { function(usersData, next) {

@ -129,7 +129,7 @@
<div class="panel-heading">Users Control Panel</div> <div class="panel-heading">Users Control Panel</div>
<div class="panel-body"> <div class="panel-body">
<button id="createUser" class="btn btn-primary">New User</button> <button id="createUser" class="btn btn-primary">New User</button>
<a target="_blank" href="{relative_path}/api/admin/users/csv" class="btn btn-primary">Download CSV</a> <a target="_blank" href="{config.relative_path}/api/admin/users/csv" class="btn btn-primary">Download CSV</a>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save